Siemens Comparison Instructions

Published on Jun25, 2021 | Category: instructions
Share this article:

Comparison Instructions perform comparison between two input value and if the condition is true set the output 1 otherwise output set to false. Comparison Instructions perform comparison between two input value of same data type. if the comparison result true than output set to 1 otherwise output set to 0 or false. output is depends on type of comparison blocks. both input are same data type if first input is integer so you can not choose second input double or real data type. Comparison blocks are normal contact type it can be placed anywhere of the program. classification of comparison blocks is depend on data types.

Compare Integer Instructions : both inputs are integer

integer comparison block compare between two input integer value and set 1 if comparison result is true otherwise output set to 0. inputs are same data type. following are parameter required for integer comparison blocks:

compare integer : equal

if both inputs equal to each other than output set to 1 otherwise output set to 0.

img/compare/compintequl.webp

compare integer : not equal

output of not equal comparison block is 1, if both inputs in1 and IN2 are not equal to each other,output set to 0.

img/compare/compareintegernotequl.webp

compare integer : greater than

output is set to 1 when the value of first inputs (IN1) is greater than second input IN2. MW0 first input and MW4 is second input values. If IN1 > IN2 than output set to 1.

img/compare/compareintegergreater.webp

compare integer : less than

output is set to 1 when the value of first inputs (IN1) is less than second input IN2. MW0 first input and MW4 is second input values. If IN1 < IN2 than output set to 1.

img/compare/compareintegerless.webp

compare integer : greater than or equal to

output is set to 1 when the value of first inputs (IN1) is greater than or equal to second input IN2. MW0 first input and MW4 is second input values. If IN1 ≥ IN2 than output set to 1.

img/compare/compareintegergretequl.webp

compare integer : less than or equal to

output is set to 1 when the value of first inputs (IN1) is less than or equal to second input IN2. MW0 first input and MW4 is second input values. If IN1 ≤ IN2 than output set to 1.

img/compare/compareintegerlessandeual.webp