Back to tutorials
PLC Instructions

PLC Programming Comparison Instructions – EQU | Equal

Vladimir Romanov
Table of Contents


The EQU, also known as the Equal, instruction is used to compare two values. The EQU instruction is an input instruction which will return TRUE if the two values within “Source A” and “Source B” fields are equal to each other. If that condition is met, the instruction will allow what’s on the right of it to execute. The EQU will compare the two values and only evaluate to true is the two integers are equal. Should they become unequal, the instruction will update on the next PLC scan.

The EQU instruction is critical within the Automation world as it’s the only way to see if the values are completely identical. It’s commonly used to check if a certain limit has been met, if a counter reached a certain value or if a certain alarm has been triggered.

The instruction is very versatile as you can use integers, floats and even user-defined tags in certain programming environments as operands. Furthermore, you may choose to use to enter a fixed value instead of an operand tied to a tag. That being said, this isn’t the recommended practice as you’ll need to edit the program and commit the edit if you want to change the said value.

Example & Usage of EQU

Here’s a real-world scenario of an EQU instruction:

  1. A Micrologix 1100 Allen Bradley PLC is used to control a process.
  2. An EQU instruction is used to compare an Integer N7:1 to a constant.
  3. The Integer N7:1 is currently set to “0” while the constant is set to “7”.
  4. This EQU instruction evaluates to FALSE.
  5. An EQU instruction is used to compare an Integer N7:2 to the Integer N7:3.
  6. The Integer N7:2 is currently set to “0” while the Integer N7:3 is set to “0”.
  7. This EQU instruction evaluates to TRUE.
  8. An EQU instruction is used to compare a Counter “Accum” Value C5:0.ACC to the Integer N7:4.
  9. The Integer N7:4 is currently set to “0” while the Counter “Accum” Value C5:0.ACC is set to “0”.
  10. This EQU instruction evaluates to TRUE.

Programming example in RSLogix 500:

EQU Equal Instruction RSLogix 5000


We’re using three different EQU instructions to demonstrate the capabilities of the instruction. The first instruction will evaluate to FALSE because the two values stored within the “Source A” and “Source B” elements are not equal to each other. One is “0” while the other is “7”. The second EQU instruction will evaluate to TRUE due to the fact that N7:2 and N7:3 values are identical; both are equal to “0”. The last instruction will also evaluate to TRUE. It demonstrates the fact that you can use the value of a Timer Construct to compare it to a value of a similar type. In this case, both are integers. Since they are both “0”, the EQU evaluates to TRUE in this case.

Data Types Allowed for EQU

The EQU can be used to compare two values of identical types. These value can be INTs, DINTs, or FLOATs.

  • Integer – You may specify each operand to be of “Integer” type.
  • Float – You may specify each operand to be of “Float” or “Real” type.

Important Notes

  • Note 1 – Both operands need to be exactly the same while the rung containing the EQU instruction is being scanned. Otherwise, the instruction will evaluate to FALSE. In an instance where the value is changed in other locations for only a brief duration, the EQU comparison may result in unforeseen outcomes.
  • Note 2 – When working with constants, RSLogix 500 will not allow the user to use the constant in the “Operand A” field. The constant must be specified within “Operand B”. This limitation is not present in all software packages.
  • Note 3 – The user may not specify a comparison of two constants within RSLogix 500. In other words, you may not use the EQU instruction with “Operand A” set to 7 and “Operand B” set to 20. This case will always evaluate to FALSE which should not be used.

Video Tutorial

Back to tutorials

Related Tutorials


PowerFlex 525 Parameter, Input and Output Programming Tutorial in RSLogix Studio 5000

The PowerFlex 525 series of Variable Frequency Drives from Allen Bradley is highly utilized and respected within the automation field. The drives are compact, versatile and easy to use. We’ve written an extensive tutorial on how to get started with these drives in a previous tutorial; it covers how to initialize the drive, connect it to an EtherNet/IP based PLC and how to set the right parameters. In this tutorial, we’re looking to expand on the concepts and demonstrate a way to access and utilize the multiple Input and Output options available on the drive. The reason you may want to utilize the IO is to save money on purchasing external components, integrate instrumentation into your drive and save floor space, wiring and cost. We’ve seen the need to integrate closely related sensors into a PowerFlex 525 application; this would be the right way to do it.

Vladimir Romanov

Publishing MQTT Data Using Opto 22 groov EPIC PAC

MQTT is a communication protocol that has taken off in the IIoT community. It’s a light-weight, efficient protocol that works through a publisher / broker / subscriber model. It creates an easy way for field devices to communicate and retrieve data from a single location. In this article, we’ll go over MQTT and dive into an example of how you can publish data using a groov EPIC PAC and retrieve the data using a MQTT client.

Vladimir Romanov

HMI Design - Best Practices for Effective HMI Screens

HMI Design is the practice of building HMI screens that are intuitive to the end user, pleasing to the eye and are efficient to operate. As control systems within manufacturing are migrated from traditional push button designs to primarily operated from HMI displays, HMI Design has become trivial to any new installation.Although there is a wide range of HMI based systems, the basic principles of good design remain the same. Different industries may dictate different patterns of layout for their systems, but the good practices remain.

Vladimir Romanov