Programming instructions

NC Programming 17VRS Commands for Controlling Processes and Programs
9-11
DOK-MTC200-NC**PRO*V17-ANW1-EN-P
Branch to NC Subroutine ‘BSR’
The "BSR" command branches to the label set in the command parame-
ter and continues program execution there.
BSR <label>
BSR .UP1
After the return from a subroutine called by using the "BSR" command via
the "RTS" command, the calling program is continued at the next NC
block.
Return from NC Subroutine ‘RTS’
The "RTS" command marks the end of the subroutine. After the "RTS"
command finished, processing returns to the NC program from which the
call was made, and NC block processing is continued in the NC block
following "BSR" or "JSR."
RTS
If a subroutine call did not precede the return from a subroutine (BSR,
JSR), the program will be stopped and an error message will be gen-
erated.
.
BSR .UP1
.
.
BSR .UP1
.
.
BSR .UP1
.
.
RET
.UP1
.
.
RTS
Fig. 9-6: Branch to NC subroutine
Syntax
Syntax