Try a PLC free — no signup
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;

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 signup

Opens plcsimulationsoftware.com — same team

Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad

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.

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 signup

Opens plcsimulationsoftware.com — same team

Prefer ready-made code? Ladder Logic Pack — $29 on Gumroad