Subroutines
Precautions
When the subroutine is not being executed, the instructions are treated as
NOP(000).
Place the subroutines after the main program and just before the END(001)
instruction in the program for each task. If part of the main program is placed
after the subroutine region, that program section will be ignored.
Note The input method for the subroutine number, N, is different for the CX-Pro-
grammer and a Programming Console. Input #0 to #1023 on the CX-Program-
mer and 0000 to 1023 on a Programming Console.
Be sure to place each subroutine in the same program (task) as its corre-
sponding SBS(091) or MCRO(099) instruction. A subroutine in one task can-
not be called from another task. It is possible to program a subroutine within
an interrupt task.
SBS
MCRO
n
n
SBN
n
Subroutine
region
RET
OR
Subroutine region
This part of the
program won't be
executed.
Section 3-19
823
Need help?
Do you have a question about the SYSMAC CJ - REFERENCE MANUAL 01-2008 and is the answer not in the manual?
Questions and answers