GE block
Short summary
Name |
GE |
→POU type |
|
Category |
|
Conform to →IEC-standard |
currently restricted |
Graphical interface |
|
Available since |
version 1.19.0 (for logi.CAD 3) |
Functionality
The block is a comparator regarding monotonic sequence ("Greater than & Equals to").
Enter the values at the inputs, those values are to be compared. The block returns value TRUE (or an equivalent), if a value connected to an input is greater than or equal to the value connected to the respectively following input – hence, if: (IN1≥IN2) & (IN2≥IN3) & ... & (IN15≥IN16)
Bitstring values (= ANY_BIT values ; see →generic data type} are treated like unsigned →integer values by the block. This behavior is a specification according to the →IEC-standard.
Inaccuracies for floating-point numbers
Due to the internal representation of floating-point numbers (affects the data types REAL and LREAL) there might be inaccuracies when processing such values. Such inaccuracies might result in a not expected result when comparing such values.
Inputs, return value
|
Identifier |
Description |
|
Inputs: |
IN1 |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
1st value |
IN2 |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
2nd value |
|
... (extensible until) |
|||
IN16 |
REAL, LREAL, USINT, UINT, UDINT, ULINT, SINT, INT, DINT, LINT, TIME, BOOL, BYTE, WORD, DWORD, LWORD, DATE_AND_TIME, DATE or TIME_OF_DAY |
16th value |
|
Return value: |
– |
BOOL |
|
Input EN and output ENO are available when →calling the block. See "Execution control: EN, ENO" for information on input EN and output ENO.
See:
"Blocks for safe logic" whether this block is supported for developing safety-relevant applications.
"Highlighting safe logic in the FBD-editor" for the effects when using the block as a block for safe logic .
Example for usage within ST-editor
PROGRAM Test
VAR
result : BOOL;
END_VAR
result := GE(IN1 :=
1.0
, IN2 :=
2.0
, IN3 :=
1.0
); (* The variable
'result'
evaluates to
'FALSE'
. *)
result := GE(IN1 :=
1.0
, IN2 :=
2.0
, IN3 :=
2.0
); (* The variable
'result'
evaluates to
'FALSE'
. *)
result := GE(IN1 :=
3.0
, IN2 :=
2.0
, IN3 :=
1.0
); (* The variable
'result'
evaluates to
'TRUE'
. *)
result := GE(IN1 :=
3.0
, IN2 :=
2.0
, IN3 :=
2.0
); (* The variable
'result'
evaluates to
'TRUE'
. *)
END_PROGRAM
When creating your application within the ST-editor, enter a call of a block by typing the text as requested by the syntax or use Content Assist.