Commands and functions
P.
201 of 349
Arithmetic operations
(“Calculations“)
Basics
Absolute value
Addition
Arc cosine
Not only (logical and temporal) processes can be programmed by Enertex
®
EibPC, but also
mathematical expressions can be evaluated and hence appropriate responses to the KNX network,
e.g. caused by sending of the corresponding addresses, can be produced.
For all the arguments of functions, group address can also be directly used instead of
variables.
Definition
●
Function
abs
(
variable
)
Arguments
●
Data type: uXX, sXX and fXX, with XX arbitrary bit length defined on page 92
Effect
●
Return value: Absolute of
variable
Data type result (Return)
●
Data type of arguments
Example absolute value:
Calculate the absolute value of a (= 2.5f23) and save it as b.
Then, the implementation in the user program is:
a=-2.5f32
b=abs(a)
Definition
●
variable1
+
variable2 [...]
Arguments
●
All arguments are of the same data type
●
Data type: u
XX
, s
XX
and f
XX
, with
XX
arbitrary bit length defined on page 154
Effect
●
The values of the variables are added. Only values of the same type can be added. If you
nevertheless want to add e.g. an unsigned 8 bit value and a signed 16 bit value, use the
convert function (see page Fehler: Referenz nicht gefunden)
Data type result (Return)
●
Data type of the arguments
Note:
With the same syntax, you can concatenate character strings (see page 220).
Definition
●
Function
acos
(
variable
)
Arguments
●
1 argument
variable
is of data type f32
Effect
●
Calculation of the arc cosine of the
variable
given in RAD
●
If the argument is greater than 1f32 or smaller than -1.0f32, there is no calculation
Data type result (Return)
●
Data type f32
Example arccosine:
In variable b is the result of the arccosine of variable a.
Then, the implementation in the user program is:
a=5f32
b=acos(a)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]