490 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 12 For/Break Instructions (FOR, FOR...DO, BRK, EXIT, RET)
Return (RET)
The RET instruction returns to the calling FOR instruction.
Operands:
Relay Ladder
None
Description:
When enabled, the RET instruction returns to the FOR instruction. The FOR
instruction increments the Index value by the Step size and executes the
subroutine again. If the Index value exceeds the Terminal value, the FOR
instruction completes and execution moves on to the instruction that follows the
FOR instruction.
The FOR instruction does not use parameters. The FOR instruction ignores any
parameters you enter in a RET instruction.
You could also use a TND instruction to end execution of a subroutine.
Arithmetic Status Flags: Not affected
Fault Conditions:
Execution:
Do not place a RET instruction in the main routine. If you place a RET
instruction in the main routine, a major fault occurs
(type 4, code 31).
A major fault will occur if Fault type Fault code
Main routine contains a RET instruction 4 31
Condition: Relay Ladder Action
Prescan The rung-condition-out is set to false.
Rung-condition-in is false The rung-condition-out is set to false.
Rung-condition-in is true Returns the specified parameters to the calling routine.
The rung-condition-out is set to true.
Postscan The rung-condition-out is set to false.