Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 459
Program Control Instructions (JMP, LBL, JSR, RET, SBR, JXR, TND, MCR, UID, UIE, AFI, NOP, EOT, SFP, SFR, EVENT) Chapter 11
Example 1: The JSR instruction passes value_1 and value_2 to routine_1.
The SBR instruction receives value_1 and value_2 from the JSR instruction and
copies those values to value_a and value_b, respectively. Logic execution
continues in this routine.
The RET instruction sends float_a to the JSR instruction. The JSR instruction
receives float_a and copies the value to float_value_1. Logic execution continues
with the next instruction following the JSR instruction.
Relay Ladder
Structured Text
Routine Program
Main routine
Subroutine
Routine Program
Main routine JSR(routine_1,2,value_1,value_2,float_value_1);
Subroutine SBR(value_a,value_b);
<statements>;
RET(float_a);