Mathematics

Mathematics provides you with the option of performing mathematical operations with as much as 20 variables. The variables are determined by input values.
Contents
Inputs and outputs
Inputs:
GATE (see Logic Elements | Datapoint-Gate)
IN 1–…
Each variable is represented by an input.
Outputs:
OUT
The result of the calculation.
Configuration

Inputs
20 inputs are possible in total.
Denomination
You may adapt the variable denominations corresponding with the inputs. By default, the variables are referred to as in1, in2, …, in20
.
Note: Space characters in the denomination result in errors when executing the formula.
Default value
If there is not a value at the related input yet or if the present value cannot be used as a float (Float), the stored default value will be used for calculation.
Execution
Here, you can define whether a calculation is to be triggered when a new value is received at the corresponding input. At this point, it does not yet matter whether this value can be used as a float (Float) later.
The options include:
Always Calculate on Input
A calculation is triggered for every inputNever Calculate on Input
No calculation is triggered, ever. However, this value will be used for calculation.Calculate on value change
Calculation is only triggered if the value for the input changes. E.g. if a value of 1.0 is sent 100-times in a row, calculation will only be triggered after the first time.
Add and delete
Using the + symbol, new inputs are added, and using the symbol, individual inputs are deleted.
Formula
Within the formula, you can use all defined variables. Multiplication and division precede addition and subtraction. The order of calculation can be influenced by using brackets. In addition to the values defined by you, you may use the following supporting variables and functions:
Variables
Name | Description |
---|---|
pi | The circle constant – accuracy roughly 3,141592653589793 |
e | The Euler's number – accuracy roughly 2,718281828459045 |
Operators
Name | Description |
---|---|
+ | Addition |
- | Subtraction |
* | Multiplication |
/ | Division |
** | Exponentiation |
% | Modulo (Remainder) |
Functions
Name | Parameter | Description |
---|---|---|
sin(x) | 1 | Sine |
cos(x) | 1 | Cosine |
tan(x) | 1 | Tangent |
asin(x) | 1 | Arcsines |
acos(x) | 1 | Arccosine |
atan(x) | 1 | Arctangent |
abs(x) | 1 | The absolute value of transfer - -10.0 becomes 10.0 |
ceil(x) | 1 | Rounding up |
floor(x) | 1 | Rounding down |
log(x) | 1 | Logarithm |
sqrt(x) | 1 | Square root |
rand() | 0 | Random number between 0.0 and 1.0 |
max(x,y) | 2 | Maximum value |
min(x,y) | 2 | Minimum value |
The decimal separator is the point ".". When analysing the variables and functions, upper and lower case are taken into account. Thus, pi
is not Pi
or PI
or pI
.
Examples
rand() * 100.0
creates a random number between 0.0 and 100.0min(in1, in2)
whereinin1 = 10.0
andin2 = 8.0
- the result would be 8.02**2 - sqrt(4)
results in 0 - 2² results in 4 and the root of 16 also is four. Subtraction is performed last.ceil(2.333)
results in 3floor(2.6)
results in 2floor(in1 + 0.5)
whereinin1 = 2.6
- results in 3. This way, asymmetric rounding is possible.
///