
B–61803E–1/10
6. FUNCTIONS OF THE MACRO
EXECUTOR
PROGRAMMING
121
(3) Check after the completion of movement
To determine whether the tool has moved to the specified position on
the PMC axis properly, check whether the target coordinates have
been reached after the completion of movement. If the tool is found
not to be at the target position by checking the coordinates after the
completion of movement, this indicates that the movement has been
canceled due to some alarm, an emergency stop, or another reason.
(Sample program)
When the signal R100.0 changes from OFF to ON, the tool is to move
by 100 mm.
#100 : State variable
#101 : Variable for monitoring R100.0 to determine if it
changes from OFF to ON
#102 : Variable for checking if the target position has been
reached
O1000 IF[#100 EQ 1] GOTO 100
IF[R100.0 EQ 1 && #101 EQ 0] THEN
#102 = #504x + 100.0 /*R100.0 OFF to ON
G340 X100.0 /* Store the target position
#100 = 1 /* Output the move command
GOTO 999 /* State variable = 1
ENDIF
#101 = R100.0
GOTO 999
N100 IF[[#87x0 AND 128] NE [#87x5 AND 128]] GOTO 999
IF[[#87x5 AND 18] NE 0] GOTO 999
/* Axial movement is in progress.
IF[[#87x5 AND 1] NE 1] GOTO 999
IF[ABS[#504x – #102] GT 0.000001] THEN
/* Error handling */
ENDIF
#101 = R100.0 /* Read R100.0 for the next detection
#100 = 0 /* State variable = 0
N999 M99
%