Compare in Advanced Ladder
See also: Limit in Advanced Ladder
See also: Project Toolbox for Advanced Ladder
Topic Menu
![]() |
Compare Functions in Cscape |
Home > View > Project Toolbox > Compare Operations
The Compare Operations act as conditions for a rung of ladder logic, like contacts but for values instead of bits. If the comparison is TRUE, then power can pass through the function and on down the ladder rung. If the comparison is FALSE, power cannot pass through. A comparison operation that has already been placed in the Ladder Logic program may be changed to a different type of comparison by right-clicking the function and selecting Change Compare Type (except Limit).
Equal 
This comparison checks the equality of two values. If Equal, power can pass through.
TRUE if IN1 = IN2
Equal Parameters
-
IN1/IN2: Variables/registers or static numbers to compare
-
Type: The data format of the values being compared. BYTE
Byte - [Data Type BYTE] - A string of 8 consecutive bits. A single BYTE is also the size of a single ASCII character., INT
Integer - [Data Type INT] - A 16-bit signed value. Integers are used where the value of the data is expected to be in the range of -32,768 to +32,767., DINT
Double Integer - [Data Type DINT] - A 32-bit signed value. Double Integers are used where the value of the data is expected to be in the range of -2,147,483,648 to +2,147,483,647., REAL
These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types., UINT
Unsigned Integer - [Data Type UINT] - A 16-bit unsigned value. Unsigned Integers are used where the value of the data is expected to be in the range of -0 (zero) to 65,535., UDINT
Unsigned Double Integer - [Data Type UDINT] - A 32-bit unsigned value. Unsigned Double Integers are used where the value of the data is expected to be in the range of 0 (zero) to 4,294,967,296., LREAL
These numbers use IEEE 754-1985 format to store numbers in following ranges. 32-bit single-precision floating point (REAL) – -3.40282E+38 to +3.40282E+38 64-bit double-precision floating point (LREAL) – -1.79769E+308 to +1.7976E+308 Floating Point refers to both REAL and LREAL data types. formats are supported. All parameters must be of the same type.
Power Flow
The Equal function will allow power to pass through if IN1 is Equal to IN2. There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Not Equal 
This comparison checks the equality of two values. If Not Equal, power can pass through.
Not Equal Parameters
-
IN1/IN2: Variables/registers or static numbers to compare
-
Type: The data format of the values being compared. BYTE, INT, DINT, REAL, UINT, UDINT, LREAL formats are supported. All parameters must be of the same type.
Power Flow
The Not Equal function will allow power to pass through if IN1 is Not Equal to IN2. There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Less Than 
This comparison checks for a value to be Less Than another value. If TRUE, power can pass through.
TRUE if IN1 < IN2
Less Than Parameters
-
IN1: Variable/register or static number to be compared
-
IN2: Variables/register or static number to compared against
-
Type: The data format of the values being compared. BYTE, INT, DINT, REAL, UINT, UDINT, LREAL formats are supported. All parameters must be of the same type.
Power Flow
The Less Than function will allow power to pass through if IN1 is Less Than IN2. There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Greater Than 
This comparison checks for a value to be Greater Than another value. If TRUE, power can pass through.
TRUE if INI1 > IN2
Greater Than Parameters
-
IN1: Variable/register or static number to be compared
-
IN2: Variables/register or static number to compared against
-
Type: The data format of the values being compared. BYTE, INT, DINT, REAL, UINT, UDINT, LREAL formats are supported. All parameters must be of the same type.
Power Flow
The Greater Than function will allow power to pass through if IN1 is Greater Than IN2.
There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Less Than or Equal To 
This comparison checks for a value to be Less Than or Equal To another value. If TRUE, power can pass through.
TRUE if IN1 ≤ IN2
Less Than or Equal To Parameters
-
IN1: Variable/register or static number to be compared
-
IN2: Variables/register or static number to compared against
-
Type: The data format of the values being compared. BYTE, INT, DINT, REAL, UINT, UDINT, LREAL formats are supported. All parameters must be of the same type.
Power Flow
-
The Less Than or Equal To function will allow power to pass through if IN1 is Less Than or Equal To IN2.
-
There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Greater Than or Equal To 
This comparison checks for a value to be Greater Than or Equal To another value. If TRUE, power can pass through.
TRUE if IN1 ≥ IN2
Greater Than or Equal To Parameters
-
IN1: Variable/register or static number to be compared
-
IN2: Variables/register or static number to compared against
-
Type: The data format of the values being compared. BYTE, INT, DINT, REAL, UINT, UDINT, LREAL formats are supported. All parameters must be of the same type.
Power Flow
The Greater Than or Equal To function will allow power to pass through if IN1 is Greater Than or Equal To IN2. There must be functions to the right of the comparison operations as they only act as a condition for power flow.
Return to the Top: Compare in Advanced Ladder