我刚编写的程序,FOR 嵌套IF再嵌套FOU。
PROC main()
MoveAbsJ [[-22.6263,-33.2155,21.2949,13.2529,52.6506,-15.2003],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]\NoEOffs, v1000, z0, tool0;
MoveL p10, v1000, z0, tool0;
WaitTime 1;
reg1 := 0;
reg2 := 0;
FOR i FROM 1 TO 5 DO
IF i MOD 2 = 1 THEN
FOR j FROM 1 TO 5 DO
MoveL p60, v3000, z0, tool0;
MoveL Offs(p60,0,0,-30), v1000, z0, tool0;
MoveL p60, v1000, z0, tool0;
reg1 := (i - 1) * 100;
reg2 := reg2 + 100;
p20 := Offs(p10,reg2,reg1,0);
MoveL p20, v3000, z0, tool0;
MoveL Offs(p20,0,0,-30), v1000, z0, tool0;
MoveL p20, v1000, z0, tool0;
WaitTime 1;
ENDFOR
ELSE
FOR k FROM 1 TO 5 DO
MoveL p60, v3000, z0, tool0;
MoveL Offs(p60,0,0,-30), v1000, z0, tool0;
MoveL p60, v1000, z0, tool0;
reg1 := (i - 1) * 100;
p20 := Offs(p10,reg2,reg1,0);
MoveL p20, v3000, z0, tool0;
MoveL Offs(p20,0,0,-30), v1000, z0, tool0;
MoveL p20, v1000, z0, tool0;
reg2 := reg2 - 100;
WaitTime 1;
ENDFOR
ENDIF
ENDFOR
MoveJ p10, v1000, z0, tool0;
ENDPROC
ENDMODULE