GT (Greater Than)
Returns TRUE when first input is strictly greater than second input.
The GT (Greater Than) comparison function evaluates whether the first input is strictly greater than the second input and returns TRUE if so. It works with all numeric and comparable data types including INT, REAL, DINT, and TIME. GT is fundamental to conditional logic in PLC programs, used for high-limit alarms, threshold detection, and process control decisions.
Parameters
Inputs
| Name | Type | Description |
|---|---|---|
| IN1 | ANY_NUM | First value (left operand) |
| IN2 | ANY_NUM | Second value (right operand) |
Outputs
| Name | Type | Description |
|---|---|---|
| OUT | BOOL | TRUE when IN1 > IN2 |
Ladder Logic Example
// Ladder Logic - GT Comparison (High Temperature Alarm) // // |----[GT]---( High_Temp_Alarm )----| // | IN1: Temperature_PV | // | IN2: 85.0 (High Limit) |
Structured Text Example
IF Temperature_PV > 85.0 THEN
High_Temp_Alarm := TRUE;
ELSE
High_Temp_Alarm := FALSE;
END_IF;20 Production-Ready Ladder Logic Templates
Stop writing the same rungs from scratch. Get copy-paste-ready templates for motor control, PID loops, safety interlocks, conveyors, and more.
Platform-Specific Implementation
Siemens (TIA Portal)
Use CMP > instruction or GT in TIA Portal. Works in LAD, FBD, and SCL.
Allen-Bradley (Studio 5000)
Use GRT (Greater Than) instruction in Studio 5000. Works with all numeric types.
CODESYS
Use > operator in ST or GT function block in FBD/LD.
Common Applications
- High-limit alarm detection
- Threshold-based control
- Level monitoring (tank overflow)
- Speed overshoot detection
- Pressure relief activation
Common Mistakes to Avoid
- Comparing REAL values for exact equality instead of using GT/LT with tolerance
- Mixing data types without proper conversion
Frequently Asked Questions
What is GT (Greater Than) in PLC programming?
Returns TRUE when first input is strictly greater than second input. The GT (Greater Than) comparison function evaluates whether the first input is strictly greater than the second input and returns TRUE if so. It works with all numeric and comparable data types including INT, REAL, DINT, and TIME.
What are common applications of GT (Greater Than)?
GT (Greater Than) is commonly used for: High-limit alarm detection, Threshold-based control, Level monitoring (tank overflow), Speed overshoot detection, Pressure relief activation.
How do I use GT (Greater Than) in different PLC platforms?
Siemens: Use CMP > instruction or GT in TIA Portal. Works in LAD, FBD, and SCL. Allen-Bradley: Use GRT (Greater Than) instruction in Studio 5000. Works with all numeric types. CODESYS: Use > operator in ST or GT function block in FBD/LD.
Related Function Blocks
GE (Greater Than or Equal)
Returns TRUE when first input is greater than or equal to second input.
View Reference →LT (Less Than)
Returns TRUE when first input is strictly less than second input.
View Reference →EQ (Equal)
Returns TRUE when both inputs are exactly equal.
View Reference →NE (Not Equal)
Returns TRUE when inputs are not equal to each other.
View Reference →LE (Less Than or Equal)
Returns TRUE when first input is less than or equal to second input.
View Reference →Stop Writing Ladder Logic From Scratch
Get 20 production-ready ladder logic templates for $29 -- download instantly and use them on your next project today.
Instant download - 30-day money-back guarantee - Use on unlimited projects