Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 255
Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ) Chapter 5
Example 1: If the masked value_1 is equal to the masked value_2, set light_1. If the masked
value_1 is not equal to the masked value_2, clear light_1. This example shows
that the masked values are equal. A 0 in the mask restrains the instruction from
comparing that bit (shown by x in the example).
Relay Ladder
Structured Text
light_1 := ((value_1 AND mask_1)=(value_2 AND mask_2));
Function Block
value_10101010111111111 value_20101010111110000
mask_11111111111110000 mask_11111111111110000
masked value_1010101011111xxxx masked value_2010101011111xxxx