Learn PLCs free
Comparison OperationsBeginnerIEC 61131-3

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

NameTypeDescription
IN1ANY_NUMFirst value (left operand)
IN2ANY_NUMSecond value (right operand)

Outputs

NameTypeDescription
OUTBOOLTRUE 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

S

Siemens (TIA Portal)

Use CMP > instruction or GT in TIA Portal. Works in LAD, FBD, and SCL.

AB

Allen-Bradley (Studio 5000)

Use GRT (Greater Than) instruction in Studio 5000. Works with all numeric types.

C

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.

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.

20
Ready-Made Templates
LD + ST
Both Languages Included
$29
One-Time Purchase
Get Instant Access -- $29

Instant download - 30-day money-back guarantee - Use on unlimited projects

Free PLC simulator

Wire this block up and run it

Drop the instruction into a rung, hit Run, and watch it execute in your browser. 12 guided lessons across 8 PLC dialects — free account, no credit card.

Practice PLCs free →