Jump to Label (JMP) and Label (LBL)
The JMP and LBL instructions skip portions of ladder logic.
When true, the JMP instruction skips to the referenced LBL instruction and the controller continues executing from there. When false, the JMP instruction does not affect ladder execution.
The JMP and LBL it references must be in the same routine.
The JMP instruction can move ladder execution forward or backward. Jumping forward to a label saves program scan time by omitting a logic segment until it is needed. Jumping backward lets the controller repeat iterations of logic.
IMPORTANT | Be careful not to jump backward an excessive number of times. The watchdog timer could time out because the scan does not complete in time. |
ATTENTION:
ATTENTION:
Jumped logic is not scanned. Place critical logic outside the jumped zone.A JMP instruction requires the associated label to exist before you:
- Download when working offline.
- Accept edits when working online.
The LBL instruction must be the first instruction on the rung.
A label name must be unique within a routine. The name can:
- Have as many as 40 characters.
- Contain letters, numbers, and underscores (_).
Available Languages
Ladder Diagram
Operands
Ladder Diagram
Operand | Type | Format | Description |
---|---|---|---|
JMP instruction | |||
Label name | label name | Enter the name for associated LBL instruction | |
LBL instruction | |||
Label name | label name | Execution jumps to the references LBL instruction |
Affects Math Status Flags
No.
Major/Minor Faults
None specific to this instruction. See Common Attributes for operand-related faults.
Execution
Ladder Diagram
Condition | Action |
---|---|
Prescan | N/A |
Rung-condition-in is false | N/A |
Rung-condition-in is true | (For JMP) Execution jumps to the rung that contains the LBL instruction with the referenced label name. (For LBL) no action taken |
Postscan | N/A |
Example
Ladder Diagram
JMP
When the JMP instruction is enabled, execution jumps over successive rungs of logic until it reaches the rung that contains the LBL instruction with label_20.
LBL
Provide Feedback