Variables and calculation
The basic commands and values can be extended further with the use of variables and
calculations.
Variables
You can define your own variables in scripts, which are defined as global variables, useable
across all different scripts on the xxter device. A variable starts with a dollar sign "$", for
example: $AVERAGE The name of the variable can consist of alphanumeric characters (A--‐Z
and 0--‐9).
You can use variables to store any value, for example:
$LIGHTPERCENTAGE =0
SET BYTE(21/Spots) TO $LIGHTPERCENTAGE
Or
$LIGHTSPOTS = BYTE(21/Spots)
SET BYTE(24/Spots Kitchen) TO $LIGHTSPOTS
Calculation
You can use variables to calculate values using arithmetic operators. Calculations are written in
the following manner:
$MAXLIGHT = ( 2 * 10 ) + 10
Of course you can use values of components as well, for example:
$MAXLIGHT = ( 2 * BYTE(21/Spots) ) + 10
IMPORTANT: when using calculations you should always make use of brackets. When no
brackets are used, the calculation is processed in the order it is written! For instance 2 * 10 + 10
will result in 30, but 10 + 2 * 10 will have a result of 24. You can prevent this by writing: 10 +
(2*10). Always keep this in mind when using calculations.
Floating--‐point values can be used by using the "." as a separator, for instance 2.42
Note that all variables are xxter wide. So if you set a specific variable in one script another script
can use that value as well. If you want to use a specific variable only in one script, make sure
other scripts do not use the same variable name.
The following operators can be used:
+
plus
-
minus
*
multiply
/
divide
%
modulo (division remainder)
^
power
&
and
|
or
=
is equal to
<
is smaller than
>
is greater than
<>
is not equal to
A square root can be made with the power operator: ^ (1/2) = to the power of ½ = the square
root of the value.
KNX Technisches Handbuch 1373-1-8902 / 2CKA001373B8902
(result = 1 if both values greater than 0, 0 if not)
(result = 1 if one of the values is greater then 0, 0 if not)
(result = 1 if true, 0 if not)
(result = 1 if true, 0 if not)
(result = 1 if true, 0 if not)
(result = 1 if true, 0 if not)
Inbetriebnahme
│61