Programming Considerations for PLC-5 Processors F–7
Publication
65566.5.1 - October 1996
How Subroutines Are Scanned
Subroutines are accessed from your main program file or from other
subroutines (nested) by means of these instructions (Figure F.2):
• Jump To Subroutine (JSR) – located anywhere in your ladder logic
• Subroutine (SBR) – the first instruction in the subroutine file and
the target of the JSR instruction (directs the processor scan to the
subject subroutine)
• Return (RET) – returns the processor scan to the rung
immediately following the originating JSR instruction
Figure F.2
Program
Scan for an Example Jump to Subroutine and Return
SBR
] [ ] [
] [
( )
] [ ] [
( )
] [
( )
] [ ] [
( )
RET
Main Program or Subroutine
JSR
to SBRn
T
arget Subroutine
] [
( )
] [ ] [
( )
] [ ] [
] [ ] [
( )
] [
Program
Scan
] [
( )
] [ ] [
End
n