0% found this document useful (0 votes)
15 views5 pages

Program Control Instructions 2025

The document outlines various Program Control Instructions used to manage the execution sequence of ladder programs, including JMP, LBL, JSR, SBR, RET, MCR, TND, SUS, IIM, and IOM instructions. These instructions help optimize scan time, improve program efficiency, and facilitate troubleshooting. Key considerations include avoiding excessive jumps, proper use of master control instructions, and ensuring correct placement of control instructions within the program structure.

Uploaded by

Joseph Mbugua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views5 pages

Program Control Instructions 2025

The document outlines various Program Control Instructions used to manage the execution sequence of ladder programs, including JMP, LBL, JSR, SBR, RET, MCR, TND, SUS, IIM, and IOM instructions. These instructions help optimize scan time, improve program efficiency, and facilitate troubleshooting. Key considerations include avoiding excessive jumps, proper use of master control instructions, and ensuring correct placement of control instructions within the program structure.

Uploaded by

Joseph Mbugua
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Program Control Instructions

Program Flow Control Instructions are used to control the sequence in which a program is
executed. Control instructions allow you to change the order in which the processor scans
a ladder program.
Typically, these instructions are used to
• Minimize scan time,
• Create a more efficient program, and
• Troubleshoot a ladder program.

JMP Instruction
The JMP instruction causes the controller to skip rungs. You can jump to the same label from
one or more JMP instruction.
• Jumping forward to a label saves program scan time by omitting a program segment
until needed.
• Jumping backward lets the controller execute program segments repeatedly.
• Be careful not to jump backward an excessive number of times.
• The watchdog timer could time out and fault the controller. Use a counter, timer, or the
“program scan” register to limit the amount of time you spend looping inside of
JMP/LBL instructions.

Page 1 of 5
LBL Instruction
This input instruction is the target of JMP instructions having the same label number. You must
program this instruction as the first instruction of a rung.
• This instruction has no control bits.
• You can program multiple jumps to the same label by assigning the same label number
to multiple JMP instructions. However, label numbers must be unique.
• Be careful not to jump (JMP) into an MCR zone.
• Instructions that are programmed within the MCR zone starting at the LBL instruction
and ending at the “END MCR” instruction are always evaluated as though the MCR
zone is true, regardless of the true state of the “Start MCR” instruction.

JSR, SBR, and RET Instructions


The JSR, SBR, and RET instructions are used to direct the controller to execute a separate
subroutine file within the ladder program and return to the instruction following the JSR
instruction.
• If you use the SBR instruction, the SBR instruction must be the first instruction on the
first rung in the program file that contains the subroutine.
• Use a sub-routine to store recurring sections of program logic that must be executed
from several points within your application program.
• A sub-routine saves memory because you program it only once. Update critical I/O
within sub-routines using immediate input and/or output instructions (IIM, IOM),
especially if your application calls for nested or relatively long sub-routines.
• Otherwise, the controller does not update I/O until it reaches the end of the main
program (after executing all subroutines).
• Outputs controlled within a sub-routine remain in their last state until the sub-routine is
executed again.

Master Control Reset (MCR)


Master control (MC)
This is one of the “Program flow control” instructions, but with a difference. It is used inside
a program block or segment to control the execution of a group of instructions. The “Master
control” (MC) instruction is typically used in pairs with a “Master control reset” (MCR) as
shown in the figure below.

Page 2 of 5
If the logical conditions or input before “MC” instruction goes “True,” then the group of
instructions after that will get executed by PLC. Outputs states will get modified as per the
input logic conditions.
The “MC” instruction is always used in conjunction with “MCR” (master control reset), which
resets or de-activates the active “MC” instruction for that execution cycle.
Master control reset is always called unconditionally and does not carry any reference of the
“MC” instruction. If the logical conditions or input before the “MC” instruction do not go
“True,” then the group of instructions after it will not be executed by the PLC.
All outputs that are not retentive are de-energized. Outputs that are defined as “retentive” will
remain latched as per their previous status.
Please note the following point while using “MC” instruction in blocks:
• Avoid use of timers inside the “MC and MCR” block, as some PLCs will reset them to
zero whenever the block is not processed, or deemed false. However, it needs to be said
that other makes may retain them to the current time state. Thus, it is important that this
is thoroughly checked and tested, when the code is written for an application such as
this.
• Counters typically retain their current or last counted value. Use MCR instructions in
pairs to create program zones that turn off all the non-retentive outputs in the zone.
Rungs within the MCR zone are still scanned, but the scan time is reduced due to the
false state of non-retentive outputs. Master control reset zones let you enable or inhibit
segments of your program, such as for recipe applications.
When you program MCR instructions, note that:
• You must end the zone with an unconditional MCR instruction.
• You cannot nest one MCR zone within another.
• Do not jump into an MCR zone. If the zone is false, jumping into it activates the zone.

Page 3 of 5
• Always place the MCR instruction as the last instruction in a rung.

The MCR instruction is not a substitute for a hard–wired master control relay that provides
emergency stop capability. You still must install a hard-wired master control relay to provide
emergency I/O power shutdown.
If you start instructions such as timers or counters in an MCR zone, instruction operation ceases
when the zone is disabled. Re-program critical operations outside the zone if necessary.
Do not jump (JMP) into an MCR zone. Instructions that are programmed within the MCR zone
starting at the LBL instruction and ending at the “END MCR” instruction are always evaluated
as though the MCR zone is true, regardless of the true state of the “Start MCR” instruction.
If the zone is false, jumping into it activates the zone from the LBL to the end of the zone. The
TOF timer activates when placed inside of a false MCR zone.
The MCR instruction is not a substitute for a hard-wired master control relay. We recommend
that your programmable controller system include a hard-wired master control relay and
emergency stop switches to provide I/O power shut down.
Emergency stop switches can be monitored, but should not be controlled by the ladder program.
Wire these devices as described in the installation manual.

Temporary End (TND) Instruction


This instruction, when its rung is true, stops the processor from scanning the rest of the program
file, updates the I/O, and resumes scanning at rung 0 of the main program (file 2).
If this instruction’s rung is false, the processor continues the scan until the next TND instruction
or the END statement.
• Use this instruction to progressively debug a program, or conditionally omit the balance
of your current program file or sub-routines.
• If you use this instruction inside a nested sub-routine, execution of all nested
subroutines is terminated.

Page 4 of 5
Suspend (SUS) Instruction
When this instruction is executed, it causes the processor to enter the Suspend Idle mode and
stores the Suspend ID in word 7 (S: 7) of the status file. All outputs are de-energized.
• Use this instruction to trap and identify specific conditions for program debugging and
system troubleshooting.
• When the SUS instruction is executed, the programmed ID as well as the program file
ID from which the SUS instruction executed is placed in the system status file.

Immediate Input with Mask (IIM) Instruction


This instruction allows you to update data prior to the normal input scan. When the IIM
instruction is enabled, the program scan is interrupted.
Data from a specified I/O slot is transferred through a mask to the input data file, making the
data available to instructions following the IIM instruction in the ladder program.
For the mask, a 1 in an input’s bit position passes data from the source to the destination. A 0
inhibits data from passing from the source to the destination.

Immediate Output with Mask (IOM) Instruction


This instruction allows you to update the outputs prior to the normal output scan. When the
IOM instruction is enabled, the program scan is interrupted to transfer data to a specified I/O
slot through a mask.
The program scan then resumes. For the mask, a 1 in the output bit position passes data from
the source to the destination. A 0 inhibits the data from passing from the source to the
destination.

Note: (Detailed notes with illustrations to be found in Chapter 9 of the course book.)

Page 5 of 5

You might also like