Mathematical Functions

Help Contents
  1. Fernhill SCADA
  2. Help
  3. IEC 61131-3
  4. Common Elements
  5. Functions
  6. Mathematical Functions

Introduction

Fernhill SCADA supports these mathematical functions defined by the IEC 61131-3 standard:

FunctionParameter TypeParametersDescription
ABSANY_MAGNITUDE1Return the absolute value
SQRTANY_REAL1Return the square root
LN ANY_REAL 1 Return the natural logarithm
LOGANY_REAL1Return logarithm base 10
EXPANY_REAL1Return 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.

In addition Fernhill SCADA supports these functions as an extension to the IEC 61131-3 standard:

FunctionParameter TypeParametersDescription
CEILINGANY_NUM1Return the next highest whole number.
FLOORANY_NUM1Return the next lowest whole number.
ROUNDANY_MAGNITUDE, ANY_INT2Returns a value rounded to n decimal digits.
Half way cases are rounded away from zero.
ROUNDSDANY_MAGNITUDE, ANY_INT2Returns a value rounded to n significant digits.
Half way cases are rounded away from zero.
SIGNANY_MAGNITUDE1Return 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.

Standards Compliance

Table 23 - IEC 61131-3 Second Edition.

Table 28 - IEC 61131-3 Third Edition.

Further Information

Generic Data Types

To learn about generic data types such as ANY_INT, ANY_NUM, ANY_MAGNITUDE.

Time Functions

To learn about arithmetic operations on date and time types.

Common Elements

To learn about other language Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.