Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 257
Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ) Chapter 5
Not Equal To (NEQ)
The NEQ instruction tests whether Source A is not equal to Source B.
Operands:
Relay Ladder
· If you enter a SINT or INT tag, the value converts to a DINT value by
sign-extension.
· String data types are:
– default STRING data type.
– any new string data type that you create.
· To test the characters of a string, enter a string tag for both Source A and
Source B.
Structured Text
Use the less than and greater than signs ‘<>’ together as an operator within
an expression. This expression evaluates whether sourceA is not equal to sourceB.
See Structured Text Programming
for information on the syntax of expressions
within structured text.
Operand Type Format Description
Source A SINT
INT
DINT
REAL
string
Immediate Tag Value to test against Source B
Source B SINT
INT
DINT
REAL
string
Immediate Tag Value to test against Source A
IF sourceA <> sourceB THEN
<statements>;