beautypg.com

11ć7 – Rockwell Automation 1772-LP3 PLC - 2/30 Programmable Controller Programming and Operations Manual User Manual

Page 208

background image

Jump Instructions and

Subroutine Programming

Chapter 11

11Ć7

The Label instruction is always logically true. It should be programmed
as the first condition instruction in the rung. If conditions precede a Label
instruction in a rung, they will be ignored by the processor during a jump
operation.

Instruction overview:

Condition instruction, always logically true
Up to 64 label 2-digit octal identification numbers available
Each label can be defined only once
Can be the target of multiple jump or jump to subroutine instructions
Uses one word of memory

WARNING: Do not place a Label instruction in a ZCL or MCR
zone. When jumping over a start fence, the processor will
execute the program from the label to the end fence as if the
start fence had been true, i.e., outputs controlled by the rungs.
The start fence may have been false, intending that all outputs
within the zone be controlled by the output override instruction,
i.e., Off for MCR or last state for ZCL instructions (Section
7.1). Unpredictable machine operation and damage to
equipment and/or personal injury could result.

NOTE: Care should be taken not to misuse the Jump instructions and
subroutine programming. Misuse generally results in a run-time error
which causes the processor to fault. Misuse of the Label instruction will
cause the following run-time errors:

Multiple placement of the same label.
Removing a Label instruction but leaving the Jump or Jump to

Subroutine instruction(s) to which it was referenced.

The Jump to Subroutine instruction shown (Figure 11.7) is an output
instruction. It has an octal identification number from 00-77. When its rung
is true, it instructs the processor to jump from the main program to the
label instruction having the same identification number in the subroutine
area (Figure 11.8). Subroutine execution begins at that point.

When used in the main program area, this instruction must always cause
the processor to cross the boundary from the main program to the
subroutine area.

The Jump to Subroutine instruction can also be used to jump from one
subroutine to another subroutine in the subroutine area. These nested
subroutines will be explained in Section 11.3.2. The JSR instruction also

11.3
Jump to Subroutine
Instruction