17ć3 – Rockwell Automation 1772-L8_LW_LWP_LX_LXP,D17726.5.8 User Manual User Manual
Page 262
Jump Instructions and
Subroutine Programming
Chapter 17
17-3
The Return instruction is an output instruction. It is used only in the
subroutine area to terminate a subroutine or selectable timed interrupt and
return the processor to the main program or, in the case of nested
subroutines, return program execution to the preceding subroutine. It
returns program execution to the instruction immediately following the
Jump to Subroutine instruction that initiated the subroutine. Program
execution continues from that point.
It is programmed as an output instruction without an identification number
in the subroutine area. It is usually programmed unconditionally. Every
subroutine must have a Return instruction.
RET
Enter one of the above instructions by performing the following steps.
1. Press -(JMP)-, -(SR)-, or [SHIFT] -(RET)-.
Important: Do not perform step 2 for a Return instruction.
2. Enter
Removing a Label Instruction
Remove the Label instruction by performing the following steps.
1. Position the cursor over the Label instruction you want to remove.
2. Press [Remove][Shift][LBL].
Editing Jump Instructions
Edit one of the above instructions by performing the following steps.
1. Position the cursor over the instruction you are going to edit.
2. Press [Remove]
3. Press -(JMP)-, -(JSR)-, or [SHIFT]-(RET)- or any other appropriate
instruction type key.
Important: Do not perform step 3 for a Return instruction.
4. Enter
The subroutine area is located in the memory between the end of the main
program and the beginning of the message store areas (Figure 17.1). The
subroutine area allows you to store small programs you plan to access
periodically. Subroutines are not scanned unless you program the
processor to jump into this area.
Return
Entering Jump Instructions
Subroutine Area Instruction