Data Comparison Operations

The manipulation of data using ladder diagram instructions, generally involves simple register (word) operations to compare the contents of two registers. In the ladder language, there are three basic data comparison instructions: equal to, greater than, and less than. Based on the result of a greater than, less than, or equal to comparison, an output can be turned ON or OFF, or more other operation can be performed.

Equal to =

The equal to instruction is used to compare the contents of two referenced registers for an equal condition, when the rung conditions are true. As in the arithmetic instructions, the values to be compared can be accessed directly or through a GET instruction depending on the controller. If the operation is true, the output coil is energized.

Less Than <

The less instruction compares the contents of the value of one register to the value stored in second register. If the test condition is true (i.e less than), the output coil is energized.

Greater Than >

Greater than instruction operates the same way as the less than instruction, except it test for greater than condition. Some controllers do not have this function, because a greater than" function can perform using the "less than" logic by reversing the order of the data and the "less than" function in the logic rung.