PROC main()
Label1:
Inital;
WHILETRUEDO
Pick;
Pallet;
IF pndi13_diection_selet = 1 THEN
Pallet;
ELSE
Pallet_vert;
ENDIF
IF nCount = Totality THEN
MoveLpHome, v800, fine, tool0;
PulseDO\PLength:=1, pndo10_palletOK_part;
IF pndi12_palletOK_all = 1 THEN
PulseDO\PLength:=1, pndo11_palletOK_all;
Stop;
ENDIF
GOTO Label1;
ENDIF
ENDWHILE
ENDPROC
PROC Inital()
MoveJpHome, v600, fine, tool0;
Totality :=n_Totality;
Row :=n_Row;
Height := 1;
Y := 1;
H1 := 1;
H2 := 1;
nCount := 0;
PulseDO\PLength:=0.5, do00_tuici;
Reset do00_tuici;
Reset do01_shangci;
Reset pndo09_pick_ok;
Reset pndo10_palletOK_part;
Reset pndo11_palletOK_all;
ENDPROC
PROC Pallet()
MoveL pPlace_safe10, v600, z100, tool0;
MoveJ pPlace_safe30, v600, z100, tool0;
pPlace := pPlace_base;move off
IF Height MOD 2 = 1 THEN
pPlace := Offs(pPlace,X_offser,Y_offser - (Y - 1) * 61,Z_offser + (H1 -
1) * 28);
ELSE
pPlace := Offs(pPlace,X_offser,Y_offser + 15 - (Y - 1) * 61,Z_offser + (H2 - 1) * 26);
ENDIF
MoveLOffs(pPlace,0,0,50), v300, fine, tool0\WObj:=wobj_place;
MoveLpPlace, v20, fine, tool0\WObj:=wobj_place;
PulseDO\PLength:=1, do00_tuici;
WaitTime 1;
WaitDI di01_tuici_OK, 1;
MoveLOffs(pPlace,0,0,300), v300, z30, tool0\WObj:=wobj_place;
MoveL pPlace_safe30, v600, z50, tool0;
IncrnCount;
IF Y = Row THEN
Y := 0;
Incr Height;
IF Height MOD 2 = 1 THEN
Incr H1;
ELSE
Incr H2;
ENDIF
ENDIF
Incr Y;
ENDPROC
PROC Pallet_vert()
MoveL pPlace_safe100, v600, z100, tool0;
MoveJ pPlace_safe110, v600, z100, tool0;
MoveJ pPlace_base2, v50, fine, tool0\WObj:=wobj_place;
pPlace := place_base2;
IF Height MOD 2 = 1 THEN
pPlace := Offs(pPlace,X_offser,Y_offser - (Y - 1) * 61,Z_offser + (H1 - 1) * 28);
ELSE
pPlace := Offs(pPlace,X_offser,Y_offser + 15 - (Y - 1) * 61,Z_offser + (H2 - 1) * 26);
ENDIF
MoveLOffs(pPlace,0,0,50), v300, fine, tool0\WObj:=wobj_place;
MoveLpPlace, v20, fine, tool0\WObj:=wobj_place;
PulseDO\PLength:=1, do00_tuici;
WaitTime 1;
WaitDI di01_tuici_OK, 1;
MoveLOffs(pPlace,0,0,300), v300, z30, tool0\WObj:=wobj_place;
MoveL pPlace_safe30, v600, z50, tool0;
IncrnCount;
IF Y = Row THEN
Y := 0;
Incr Height;
IF Height MOD 2 = 1 THEN
Incr H1;
ELSE
Incr H2;
ENDIF
ENDIF
Incr Y;
ENDPROC
PROC Pick()
MoveJ p10, v600, fine, tool0;
WaitDI pndi09_can_pick, 1;
MoveLpPick_base, v20, fine, tool0\WObj:=wobj0;
pPick := pPick_base;
pPick := Offs(pPick,0,-L_offser / 2,0);
MoveLOffs(pPick,0,0,70), v200, fine, tool0\WObj:=wobj0;
IF Height MOD 2 = 1 THEN
MoveLpPick, v20, fine, tool0\WObj:=wobj0;
ELSE
MoveLOffs(pPick,0,0,15), v20, fine, tool0\WObj:=wobj0;
ENDIF
PulseDO\PLength:=1, do01_shangci;
WaitDI di02_shangci_OK, 1;
MoveLOffs(pPick,0,0,100), v150, z50, tool0\WObj:=wobj0;
MoveLOffs(pPick,0,0,400), v400, z50, tool0\WObj:=wobj0;
PulseDO\PLength:=1, pndo09_pick_ok;
ENDPROC
PROC wobj_place0()
MoveL p_x1, v20, fine, tool0;
MoveL p_x2, v20, fine, tool0;
MoveLp_y, v20, fine, tool0;
ENDPROC
PROC set_home()
WZSphDef\Inside, shape1, home_C1, 100;
WZDOSet\Temp, home_wz\Before, shape1, pndo07_home, 1; ENDPROC
PROC ppp()
IDelete intno1;
CONNECT intno1 WITH kkk;
ISignalDI\Single, di01_tuici_OK, 1, intno1;
IWatch intno1;
MoveL p30, v100, fine, tool0;
MoveL p40, v20, fine, tool0;
ENDPROC
TRAP kkk
StopMove;
WaitTime 3;
!WaitDI di01_tuici_OK, 0;
StartMove;
MoveJ p50, v100, fine, tool0;
IDelete intno1;
ENDTRAP
ENDMODULE

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。