//*************************陣列取料算法*************************************//RTRIG_XY[0](Clk:=S12.Condition[70]);//觸發計數IF RTRIG_XY[0].Q THEN nstate_XY[0]:=nstate_XY[0]+1;//X計數加1END_IF;IF nstate_XY[0]>=INT#5 THEN//陣列行數遞增 nstate_XY[0]:=INT#0; nstate_XY[1]:=nstate_XY[1]+1;END_IF;IF nstate_XY[1]>=INT#2 THEN//料盤取完標志 nstate_XY[0]:=INT#0; nstate_XY[1]:=INT#0; S12.Condition[72]:=TRUE;END_IF;
HMI_Axis[11].AbsPos[10]:=HMI_Axis[11].AbsPos[1]+X_offset[0]*nstate_XY[0];//X取料位置HMI_Axis[17].AbsPos[10]:=HMI_Axis[17].AbsPos[1]+Y_offset[0]*nstate_XY[1];//Y取料位置