GT(

Greater than

The content of the accumulator is compared with the expression in the following brackets. If the accumulator is greater, TRUE is stored in the accumulator, otherwise FALSE.

Remarks

  • Valid operands for this operator must be of one of the following data types:   (ANY)

  • The result of the operation is of data type BOOL.

  • Operator only available in IL programming language.

  • var_1 and the result of the expression in brackets can be of any standard data type. var_4 has to be of type BOOL.

  • Since in this example the expression in brackets contains an ADD command, var_2 and var_3 have to be of a numeric type (INT or REAL type). This also determines that the data type required for var_1 be of this same type.

Example

POU header

All input and output variables used for programming this function have been declared in the POU header. The same POU header is used for all programming languages.

IL body

LD

var_1

(* Load var_1 in accu *)

(* Since bracket expression follows, save content of accu;

process expression in brackets first *)

GT(

var_2

(* Load var_2 in accu *)

ADD

var_3

(* Add var_3 to accu; store result in accu *)

)

(* Get saved accu content and compare to actual content of accu; store result in accu;

if saved accu > actual accu, TRUE is stored in accu, else FALSE *)

ST

var_4

(* Store accu in var_4 *)

Modified on: 2019-01-24Feedback on this pagePanasonic hotline