LE
Function Name |
LE (Less Than or Equal To) |
---|---|
Description |
Outputs a True value when Input 1 is less than or equal to 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 less than or equal to the other input values. If Input 1 is greater than any of the other inputs, the LE function outputs a False value. |
Example:
Function Block Diagram - LE:
An LE function has 2 inputs (in this case, 2 constant values). Input 1 is has a value of 2 and Input 2 has a value of 4. The LE function outputs a True value as Input 1 is less than or equal to the other inputs.
If Input 1 was changed to have a value of 4, the LE would still output a True value as Input 1 would be equal to Input 2. It is only when Input 1 is greater than the other Inputs that the LE function outputs a False value.
ST Program - LE:
The syntax for an LE function in an ST Program is:
- Output := LE (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);