Rockwell Automation Publication 1756-RM003N-EN-P - October 2011 235
Compare Instructions (CMP, EQU, GEQ, GRT, LEQ, LES, LIM, MEQ, NEQ) Chapter 5
Function Block
FBD_COMPARE Structure
Description: The GRT instruction tests whether Source A is greater than Source B.
When you compare strings, note the following:
· The hexadecimal values of the characters determine if one string is less than
or greater than another string. For the hex code of a character, see the back
cover of this manual.
· When the two strings are sorted as in a telephone directory, the order of
the strings determines which one is greater.
Arithmetic Status Flags: Not affected
Operand Type Format Description
GRT tag FBD_COMPARE Structure GRT 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
GRT instruction.
ASCII Characters Hex Codes
1ab $31$61$62
1b $31$62
A $41
AB $41$42
B $42
a $61
ab $61$62