PLC Basic Instructions Explained | Essential Allen-Bradley MicroLogix & PLC-5 Ladder Logic Functions
Understanding the Core PLC Instructions in Industrial Automation.
Welcome to Insight Control System Technical Blog Page📖
Introduction
Programmable Logic Controllers (PLCs) play a crucial role in modern automation systems, especially within industrial and HVAC control applications. Whether you’re an automation engineer, technician, or student, mastering the basic ladder logic instructions is essential for programming, debugging, and optimizing PLC performance.
- In this post, we’ll explore the fundamental PLC instructions used in Allen-Bradley MicroLogix and PLC-5 systems, including program control, comparison, and logic execution commands.
- Programmable Logic Controllers (PLCs) are widely used in industrial automation systems to control machines, manufacturing processes, and building automation equipment. PLC programs are typically written using ladder logic, a graphical programming language that resembles electrical relay circuits.
- Basic PLC instructions such as contacts, coils, timers, counters, and comparison functions form the foundation of ladder logic programming. Understanding these instructions is essential for designing reliable automation systems.
What is Ladder Logic?
- Ladder logic is a graphical PLC programming language that represents electrical relay logic using symbols such as contacts and coils.Common ladder logic elements include: Examine If Closed (Normally Open contact), Examine If Open (Normally Closed contact), Output Energize and more..
- These instructions control outputs such as motors, relays, and solenoid valves in industrial systems.
GENERAL FUNCTION INSTRUCTIONS
AFI - (Always False Instruction)
Description:- Putting this instruction in a line will force the line to be false.
- This is primarily designed for debugging programs.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
IIN - Immediate Input & IOT - Immediate Output
Description:- These functions update a few inputs and output during a program scan, instead of the beginning and end.
- In This Example the IIN function will update the input values on 'I:001' if 'A' is true.
- If 'B' is true then the output values will be updated for 'O:002".
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
OTL - Output Latch & OUT - Output Unlatch
Description:- The OTL 'L' will latch on an output or memory bit, and the 'OTL' 'U' will unlatch it.
- If a value has been changed with a latch its value will stay fixed even if the PLC has been Restarted.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
XIC - Examine if Closed / XIO - Examine if Open / OTE - Output Enable
| XIC / XIO / OTE |
- These are the three most basic and common instructions.
- The input 'A' is a normally open contact (XIC), the input 'B' is a normally closed contact (XIO).
- Both of the outputs are normally off (OTE)
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
PROGRAM CONTROL INSTRUCTIONS
JMP - (Jump) & LBL - (Label)
- The JMP instruction will allow the PLC to bypass some ladder logic instructions.
- When 'A' is true in this example the JMP will go to label '2', after which the program scan will continue normally.
- If 'A' is false the JMP will be ignored and program execution will continue normally.
- In either case, 'X' will be equal to 'B'.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
MCR - (Master control Relay)
- MCR instructions need to be used in pairs.
- If the first MCR line is true the instructions up to the next MCR will be examined normally.
- If the first MCR line is not true the outputs on the lines after will be FORCED OFF.
- Be careful when using normal outputs is these blocks.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
ONS - (One Shot)
Description:- This instruction will allow a line to be true for only one scan.
- If 'A' becomes true then output of the 'ONS' instruction will true on for only one scan.
- 'A' must be turned off for one scan before the 'ONS' can be triggered again.
- The bit is used to track the previous input state, it is similar to an enabled bit.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
OSR - (One Shot Rising) & OSF - (One Shot Falling)
Description:- This instruction will convert a single positive edge and convert it to a bit that is on for only one scan.
- When 'A' goes from false to true a positive (or rising ) edge occurs, and bit 'O:001/2' will be on for one scan.
- Bit 'B3:4/5' is used to track the state of the input to the function, and it can be considered equivalent to an enable bit.
- The OSF function is similar to the OSR function, except it is triggered on a negative edge where the input falls from true to false.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
TND - (Temporary End)
Description:- When 'A' is true this statement will cause the PLC to stop examining the ladder logic program, as if it has encountered the normal end-of-program statement.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
COMPARISON & DATA FUNCTIONS
CMP - (Compare)
Description:- This function use a free form expression to compare the Two values.
- The Comparison values that are allowed include = , > , >= , <> , < , <=
- The expression must not be more than 80 characters long.
Status Bits: None
Registers: None
Available on: This function is available on: PLC-5
DTR - (Data Transition)
- This Function will examine the source value and mask out bits using the mask.
- The value will be compared to the Reference value, and if the values agree, then the function will be true for one scan, after that it will be false.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
EQU - (Equal)
Description:- The basic compare has six variations.
- Each of these will look at the values in source A and B and check for the comparison case.
If the comparison case is true, the output will be true, The types are,
- EQU - Equals,
- GWQ - Greater than or equal,
- GRT- Greater than,
- LEQ - Less than or equals,
- LES - Less than,
- NEQ - Not equal,
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
FBC - (File Bit Compare) and DDT - (Diagnostic Detect)
Description:- This instruction will compare the bits in two files and store the positions of differences in a file.
- In this example the files compared when 'A' goes ture.
- Both file start at "B3:0' and 'B9:0' and 10 bits are to be compared.
- When differences are found the bit numbers will be stored in a list starting at 'N10:0' the list can have up to three values (integer words).
- The 'cmp control' word is for the list of differences.
- The 'Result Control' word is for the list of differences.
- The manual recommends clearing 'S:24' before running this instruction to avoid a possible processor fault.
- The DDT instruction is the same as the FBC instruction ,except that when a different bit is found the source bit overwrites the reference bit.
- It is useful for storing a reference pattern for later use by a FBC.
Status Bits:
- EN (Cmp): Enable - enable when the instruction input is active.
- DN (Cmp): Done - enable when the operation is complete.
- ER (Cmp): error - set if an error occurred during the operation.
- IN (Cmp): Inhibit - set when mismatch found , must be cleared to continue the comparison.
- FD (Cmp): Found - set when a mismatch is found.
- DN (Result): Done - set when the result list is full.
- ER (Result): Error - set if an error occurred with the results list.
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
LIM - (LIMIT)
Description:- This function will check to see if a value is between two limits.
- If the high limit is larger than the low limit and the test value is >= low limit (or) <= high limit, then the output is ture.
- If the low limit is higher than the high limit , then a value not between the low and high limits will be true.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
MEQ - (Masked Equal)
Description:- The Source and Mask values are AND together.
- This will screen out bits not on in the mask.
- The value is then compared to the 'Compare' value.
- If the values are equal, the output is true.
Status Bits: None
Registers: None
Available on: This function is available on: MicroLogix , PLC-5
Conclusion:
In this first part of our PLC Instruction Series, we’ve discussed the core logic, program control, and comparison functions available in Allen-Bradley MicroLogix and PLC-5 controllers.
Understanding these foundational commands such as AFI, JMP, MCR, ONS, CMP, FBC, and MEQ is essential for designing reliable and efficient automation programs.
Stay tuned for Part 2, where we’ll explore advanced PLC functions, timers, counters, and data handling instructions to deepen your PLC programming knowledge.
FAQ (Frequently Asked Questions)
1. What are PLC basic instructions?
PLC basic instructions are fundamental ladder logic commands such as contacts, coils, timers, and counters used to control industrial automation systems.
2. What is XIC in PLC?
XIC stands for Examine If Closed, which represents a normally open contact in ladder logic.
3. What is OTE in PLC?
OTE (Output Energize) activates an output device such as a motor, relay, or lamp.
About the Author – Insight Control System
Insight Control System provides technical education and practical guidance in the fields of Building Automation Systems (BAS), HVAC controls, PLC programming, sensors, and industrial automation. The content published on this platform is based on field experience, technical documentation analysis, and real-world system applications.
Our objective is to simplify complex automation concepts for engineers, technicians, students, and industry professionals worldwide.
Every article is carefully structured to deliver accurate technical knowledge, practical insights, and industry-relevant information aligned with modern automation standards.
We continuously update our content to reflect current technologies, control strategies, and best engineering practices.
⚠️If you notice any technical discrepancy or would like to contribute industry insights, please contact us via our Contact page.
Recommended Technical Guides:
- How Programmable Logic Controller Works
- Installation of PLC Control Panel
- VFD Fault Diagnosis and Troubleshooting
- Industrial and Building Automation Systems
- Belimo Company Technical Overview HVAC Automation Solutions Explained

Comments
Post a Comment