JSR, SBR, and RET instruction examples
Syntax examples and migration notes for JSR, SBR, and RET instructions, including parameter handling.
Routine parameter style examples
- Routine with intermixed input and output parameters
- The order of input and output parameters must match the routine declaration.routine ld myRoutine(input dint in1, output dint out1, input dint in2, output dint out2, output dint out3) { }JSR call to the above routine:jsr (myRoutine, #{in1, in2}, #{out1, out2, out3})
- Routine with no input parameters
- If there are no input or output parameters, you must still specify the unbounded array.routine ld myRoutine(output dint out1, output dint out2, output dint out3) { }JSR call to the above routine:jsr (myRoutine, #{}, #{out1, out2, out3})
- Routine with no parameters
- You must specify the unbounded array. This allows all arguments to be distinguished.routine ld myRoutine() { }JSR call to the above routine:jsr (myRoutine, #{}, #{})
Migration from legacy projects
Migration from Logix Designer projects uses the legacy style.
- JSR
- RLL form:JSR jsr0(subroutineName, #{ input0, input1, ... }, #{ output0, output1, ... });
- SBR
- If SBR exists in the migrated project:SBR(in1, in2, int3);
- RET
- If RET exists in the migrated project:RET(out1, out2, out3);
Provide Feedback