687
3. Instructions
CS/CJ/NSJ Series Instructions Reference Manual (W474)
Subroutines
3
SBS
SBS
Applicable Program Areas
Operands
N: Subroutine number
Specifies the subroutine number between 0 and 1023 decimal.
Note For CJ1M-CPU11 and CJ1M-CPU21 CPU Units, the subroutine number must be between the range &0 to
&255 decimal.
z Operand Specifications
Combined-use instructions
SBN (subroutine entry) instructions and RET (subroutine return) instructions
Flags
Instruction Mnemonic Variations
Function
code
Function
SUBROUTINE CALL SBS @SBS 091
Calls the subroutine with the specified subroutine
number and executes that program.
Symbol
SBS
Area
Function block
definitions
Block program areas Step program areas Subroutines Interrupt tasks
SFC action or transition
programs
Usage Not allowed OK OK OK OK Not allowed
Operand Description Data type Size
N
Subroutine number
--- 1
Area
Word addresses
Indirect DM/EM
addresses
Con-
stants
Registers Flags
Pulse
bits
TR
bits
CIO WR HR AR T C DM EM
@DM
@EM
*DM
*EM
DR IR
Indirect
using IR
TK CF
N --- --- --- --- --- --- --- --- --- --- OK --- --- --- --- --- --- ---
Name Label Operation
Error Flag ER • ON if nesting exceeds 16 levels.
• ON if the specified subroutine number does not exist.
• ON if a subroutine calls itself.
• ON if a subroutine being executed is called.
• ON if the specified subroutine is not defined in the current task.
• OFF in all other cases.
N: Subroutine number
SBS(091)
N