17ć2, Jump to subroutine label – Rockwell Automation 1772-L8_LW_LWP_LX_LXP,D17726.5.8 User Manual User Manual

Page 261

Advertising
background image

Jump Instructions and

Subroutine Prorgramming

Chapter 17

17-2

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

This instruction always causes the processor to cross the boundary from
the main program to the subroutine area.

JSR

02

010

00

The Label instruction is the target for both the Jump and Jump to
Subroutine instructions. Label instructions are assigned octal identification
numbers from 00-07. The label identification number must be the same as
that of the Jump and/or Jump to Subroutine instruction with which it is
used. A Label instruction can be defined only once, meaning that a label
with a given identification number can only appear in one location.
However, a Label instruction can be the target of jumps from more than
one location.

The Label instruction is always logically true. Programmed as the first
condition instruction in the rung. If conditions precede a Label instruction,
they will be ignored by the processor during a jump operation. Do not
program with a program control instruction.

Important: If conditions precede a Label instruction, they are ignored by
the processor during a jump operation.

010

00

01

LBL

010

00

ATTENTION: Do not place a Label instruction in a ZCL or
MCR zone. When jumping over a start fence, the processor
executes the program from the label to the end fence as if the
start fence had been true. The start fence may have been false
intending that all outputs within the zone are controlled by the
output override instruction (i.e. OFF for MCR or last state for
ZCL instructions).

Failure to observe this warning could cause unexpected
operation with possible damage to equipment and/or injury
to personnel.

Jump to Subroutine

Label

Advertising