Chapter 9 - Program Control Instructions
-
Upload
mmorsy1981 -
Category
Documents
-
view
259 -
download
6
Transcript of Chapter 9 - Program Control Instructions
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 1/60
© 2011, The McGraw-Hill Companies, Inc.
Chapter 9
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 2/60
© 2011, The McGraw-Hill Companies, Inc.
Master Control ResetInstruction
9.1
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 3/60
© 2011, The McGraw-Hill Companies, Inc.
Program control instructions are used to enable
or disable a block of logic program or to move
execution of a program from one place toanother place.
Program Control menu tab for the Allen-Bradley
SLC 500 PLC
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 4/60
© 2011, The McGraw-Hill Companies, Inc.
Hardwired master control relays
are used in relay control circuitry
to provide input/output powershutdown of an entire circuit.
Hardwired
master control
relay circuit.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 5/60
© 2011, The McGraw-Hill Companies, Inc.
PLC manufacturers offer a form of a master
control relay as part of their instruction set.
Because the MCR instruction is programmed, for safety
reasons, it should not be used as a substitute for a
hardwired master control relay, which provides
emergency I/O power shutdown.
MCR (Master Control Reset) -Clears all set
nonretentive output rungs between the paired MCR
instructions.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 6/60
© 2011, The McGraw-Hill Companies, Inc.
Programmed Master Control Reset instruction.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 7/60© 2011, The McGraw-Hill Companies, Inc.
Simulated Master Control Reset instruction.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 8/60© 2011, The McGraw-Hill Companies, Inc.
MCR fenced zone with the zone true .
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 9/60© 2011, The McGraw-Hill Companies, Inc.
MCR fenced zone with the zone false .
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 10/60© 2011, The McGraw-Hill Companies, Inc.
Simulated MCR fenced zone.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 11/60© 2011, The McGraw-Hill Companies, Inc.
Jump Instruction
9.2
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 12/60
© 2011, The McGraw-Hill Companies, Inc.
The jump (JMP) instruction is used to jump over
certain program instructions when certain
conditions exist.
The label instruction is used to identify the ladder rung
that is the target destination but does not contribute tologic continuity.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 13/60
© 2011, The McGraw-Hill Companies, Inc.
Jump (JMP) operation program.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 14/60
© 2011, The McGraw-Hill Companies, Inc.
Simulated jump (JMP) operation program.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 15/60
© 2011, The McGraw-Hill Companies, Inc.
Effect on
instructions
of jumped
rungs.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 16/60
© 2011, The McGraw-Hill Companies, Inc.
Jump-to-label from two locations.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 17/60
© 2011, The McGraw-Hill Companies, Inc.
Subroutine Functions
9.3
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 18/60
© 2011, The McGraw-Hill Companies, Inc.
A subroutine is a short program that is used by
the main program to perform a specific function.
JSR (Jump to
Subroutine)
Jump to a
designatedsubroutine
instruction.
RET (Return from
Subroutine)
Exits current
subroutineand returns to
previous condition.
SBR
(Subroutine)
Identifies the
subroutineprogram.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 19/60
© 2011, The McGraw-Hill Companies, Inc.
When a subroutine is called from the main program,
the program is able to escape from the main program
and go to a program subroutine to perform certain
functions and then return to the main program.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 20/60
© 2011, The McGraw-Hill Companies, Inc.
Flashing pilot light subroutine program.
Anytime the weight on the conveyor exceeds a
preset value, the subroutine program is scanned
and pilot light changes from on to flashing.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 21/60
© 2011, The McGraw-Hill Companies, Inc.
Main
Program
Subroutine
Program
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 22/60
© 2011, The McGraw-Hill Companies, Inc.
Simulated subroutine program.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 23/60
© 2011, The McGraw-Hill Companies, Inc.
Setting up a
subroutine file.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 24/60
© 2011, The McGraw-Hill Companies, Inc.
Passing
subroutine
parameters
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 25/60
© 2011, The McGraw-Hill Companies, Inc.
Nested subroutines.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 26/60
© 2011, The McGraw-Hill Companies, Inc.
Immediate Input and
Immediate OutputInstructions
9.4
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 27/60
© 2011, The McGraw-Hill Companies, Inc.
The immediate input and immediate output
instructions interrupt the normal program scan
to update the input and output image table fileswith current data.
Immediate input
(IIN)
PLC-5 instructionis used to read an
input condition
before the I/O
update is performed.
Immediate output
(IOT)
PLC-5 instructionis used to update the
status of an output
device before the I/O
update is performed.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 28/60
© 2011, The McGraw-Hill Companies, Inc.
Immediate input
instruction operation.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 29/60
© 2011, The McGraw-Hill Companies, Inc.
Immediate output
instruction operation.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 30/60
© 2011, The McGraw-Hill Companies, Inc.
SLC 500 Immediate I nput with Mask (I IM )
instruction.
When the rung is true,
the program scan is
interrupted, and data
from a specific inputslot are transferred
through the mask to
the input data file.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 31/60
© 2011, The McGraw-Hill Companies, Inc.
SLC 500 Immediate Output with Mask (I OM)
instruction.
When the rung is
true, the program
scan is interrupted to
update output data tothe module located in
the slot specified in
the instruction.
9 5
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 32/60
© 2011, The McGraw-Hill Companies, Inc.
Forcing External I/O
Addresses
9.5
C
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 33/60
© 2011, The McGraw-Hill Companies, Inc.
Forcing allows the PLC
user to turn an external
input or output on or off
from the keyboard of the
programming device.
Forcing is accomplished
regardless of the actual
state of the field device.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 34/60
© 2011, The McGraw-Hill Companies, Inc.
Forcing an
input on.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 35/60
© 2011, The McGraw-Hill Companies, Inc.
Simulating forcing an input on.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 36/60
© 2011, The McGraw-Hill Companies, Inc.
Forcing an
output on.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 37/60
© 2011, The McGraw-Hill Companies, Inc.
Simulating forcing an output on.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 38/60
© 2011, The McGraw-Hill Companies, Inc.
By forcing outputs off , you can prevent the
controller from energizing those outputs even
though the ladder logic, which normallycontrols them, may be true.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 39/60
© 2011, The McGraw-Hill Companies, Inc.
You can enter and enable or disable forces while
you are monitoring your file offline, or in any
processor mode while monitoring your file online.
Forces version of the data table with bit
I:1/3 forced on.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 40/60
© 2011, The McGraw-Hill Companies, Inc.
If used incorrectly , force functions can cause
injuries to persons working around a system,
and/or equipment damage.You must
understand the
potential effect that
forcing given inputs
or outputs will have
on machine
operation in order toavoid possible
personal injury and
equipment damage.
9 6
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 41/60
© 2011, The McGraw-Hill Companies, Inc.
Safety Circuitry
9.6
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 42/60
© 2011, The McGraw-Hill Companies, Inc.
Sufficient emergency
circuits must be
provided to stopeither partially or
totally the operation of
the controller or the
controlled machine or
process.
These circuits should
be hardwired outside
the controller.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 43/60
© 2011, The McGraw-Hill Companies, Inc.
Safety wiring
requirements for aPLC installation.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 44/60
© 2011, The McGraw-Hill Companies, Inc.
The master
control relay
must be able
to inhibit all
machine
motion byremoving
power to the
machine I/O
devices whenthe relay is
deenergized.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 45/60
© 2011, The McGraw-Hill Companies, Inc.
Safety PLCs are now available for applications
that require more advanced safety functionality.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 46/60
© 2011, The McGraw-Hill Companies, Inc.
Both standard and safety PLCs have the ability
to perform control functions but a standard
PLC was not initially designed to be faulttolerant and fail-safe.
Safety PLCs have redundant (dual) microprocessors.
Safety PLCs have an internal output circuit
associated with each input for the purpose of testing
the input circuitry.
Safety PLCs use power supplies designed specifically
for use in safety control systems and redundant
backplane circuitry between the controller and I/O
modules.
Th f th fi ld
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 47/60
© 2011, The McGraw-Hill Companies, Inc.
The use of the field-
generated starter auxiliary
contact is safer because it
provides positive feedback
to the processor about the
exact status of the motor.
All b h ld b i d i
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 48/60
© 2011, The McGraw-Hill Companies, Inc.
All stop buttons should be wired using a
normally closed contact programmed to examine
for an on condition .
Using a normally open contactprogrammed to examine for an off
condition will produce the same logic but
is not considered to be as safe.
9 7
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 49/60
© 2011, The McGraw-Hill Companies, Inc.
Selectable TimedInterrupt
9.7
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 50/60
© 2011, The McGraw-Hill Companies, Inc.
The selectable timed interrupt (STI ) instruction is
used to interrupt the scan of the main program
file automatically, on a time basis , to scan aspecif ied subroutine f i le .
The selectable timed disable
(STD) instruction is generally
paired with the selectable timed
enable (STE) instruction tocreate zones in which STI
interrupts cannot occur.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 51/60
© 2011, The McGraw-Hill Companies, Inc.
The selectable timed
disable (STD)instruction
is generally paired
with the selectabletimed enable
(STE) instruction to
create zones in which
STI interrupts
cannot occur.
9 8
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 52/60
© 2011, The McGraw-Hill Companies, Inc.
Fault Routine
9.8
A f l t b ti f i l if d d t i h
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 53/60
© 2011, The McGraw-Hill Companies, Inc.
A faul t subroutine f i le , if used, determines how
the processor responds to a programming error.
When the processor detects a major fault, it looks for a
fault routine. If a fault routine exists, it is executed; if one
does not exist, the processor shuts down.
When there is a fault routine, and the fault is
recoverable, the fault routine is executed.
If the fault is non-recoverable, the fault routine
is scanned once and shuts down.
9 9
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 54/60
© 2011, The McGraw-Hill Companies, Inc.
Temporary EndInstruction
9.9
Th t d (TND) i t ti i d t
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 55/60
© 2011, The McGraw-Hill Companies, Inc.
The temporary end (TND) instruction is used to
progressively debug a program or conditionally
omit the balance of your current program file orsubroutines.
When rung conditions are true,
this instruction stops the
program scan, updates the I/O,
and resumes scanning at rung
0 of the main program file.
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 56/60
© 2011, The McGraw-Hill Companies, Inc.
The TND instruction
lets your program run
only up to this
instruction.
You can move it progressively
through your program as youdebug each new section.
You can program the TND
instruction unconditionally, or
you can condition its rung
according to your debugging
needs.
Si l t d t d i t ti
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 57/60
© 2011, The McGraw-Hill Companies, Inc.
Simulated temporary end instruction program.
9 10
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 58/60
© 2011, The McGraw-Hill Companies, Inc.
Suspend Instruction
9.10
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 59/60
© 2011, The McGraw-Hill Companies, Inc.
The suspend (SUS) instruction is used to trap
and identify specific conditions during system
troubleshooting and program debugging.
When the rung is true the SUS
7/25/2019 Chapter 9 - Program Control Instructions
http://slidepdf.com/reader/full/chapter-9-program-control-instructions 60/60
When the rung is true, the SUS
output instruction places the
controller in the suspend mode
and the PLC immediatelyterminates scan cycling.
All ladder logic outputs are de-energized, but other
status files have the data present when the suspendinstruction is executed.
The SUS instruction writes the suspend ID number
(100) to S:7 as it executes.
You can include several SUS instructions in a
program, each with a different suspend ID.