Inst ToolsInst ToolsInst Tools
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
      • Instrumentation
      • Electronics
      • Electrical
      • Practical Questions
    • MCQ
      • Instrumentation MCQ
      • Electrical MCQ
      • Electronics MCQ
      • Control Systems MCQ
      • Analog Electronics MCQ
      • Digital Electronics MCQ
      • Power Electronics MCQ
      • Microprocessor MCQ
      • Multiple Choice Questions
  • EE
    • Electronics
      • Electronics Q & A
      • Electronic Basics
      • Electronic Devices & Circuits
      • Electronics Animation
      • Digital Electronics
    • Electrical
      • Electrical Basics
      • Electrical Q & A
      • Power Electronics
      • Electrical Machines
      • Electrical Animation
      • Power Systems
      • Switchgear & Protection
      • Transmission & Distribution
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Search
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Reading: Comparison Instructions in PLC Programming
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • PLC Tutorials
  • Control Systems
Search
  • Ask
  • Courses
  • Videos
  • Q & A
    • Interview
    • MCQ
  • EE
    • Electronics
    • Electrical
  • Measure
    • Control Valves
    • Calibration
    • Temperature
    • Pressure
    • Flow
    • Level
    • Analyzers
    • Switches
    • Vibration
    • Solenoid Valve
  • Control
    • PLC Tutorials
    • Control Systems
    • Safety Instrumented System (SIS)
    • Communication
    • Fire & Gas System
  • More
    • Design
    • Tools
    • Animation
    • Basics
    • Formulas
    • Standards
    • TextBooks
    • Common
    • Software
    • Excel Tools
    • Erection & Commissioning
    • Process Fundamentals
    • Videos
    • Books
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Comparison Instructions in PLC Programming

Comparison Instructions in PLC Programming

Last updated: March 4, 2021 3:11 pm
Editorial Staff
PLC Tutorials
2 Comments
Share
6 Min Read
SHARE

Comparison instructions in PLC are used to test pairs of values to condition the logical continuity of a rung.

Contents
Types of Comparison InstructionsEqual (EQU) InstructionNot Equal (NEQ) InstructionLess Than (LES) InstructionLess Than or Equal (LEQ) InstructionGreater Than (GRT) InstructionGreater Than Or Equal (GEQ) InstructionMasked Comparison for Equal (MEQ)Limit Test (LIM) InstructionTrue/False Status of the LIM Instruction

Thus, comparison instructions would seldom, if ever, be the last instruction on a rung.

Types of Comparison Instructions

Types of Comparison Instructions in PLC

As an example, suppose a LES instruction is presented with two values. If the first value is less than the second, then the comparison instruction is true.

Equal (EQU) Instruction

Equal (EQU) Instruction in PLC Programming

Use the EQU instruction to test whether two values are equal. If source A and source B are equal, the instruction is logically true. If these values are not equal, the instruction is logically false.

Source A must be an address.

Source B can be either a program constant or an address.

Values are stored in two’s complementary form.

Not Equal (NEQ) Instruction

Not Equal (NEQ) Instruction in PLC Programming

Use the NEQ instruction to test whether two values are not equal.

If source A and source B are not equal, the instruction is logically true.

Source A must be an address.

Source B can be either a program constant or an address.

Values are stored in two’s complementary form.

Less Than (LES) Instruction

Less Than (LES) Instruction in PLC Programming

Use the LES instruction to test whether one value (source A) is less than another (source B).

If source A is less than the value at source B, the instruction is logically true.

Source A must be an address.

Source B can be either a program constant or an address.

Values are stored in two’s complementary form.

Less Than or Equal (LEQ) Instruction

Less Than or Equal (LEQ) Instruction in PLC Programming

Use the LEQ instruction to test whether one value (source A) is less than or equal to another (source B).

If the value at source A is less than or equal to the value at source B, the instruction is logically true.

Source A must be an address.

Source B can be either a program constant or an address.

Values are stored in two’s complementary form.

Greater Than (GRT) Instruction

Greater Than (GRT) Instruction in PLC Programming

Use the GRT instruction to test whether one value (source A) is greater than another (source B).

If the value at source A is greater than the value at source B, the instruction is logically true.

Greater Than Or Equal (GEQ) Instruction

Greater Than Or Equal (GEQ) Instruction in PLC Programming

Use the GEQ instruction to test whether one value (source A) is greater than or equal to another (source B).

If the value at source A is greater than or equal to the value at source B, the instruction is logically true.

