ABS
Function Name |
ABS |
---|---|
Description |
Converts a numerical input into an absolute value. The absolute value is the output and is also a REAL or LREAL value. |
Arguments |
Input 1 {ANY_NUM} For more information on the data types for the inputs and outputs, see Data Type Hierarchy. |
Returns |
Output {Same data type as input} |
Example:
Function Block Diagram - ABS:
The ABS function converts values into positive values (if the input is positive, the output is positive; if the input is negative, the output is positive). In this example, the constant input is -324 so the ABS function outputs 324.
ST Program - ABS:
The syntax for an ABS function in an ST Program is:
Output := ABS (Input 1);
Where Output and Input 1 are defined as variables earlier in the ST program. The Input 1 variable represents any type of numerical value.