User Manual Chapter 7
GFK-1742F Jan 2020
Programmed Motion 188
•
End of Program. Uses the ENDPROG statement. This statement clearly identifies the
end of the program and helps separate one program or subroutine from another.
The ENDPROG should be the only thing on the last line of any program:
ENDPROG
Multi-Axis Program Example
Note that the term MULTI-AXIS must be used in the PROGRAM statement on the first line,
and that axis numbers are specified in the applicable commands in the program body.
PROGRAM 1 MULTI-AXIS
ACCEL AXIS1 500000
VELOC AXIS1 5000
1: CMOVE AXIS2 –100000, ABS, LINEAR DWELL AXIS2 6000
JUMP CTL31, 1
CALL P255
LOAD P215, 2000
PMOVE AXIS1 8388607, INCR, S-CURVE
ENDPROG
Single-axis Subroutine Structure
•
SUBROUTINE definition statement. It must be the first line of the subroutine. It must
identify the subroutine number and contain the SINGLE-AXIS statement. For
example:
SUBROUTINE 3 SINGLE-AXIS
•
Body. The subroutine body contains the actual programmed commands. Note that
in a single-axis subroutine, you must not specify an axis number in any of the
commands. Doing so will generate an error. An example of correct syntax for a
single-axis subroutine command is:
ACCEL 50000
•
End of Subroutine. Uses the ENDSUB statement. This statement clearly identifies the
end of the subroutine and helps separate one subroutine or program from another.
The ENDSUB should be the only thing on the last line of any subroutine:
ENDSUB