Masked Comparison for Equal (MEQ)

Masked Comparison for Equal (MEQ) Instruction in PLC Programming

Use the MEQ instruction to compare data at a source address with data at a compare address.

The Use of this instruction allows portions of the data to be masked by a separate word.

Source is the address of the value you want to compare.

Mask is the address of the mask through which the instruction moves data.

The mask can be a hexadecimal value.

Compare is an integer value or the address of the reference.

If the 16 bits of data at the source address are equal to the 16 bits of data at the compare address (less masked bits), the instruction is true.

The instruction becomes false as soon as it detects a mismatch.

Limit Test (LIM) Instruction

Limit Test (LIM) Instruction in PLC Programming

Use the LIM instruction to test for values within or outside a specified range, depending on how you set the limits.

The Low Limit, Test, and High Limit values can be word addresses or constants, restricted to the following combinations:

  • If the Test parameter is a program constant, both the Low Limit and High Limit parameters must be word addresses.
  • If the Test parameter is a word address, the Low Limit and High Limit parameters can be either a program constant or a word address.

True/False Status of the LIM Instruction

If the Low Limit has a value equal to or less than the High Limit, the instruction is true when the Test value is between the limits or is equal to either limit.

Status of the LIM Instruction

If the Low Limit has a value greater than the High Limit, the instruction is false when the Test value is between the limits.

Limit Test (LIM) Status

If you liked this article, then please subscribe to our YouTube Channel for PLC and SCADA video tutorials.

You can also follow us on Facebook and Twitter to receive daily updates.

Read Next:

JUMP Instruction in PLC Programs

Master Control Reset (MCR) in PLC

One Shot Rising & Falling Instructions

Sequence and Logic Control in PLC

Scaling with Parameters Instruction

Don't Miss Our Updates
Be the first to get exclusive content straight to your email.
We promise not to spam you. You can unsubscribe at any time.
Invalid email address
You've successfully subscribed !
Ladder Logic for Flow Meter Totalizer
PLC Project Examples for EcoStruxure Machine Expert
Concept of Interlocking in PLC
Motor Classic Control Circuits using Single Push button
What is a Data Block? Global Data Blocks in PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
2 Comments
  • Romel Roy says:
    September 4, 2019 at 8:14 pm

    Dear Sir
    This is the fantastic Documents for Study & Learning you have given.
    Indeed there are lots of lessons to learn.
    Kindly, keep on teaching us so that we can upgrade the human civilization.
    With Regards

    Reply
  • Florencio says:
    September 17, 2019 at 3:28 am

    The logical instructional tools will help us greatly in developing our skills between PLC and SCADA …

    keep providing these tools

    graciously

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
208kSubscribersSubscribe
38kFollowersFollow

Categories

Recent Comments

  • Kamli on Top Free PLC Software
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • Guifty Shimica on Top Non-PLC Certification Courses for Automation Professionals
  • MIHARITSOA Aina Sitraka on Top Non-PLC Certification Courses for Automation Professionals

Related Articles

Simatic Hardware Configuration

Configuration of Profibus Network in Siemens PLC

PLC based drilling machine

Drilling Process using PLC Program

Tags in Functional Block Diagram in Studio 5000

Sheets, Tags, Elements in Functional Block Diagram of Studio 5000

Single-acting Pneumatic Cylinder operation with Limit Switch

Single-acting Pneumatic Cylinder Operation with Limit Switch

Automation Engineer Troubleshooting Tips

Best Way to Build Troubleshooting Mindset for Automation Engineer

Omron PLC programs

Daily Alarm PLC Program using Real-Time Clock

PLC Programming for Pumping and Draining System

PLC Programming for Pumping and Draining System

Simatic Prosave HMI

How to Backup and Restore from Simatic Prosave HMI?

More Articles

Plug Valve Parts

What is Plug Valve ?

Coriolis Mass Flow meter as a Multi Variable Transmitter - 1

Coriolis Mass Flow Meter as a Multi-Variable Transmitter

Serial Communication Error Checking Methods and Algorithms

Serial Communication Error Checking Methods and Algorithms

HVAC Chiller

HVAC Valves

Flanged pipe fittings

What is Flanged Pipe Fittings ?

Gas Detectors Practical Problems and Troubleshooting

Gas Detectors Practical Problems and Troubleshooting

Transistor Output Wiring

PLC Output Types

Control Systems Stability and Algebraic Criteria

Routh-Hurwitz Stability Criterion

Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?