258 Rockwell Automation Publication 1756-RM003N-EN-P - October 2011
Chapter 5 Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ)
Function Block
FBD_COMPARE Structure
Description: The NEQ instruction tests whether Source A is not equal to Source B.
When you compare strings:
· strings are not equal if any of their characters do not match.
· ASCII characters are case sensitive. Upper case ‘A’ ($41) is not equal to
lower case ‘a’ ($61).
Arithmetic Status Flags: Not affected
Fault Conditions: None
Operand Type Format Description
NEQ tag FBD_COMPARE Structure NEQ structure
Input Parameter Data Type Description
EnableIn BOOL Enable input. If cleared, the instruction does not execute and outputs are not updated.
Default is set.
SourceA REAL Value to test against SourceB.
Valid = any float
SourceB REAL Value to test against SourceA.
Valid = any float
Output Parameter Data Type Description
EnableOut BOOL The instruction produced a valid result.
Dest BOOL Result of the instruction. This is equivalent to rung-condition-out for the relay ladder
NEQ instruction.
ASCII Characters Hex Codes
1ab $31$61$62
1b $31$62
A $41
AB $41$42
B $42
a $61
ab $61$62