JSR, SBR, and RET Instruction Styles Overview
This topic explains the supported styles for JSR, SBR, and RET instructions,
including behaviors, workflows, validations, and migration guidance.
Supported Styles for JSR, SBR, and RET Instructions
Controller App programs support two distinct styles for Jump to Subroutine (JSR),
Subroutine (SBR), and Return (RET) instructions: Legacy and Routine Parameter styles. Each
style has unique behaviors, validation rules, and workflows.
Legacy Style Characteristics
In the Legacy style, manually specify input and output parameters in JSR instructions. SBR
brings in inputs and RET pushes outputs. You can use any controller, program, or routine
scoped tags. SBR must be the first instruction on the first rung.
Routine Parameter Style Characteristics
When routine parameters are present, JSR automatically integrates input and output
parameters. SBR instructions are not used, and RET is only used to return execution without
parameters.
Workflows for Each Style
Both styles begin with adding a JSR instruction and entering a subroutine name. The editor
determines the style based on routine parameters. Legacy style requires SBR and RET
instructions with parameters. Routine Parameter style does not use SBR, and RET instructions
do not take parameters.
DSL Format Consistency
The DSL format for JSR is consistent across both styles. specifying the subroutine name and
arrays of input and output parameters. RET applies only to structured text and ladder
diagram languages.
Validation Rules
Validation rules ensure consistency, such as errors when SBR is used with routine parameters or when RET instructions specify parameters inappropriately. Parameter counts must match between JSR, SBR, and RET instructions.
Migration Guidance
Projects migrating from Logix Designer use the Legacy style, preserving existing SBR and
RET instructions as needed.
Provide Feedback