Computer Hardware User Manual

!
284
The following diagram illustrates program execution flow for various execution
conditions for two SBS(91).
SBS(91) 000
SBS(91) 001
SBN(92) 000
RET(93)
SBN(92) 001
RET(93)
END(001)
Main
program
Subroutines
A
B
C
D
E
A
A
A
A
B
B
B
B
C
C
C
C
D
D
E
E
OFF execution conditions for
subroutines 000 and 001
ON execution condition for
subroutine 000 only
ON execution condition for
subroutine 001 only
ON execution conditions for
subroutines 000 and 001
Note A non-fatal error (error code 8B) will be generated if a subroutines execution
time exceeds 10 ms.
Flags ER: A subroutine does not exist for the specified subroutine number.
A subroutine has called itself.
An active subroutine has been called.
Caution SBS(91) will not be executed and the subroutine will not be called when ER is
ON.
5-23-4 SUBROUTINE DEFINE and RETURN SBN(92)/RET(93)
N: Subroutine number
000 to 255
Ladder Symbols Definer Data Areas
SBN(92) N
RET(93)
Limitations Each subroutine number can be used in SBN(92) once only.
Description SBN(92) is used to mark the beginning of a subroutine program; RET(93) is
used to mark the end. Each subroutine is identified with a subroutine number, N,
that is programmed as a definer for SBN(92). This same subroutine number is
used in any SBS(91) that calls the subroutine (see 5-23-3 SUBROUTINE EN-
TER SBS(91)). No subroutine number is required with RET(93).
Subroutines and Interrupt Control Section 5-23