Fernhill SCADA supports these mathematical functions defined by the IEC 61131-3 standard:
Function | Parameter Type | Parameters | Description |
---|---|---|---|
ABS | ANY_MAGNITUDE | 1 | Return the absolute value |
SQRT | ANY_REAL | 1 | Return the square root |
LN | ANY_REAL | 1 | Return the natural logarithm |
LOG | ANY_REAL | 1 | Return logarithm base 10 |
EXP | ANY_REAL | 1 | Return natural exponent |
SIN | ANY_REAL | 1 | Return the sine of the input. The input is in radians |
COS | ANY_REAL | 1 | Return the cosine of the input. The input is in radians |
TAN | ANY_REAL | 1 | Return the tangent of the input. The input is in radians |
ASIN | ANY_REAL | 1 | Return the principle arc sine of the input. The output is in radians |
ACOS | ANY_REAL | 1 | Return the principle cosine of the input. The output is in radians |
ATAN | ANY_REAL | 1 | Return the principle tangent of the input. The output is in radians |
ATAN2 | ANY_REAL, ANY_REAL | 2 | Return the principle tangent of the input. The output is in radians. |
Fernhill SCADA supports these functions as an extension to the IEC 61131-3 standard:
Function | Parameter Type | Parameters | Description |
---|---|---|---|
CEILING | ANY_NUM | 1 | Return the next highest whole number. |
FLOOR | ANY_NUM | 1 | Return the next lowest whole number. |
ROUND | ANY_MAGNITUDE, ANY_INT | 2 | Returns a value rounded to n decimal digits. Half way cases are rounded away from zero. |
ROUNDSD | ANY_MAGNITUDE, ANY_INT | 2 | Returns a value rounded to n significant digits. Half way cases are rounded away from zero. |
SIGN | ANY_MAGNITUDE | 1 | Return the sign of the value as +1 for positive, -1 for negative, or 0 for zero. |
Mathematical functions ABS, and SIGN also work with the TIME data type. For example:
ABS( T#-5s ) returns T#5s.
IEC 61131-3 Second Edition: Table 23.
IEC 61131-3 Third Edition: Table 28.
To learn about generic data types such as ANY_INT, ANY_NUM, ANY_MAGNITUDE.
To learn about arithmetic operations on date and time types.
To learn about other language Common Elements.
For the meaning of terms used in Fernhill SCADA.