Greater Than (GT)

When enabled, the GT instruction and the operator greaterthansymbol tests whether Source A is greater than Source B.
Available Languages
Ladder Diagram
GT ladder instruction
Operands
There are data conversion rules for mixing numeric data types within an instruction. See Data conversions.
Ladder Diagram
Numeric Comparison
Operand
Data Type
Format
Description
Source A
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
immediate
tag
Value to test against Source B
Source B
SINT
INT
DINT
LINT
USINT
UINT
UDINT
ULINT
REAL
LREAL
immediate
tag
Value to test against Source A
String Comparison
Operand
Data Type
Format
Description
Source A
String type
immediate literal value
tag
String to test against Source B
Source B
String type
immediate literal value
tag
String to test against Source A
Affects Math Status Flags
No
Major/Minor Faults
See
GT String Compare Flow Chart
for faults.
See
Index through arrays for array-indexing faults.
Execution
Ladder Diagram
Condition/State
Action Taken
Prescan
N/A
Rung-condition-in is false
Set Rung-condition-out to Rung-condition-in
Rung-condition-in is true
Numeric compare:
If Source A and Source B are not NANs and Source A is greater than Source B.
Set Rung-condition-out to true
else
Clear Rung-condition-out to false.
String compare:
See
GT String Compare Flow Chart.
If output is false
Clear Rung-condition-out to false
else
Set Rung-condition-out to true
Postscan
N/A
GT String Compare Flow Chart
GRT String Compare Flow Chart
Example
Ladder Diagram
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.