GT
Function Name |
GT (Greater Than) |
---|---|
Description |
Outputs a True value when Input 1 is greater than the other inputs. |
Arguments |
Input 1 to Input n {ANY} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {BOOL} The output is True only if Input 1 is greater than the other input values. If Input 1 is less than or equal to any of the other inputs, the GT function outputs a False value. |
Example:
Function Block Diagram - GT:
A GT function has 2 inputs (in this case, 2 constant values). Input 1 is has a value of 4 and Input 2 has a value of 2. The GT function outputs a True value as Input 1 is greater than the other inputs.
If Input 2 was changed to have a value of 4, the GT function would output a False value as Input 1 would be equal to Input 2; it would not be greater than Input 2. It is only when Input 1 is greater than the other Inputs that the GT function outputs a True value.
ST Program - GT:
The syntax for a GT function in an ST Program is:
- Output := GT (Input 1, Input n)
Where Output, Input 1 and Input n are defined as variables earlier in the ST program. Each input is separated by a comma and is a Boolean. The Output value is also a Boolean.
Alternatively, you can use an operator:
- Output := (Input 1 > Input n);