1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
| MODULE Module1 CONST robtarget Target_10:=[[347.037,682.5,875.06],[1,0,0,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]]; CONST robtarget Target_20:=[[500,-300,100],[1,0,0,0],[-1,0,-1,0],[9E9,9E9,9E9,9E9,9E9,9E9]]; CONST robtarget Target_30:=[[500,-300,100],[0,0,0,1],[-1,0,1,0],[9E9,9E9,9E9,9E9,9E9,9E9]]; VAR num layer:=1; VAR num x:=0; VAR num z:=0; PROC main() FOR i FROM 0 TO 20 DO SetDO JiaJu0,0; MoveJ Offs(Target_10,0,0,200),v500,fine,Tool1; WaitDI DaoWei0,1; MoveL Offs(Target_10,0,0,0),v500,fine,Tool1; SetDO JiaJu0,1; WaitTime 1; MoveL Offs(Target_10,0,0,200),v500,fine,Tool1;
IF layer MOD 2 = 1 THEN IF i MOD 5 < 4 and i MOD 5 <> 0 THEN MoveL Offs(Target_30,90+x,-150,300+z),v500,fine,Tool1; MoveL Offs(Target_30,90+x,-150,100+z),v500,fine,Tool1; SetDO JiaJu0,0; WaitTime 1; MoveL Offs(Target_30,90+x,-150,300+z),v500,fine,Tool1; x:=x+210; IF i MOD 5 = 3 THEN x:=0; ENDIF ELSE MoveL Offs(Target_20,150+x,-410,300+z),v500,fine,Tool1; MoveL Offs(Target_20,150+x,-410,100+z),v500,fine,Tool1; SetDO JiaJu0,0; WaitTime 1; MoveL Offs(Target_20,150+x,-410,300+z),v500,fine,Tool1; x:=x+300; ENDIF IF i MOD 5 = 0 THEN layer:=2; x:=0; z:=z+100; ENDIF ELSE IF i MOD 5 < 3 THEN MoveL Offs(Target_20,150+x,-100,300+z),v500,fine,Tool1; MoveL Offs(Target_20,150+x,-100,100+z),v500,fine,Tool1; SetDO JiaJu0,0; WaitTime 1; MoveL Offs(Target_20,150+x,-100,300+z),v500,fine,Tool1; x:=x+300; IF i MOD 5 = 2 THEN x:=0; ENDIF ELSE MoveL Offs(Target_30,100+x,-350,300+z),v500,fine,Tool1; MoveL Offs(Target_30,100+x,-350,100+z),v500,fine,Tool1; SetDO JiaJu0,0; WaitTime 1; MoveL Offs(Target_30,100+x,-350,300+z),v500,fine,Tool1; x:=x+210; ENDIF IF i MOD 5 = 0 THEN layer:=1; x:=0; z:=z+100; ENDIF ENDIF ENDFOR z:=0; ENDPROC ENDMODULE
|