Programming instructions

9-8
Commands for Controlling Processes and Programs NC Programming 17VRS
DOK-MTC200-NC**PRO*V17-ANW1-EN-P
9.3 Program Control Commands
Return to NC program Begin
‘RET’
The "RET" command identifies the end of an NC program. The "RET"
command acts like functions "M002"/"M030," however an auxiliary func-
tion is not passed on to the SPS. When the "RET" command is per-
formed, processing branches to the first NC block in the active NC pro-
gram, sets the preparatory functions for the power-on state, and waits for
a start signal. After the "RET" command has been performed, the current
reverse vector points to the branch label ".HOME".
RET
After the "RET" command is performed, all subroutine levels and their
reverse vectors are cleared and the controller is in the initial state in the
main program level.
In terms of its function "RET" is comparable to the "M002"/"M030"
functions defined in DIN 66025.
Branch with Stop
‘BST’
The "BST" command branches to the branch label which is set in the
command parameter, sets the preparatory functions of the "power-on
state" and waits for a start signal. After a "BST", the current reverse vec-
tor points to the branch label ".HOME".
BST <branch label>
BST .HALT
After a "BST" command, all subroutine levels and their reverse vectors
are cleared and the controller is in the initial state.
The "BST" command cannot be used within a subroutine . The branch
from the subprogram will result in an error message.
Programmed
Halt ‘HLT’
The "HLT" command interrupts program execution and waits for a new
start signal. The "HLT" command acts like function "M000," however an
auxiliary function is not passed on to the SPS:
HLT
If a message is to be output with the "HLT" command, it is important to
note that the message must be programmed in a NC block prior to the
"HLT" command. The reason for this is that the "HLT" command is exe-
cuted ahead of a message in the standard order in which NC commands
are carried out (see Chapter "Elements of an NC block").
Syntax
Syntax
Syntax