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

#18 PLC Best Practices – Store PLC Hard Stop Events from Faults
Troubleshooting PLC Permissive Inputs
Set the S5 Timer Value by a Memory Word
Can a PLC Function Without an HMI or SCADA?
Top 100 PLC Projects List
Start Stop of one Motor from the same Push button PLC program
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

Free Industrial Control System (ICS) Cyber Security Training Course
How to implement SR Flip Flop using PLC Ladder Logic
PLC Program to Count Running Hours of any Equipment
Examples of PLC Programming using Boolean Functions
PLC Ladder Logic Questions and Answers
PLC Logic for Automatic Bending Machine for Exhaust Pipe
Automatic Sanitizer – Complex Ladder Logic PLC Examples
Hardware Troubleshooting Steps for PLC Automation Systems

Keep Learning

PLC Ladder Diagram program

Contacts and Coils in PLC Ladder Logic

PLC Program for Star Delta Starter using Functional Block Diagram

PLC Program for Star Delta Starter using Functional Block Diagram

Why 24 Volts DC Power Supply

Why 24 Volts DC Power Supply is used? – Industrial Automation Systems

Allen-Bradley SLC 500

History of Programmable Logic Controllers (PLC)

PLC Instruction List Code

PLC Instruction List Program for Basic Instructions

Create Ladder Diagram from Boolean Logic

Create Ladder Diagram from Boolean Logic

Parking Lights PLC Program Explained with Video

Parking Lights PLC Program Explained with Video

Extended Timer Logic in PLC

Extended Timer Logic in PLC

Learn More

OPC classic introduction

Overview of OPC Communication

Process Control Instrumentation Objective Questions

Process Control & Instrumentation Objective Questions – Set 7

Importance of Fire & Gas Detection System

Importance of Fire & Gas Detection System

SCADA RTU TELEMETRY

SCADA & Telemetry Systems

Thermowell Problems

Thermowell Problems

Total Organic Carbon Analyzer Working Principle

TOC Analyzer Working Principle

Alarm Management System

What is Alarm Management System ?

Best Instrumentation Engineering Books to Purchase

Best Instrumentation Engineering Books to Purchase

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?