Programmable Logic Controllers: Frank D. Petruzella
Programmable Logic Controllers: Frank D. Petruzella
Logic Controllers
Third Edition
Frank D. Petruzella
McGraw-Hill
Chapter 9
Program
Control
Instructions
Program Control Instructions
Program control instructions
are used to alter the program
scan from its normal
sequence. Sometimes referred
to as override instructions,
they provide a means of
executing sections of the
control logic if certain
conditions are met. They
allow for greater program
flexibility and greater
efficiency in the program
scan.
Typical Program Control Instructions Based
On The SLC 500 And Associated RSLogix
Software
Program Control
MCR
SUS
TND
RET
JSR
LBL
JMP
SBR Master
Suspend
Jump Control
Temporary
Return
LabeltoEnd
from
Jump
Subroutine Reset
Subroutine
toSubroutine
Label Clears
Identifies
Makes
Jump aall
Specifies
Exits
Jumpcurrent
to set
specific
alabeloutputs
temporary
designated end
subroutine
location
forward/backward
Identifies the subroutine
between
conditions
that
to ahalts
subroutine
and the
returns
program for
paired
to program
program MCR
instruction
corresponding previous
label
instruction
debugging
instructionand system
execution
condition
troubleshooting
Hardwired Master Control Relay Circuit
A jump jumps to a label with the same address. The area that
the processor jumps over is defined by the locations of the
jump and label instructions in the program.
If the jump coil is energized, all logic between the jump and
label instructions is bypassed and the processor continues
scanning after the LBL instruction.
Jump
To Label Timers should be
Program programmed
outside the
jumped section
Input conditions
are not examined Jumped program
and outputs remain rungs (5,6,7) are
in their last state
not scanned by
the processor
Jump-To-Label From Two Locations
20
20
20
Jump-To-Label Instructions
In a SLC 500 or PLC-5 the JMP will have a number from 0 to 255,
and the corresponding LBL will have the same number. In the
ControlLogix controller the JMP and LBL have the same number.
You should never jump into an MCR zone. Instructions that are
programmed within the MCR zone starting at the LBL
instruction and ending at the end MCR instruction will always
be evaluated as though the MCR zone is true, without
consideration to the state of the start MCR instruction.
Jump - To - Subroutine
Another valuable tool in PLC programming is to be able
to escape from the main program and go to a program
subroutine to perform certain functions and then return
to the main program.
Allen-Bradley Subroutine-Related Instructions
L1 L2
Program
10
Forcing An Input Address On
Force> ON
With the right mouse button, click the I/O bit you want to force.
From the menu that appears select "Goto Data Table".
From the associated data table that appears click on the "Forces"
button.
The Forces version of the data table appears with the selected bit
highlighted. Click on this bit with the right mouse button.
From the menu that appears you can force the selected bit
"on“ or "off".
Enter And Enable Or Disable Forces
Motor
Motor operating
overload
normally
occurs
Switch SW 13 is closed to
energize the TND
Normal program scan
instruction and stop all
scanning beyond this point.
11. Immediate instructions are used
a. to provide a pulse for timing or
counting
b. to lock in a condition
c. when the input or output being
controlled is very time dependent
d. to control blocks of a logic ladder
program
12. The forcing function of a PLC allows the user
to turn an external input or output on or off
from the programming device regardless
of its actual state. (True/False)
(c) start