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 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.

Essential Allen-Bradley MicroLogix & PLC-5 Ladder Logic Functions
PLC Basic Instructions

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.

πŸ“˜ GENERAL FUNCTION INSTRUCTIONS

AFI - (Always False Instruction)

PLC Basic Instructions
AFI




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

PLC Basic Instructions
IIN and IOT




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

PLC Basic Instructions
OTL and OUT




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 

PLC Basic Instructions
XIC / XIO / OTE




Description
✔️ 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 - (Lable)

PLC Basic Instructions
JMP and LBL




Description
✔️ 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)

PLC Basic Instructions
MCR



Description
✔️ 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)

PLC Basic Instructions
ONS



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)

PLC Basic Instructions
OSR and OSF




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)

PLC Basic Instructions
TND




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)

PLC Basic Instructions
CMP



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)

PLC Basic Instructions
DTR




Description
✔️ 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)

PLC Basic Instructions
EQU



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) & DDT - (Diagnostic Detect)

PLC Basic Instructions
FBC and DDT




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)

PLC Basic Instructions
LIM




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)

PLC Basic Instructions
MEQ




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.

πŸ’¬ We’d love your feedback!
Share your thoughts in the comments below to help improve future posts.

πŸ“© Follow Insight Control System for more educational articles on Building Automation & PLC Programming.


πŸ“Ž Related: How to Inspect Variable Frequency Drives–Daily and Periodic Maintenance Guide

πŸ“Ž Related: Boiler Types and Classifications for Industrial and Commercial Use

πŸ“Ž Related: Top 100+ Building Automation System Abbreviations and Their Meanings Part 1

πŸ“Ž Related: QElectro Tech Software: Free Electrical Diagram Tool – Full Overview & Guide

πŸ“Ž Related: Humidity and Temperature in Textiles Industries



🌐 Follow Us Online

       


Comments