Inst ToolsInst ToolsInst Tools
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Search
  • Books
  • Software
  • Projects
  • Process
  • Tools
  • Basics
  • Formula
  • Power Plant
  • Root Cause Analysis
  • Electrical Basics
  • Animation
  • Standards
  • 4-20 mA Course
  • Siemens PLC Course
Reading: Siemens PLC Comparator Logic
Share
Notification Show More
Font ResizerAa
Inst ToolsInst Tools
Font ResizerAa
  • Courses
  • Design
  • PLC
  • Interview
  • Control System
Search
  • Courses
  • Automation
    • PLC
    • Control System
    • Safety System
    • Communication
    • Fire & Gas System
  • Instrumentation
    • Design
    • Pressure
    • Temperature
    • Flow
    • Level
    • Vibration
    • Analyzer
    • Control Valve
    • Switch
    • Calibration
    • Erection & Commissioning
  • Interview
    • Instrumentation
    • Electrical
    • Electronics
    • Practical
  • Q&A
    • Instrumentation
    • Control System
    • Electrical
    • Electronics
    • Analog Electronics
    • Digital Electronics
    • Power Electronics
    • Microprocessor
  • Request
Follow US
All rights reserved. Reproduction in whole or in part without written permission is prohibited.
Inst Tools > Blog > PLC Tutorials > Siemens PLC Comparator Logic

Siemens PLC Comparator Logic

Implement Siemens PLC Comparator logic like equal, not equal, greater or equal, less or equal, greater than in S7-1200 PLC using ladder diagram language.

Last updated: November 3, 2023 2:52 pm
Editorial Staff
PLC Tutorials
1 Comment
Share
4 Min Read
SHARE

This article shows the different types of Siemens PLC Comparator Logics and their ladder diagrams.

Contents
Siemens PLC Comparator LogicProblem DiagramProblem SolutionList of Inputs and OutputsLadder diagram for comparators used in S7-1200 PLCProgram DescriptionTest Cases

Siemens PLC Comparator Logic

Problem Description

Implement equal, not equal, greater or equal, less or equal, greater than, check validity, and check invalidity comparators in Siemens S7-1200 PLC using ladder diagram language.

Problem Diagram

Comparator used in Siemens S7-1200 PLC.

Problem Solution

Comparators are used for comparing two values. Say, If we want to compare two physical quantities (temperature, pressure etc.).

We can use the equal instruction to determine, if a first comparison value is equal to a second comparison value or not.

We can use the not equal instruction to determine, if a first comparison value is not equal to a second comparison value or not.

We can use the greater or equal instruction to determine, if a first comparison value is greater than or equal to a second comparison value or not. Both values to be compared must be of the same data type.

We can use the less or equal instruction to determine, if a first comparison value is less than or equal to a second comparison value or not. Both values to be compared must be of the same data type.

We can use the greater than instruction to determine, if a first comparison value is greater than a second comparison value or not. Both values to be compared must be of the same data type.

We can use the less than instruction to determine, if a first comparison value is less than a second comparison value or not. Both values to be compared must be of the same data type.

List of Inputs and Outputs

Output List

  • Result 1 = Q0.0
  • Result 2 = Q0.1
  • Result 3 = Q0.2
  • Result 4 = Q0.3
  • Result 5 = Q0.4
  • Result 6 = Q0.5

Memory

  • MW0 :- Comparator 1
  • MW2 :- Comparator 2
  • MW4 :- Comparator 3
  • MW6 :- Comparator 4
  • MW8 :- Comparator 5
  • MW10 :- Comparator 6

Ladder diagram for comparators used in S7-1200 PLC

Siemens PLC Comparators Logic

Program Description

In this program, we have used Siemens S7-1200 PLC and TIA Portal Software for programming.

Network 1:

If value in MW0 is equal to 2, result 1 (Q0.0) will be ON.

Network 2:

If value in MW2 is not equal to 2, result 1 (Q0.1) will be ON.

Network 3:

If value in MW4 is greater or equal than 2, result 3 will be ON.

Network 4:

If value in MW6 is less or equal than 2, result 4 will be ON

Network 5:

If value in MW8 is greater than 2, result 5 will be ON.

Network 6:

If value in MW10 is less than 2, result 6 will be ON

Test Cases

Siemens Comparators

Author: Bhavesh

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:

  • Separate Different Size Objects using PLC
  • PLC Tank Heating Control using Heater
  • Implement 1 to 8 Demultiplexer using PLC
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 !

Continue Reading

Why Use Normally-Closed Contact for Stop Buttons?
PLC Math instructions
PLC Ladder Logic for Sensor Scaling with Offset
PLC Program to Separate Different Size Objects
Demo of a SCADA Software – Level Control System
Automatic Car Washing using PLC
Share This Article
Facebook Whatsapp Whatsapp LinkedIn Copy Link
Share
1 Comment
  • Miss mysterious says:
    June 8, 2021 at 12:31 pm

    If we want to control this logic continuously without assistance,what should we do?

    Reply

Leave a Reply Cancel reply

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

Stay Connected

128.3kFollowersLike
69.1kFollowersFollow
210kSubscribersSubscribe
38kFollowersFollow

Categories

Explore More

STAR-DELTA Auto And Manual Program using XG5000 Software
What is a GSD File and Why it is required?
Learn about PLC, DCS, RTU, SCADA, and PAC
PLC Digital Input and Digital Output Modules
PLC Program for Mixing Tank
Function of Racks in PLC – Types of SIEMENS S7-400 PLC Racks
Comparison of Control Loops – Open, Closed, Cascade, Feedforward, Ratio
Simulation of Studio 5000 and FactoryTalk View Studio

Keep Learning

PLC Handbook

PLC Handbook

relay-safety-in-plc

How to Reduce Relay Noise in PLC Systems?

Reading Clock data in PLC

Real-Time Clock in Omron PLC? – CX Programmer

Controlling of Tank Level Using Proportional Controller in PLC

Controlling of Tank Level Using Proportional Controller in PLC

PLC Program for Automatic Parameter initialization

PLC Program for Automatic Parameter Initialization When Power UP

Establish Communication Between Two PLC Via PROFIBUS Protocol

Establish Communication Between Two PLC Via PROFIBUS Protocol

CODESYS open source PLC software

What is CODESYS? Why Do You Need to Learn it?

PLC Examples for calling functions in SCL

How to Insert Block Calls in SCL Language?

Learn More

Interview Questions on Transformers

Interview Questions on Transformers

Electrical Machines Objective Questions

Electrical Machines MCQ Series 5

Common Valve Abbreviations

Common Valve Abbreviations in US Engineering Drawings

Control Valves Multiple Choice Questions

Control Valves Multiple Choice Questions

Difference Between Permittivity and Permeability

Difference Between Permittivity and Permeability

Field Transmitter Damping

What is Field Transmitter Damping ?

What is Oscilloscope

What is Cathode Ray oscilloscope ?

annunciator-alarm-simulator

Alarm Simulator for Annunciator Logic

Menu

  • About
  • Privacy Policy
  • Copyright

Quick Links

  • Learn PLC
  • Helping Hand
  • Part Time Job

YouTube Subscribe

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?