Greater Than or Equal To (GEQ)
The GEQ instruction tests whether Source A is greater than or equal to Source B.
Available Languages
- Ladder Diagram
- Function Block
- Structured Text
This instruction is not available in structured text. *
* There is no equivalent structured text instruction. Use other structured text programming to achieve the same result.
Operands
- Ladder Diagram
- Function Block
- Structured Text
Use adjacent greater than and equal signs ">=" as an operator within an expression. This expression evaluates whether sourceA is greater than or equal to sourceB.
IF sourceA >= sourceB THEN
<statements>;
FBD_COMPARE Structure
Example
If value_1 is greater than or equal to value_2, set light_b. If value_1 is less than value_2, clear light_b.
- Ladder Diagram
- Function Block
- Structured Text
light_b := (value_1 >= value_2);
- Download to PDF
Available Languages
- Ladder Diagram
- Function Block
- Structured Text
This instruction is not available in structured text. *
* There is no equivalent structured text instruction. Use other structured text programming to achieve the same result.
Operands
- Ladder Diagram
Operand | Type | Format | Description | Notes |
Source A | SINT INT DINT REAL String type | Immediate tag | value to test against Source B | If you enter a SINT or INT tag, the value converts to a DINT value by sign-extension. String types are: - default STRING data type - any new string type you create To test the characters of a string, enter a string type for both Source A and Source B. |
Source B | SINT INT DINT REAL String type | Immediate tag | value to test against Source A |
- Function Block
Operand | Type | Format | Description |
GEQ tag | FBD_COMPARE | structure | GEQ structure |
- Structured Text
Use adjacent greater than and equal signs ">=" as an operator within an expression. This expression evaluates whether sourceA is greater than or equal to sourceB.
IF sourceA >= sourceB THEN
<statements>;
FBD_COMPARE Structure
Input Parameter | Data Type | Description |
EnableIn | BOOL | Enable input. If cleared, the instruction does not execute and outputs are not updated. Default is set. |
SourceA | REAL | Value to test against SourceB Valid = any float |
SourceB | REAL | Value to test against SourceA Valid = any float |
Output Parameter | Data Type | Description |
EnableOut | BOOL | Enable output. |
Dest | BOOL | Result of the instruction. This is equivalent to rung-condition-out of the ladder diagram GEQ instruction. |
Example
If value_1 is greater than or equal to value_2, set light_b. If value_1 is less than value_2, clear light_b.
- Ladder Diagram
- Function Block
- Structured Text
light_b := (value_1 >= value_2);
- Download to PDF
0 comments :