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;Free · no signup to try
Run this block in your browser
Try the instruction on a live rung before you copy it into a project — nothing to install.
Try it in your browser — no signupOpens plcsimulationsoftware.com — same team
Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad
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 two compatible operands compare unequal at execution.
View Reference →LE (Less Than or Equal)
Returns TRUE when first input is less than or equal to second input.
View Reference →Free · no signup to try
Wire this block up and run it
Drop the instruction into a rung, press Run and watch it execute in your browser — then adapt it to your vendor tool.
Try it in your browser — no signupOpens plcsimulationsoftware.com — same team
Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad