Variables andKNX™ group addresses
P.
154 of 349
Numbers (Constants)
Special type: % (Percentage)
Hexadecimal representation
By the help of the data type, numbers and constants can be declared in the Enertex
®
EibStudio.
For numbers, the number is preceded by the type of data, thus e. g.
●
2u08 Positive 8-bit-integer: 2
●
2.0f16 Floating point number 2.0
●
-6s32 Integer with sign -6
●
33.2% Percentage 33.2 (equivalent to 84)
Invalid syntax is recognized by the EibParser (integrated compiler in the Enertex
®
EibStudio) and
generates an error message.
In case of unsigned integers with length 8 bits and of floating point numbers of length 16 bits, the
specification of data types can be omitted, i.e. values in the form
●
0 ... 255 are of type u08,
●
2.0 (decimal point in number) are of type f16.
For these two types of numbers, the specification of data types is
optional
.
In the ETS programming, the percentages “%“ are used. These are compatible to the data type “u08“
and are internally adjusted by the KNX actuators by scaling. Here, to simplify programming, we have
defined the percentage for constants. In this context, the percentage may be specified with a decimal
point, e. g. 2.3%. Because of the scaling, 100% corresponds to a value of 255u08 or the conversion
of a variable Y% is more generally as follows:
X
[
u08
]=
Y
[
%
]
100
⋅
255 for cutting off the decimal points
The built-in compiler within the Enertex
®
EibStudio will make those adjustments for you, so that you
can address actuators as usual
When different types of data are linked in your application program with each other, e.g. the sum of
2u08 and 2u32, then an error is reported by the integrated compiler in Enertex ® EibStudio.
Therefore, accidental overflows, numerical problems, etc. cannot occur. To convert these numbers
into yet another, and thus to be able to process them, use the
convert
function. Hence, even
conversions from numbers to strings are possible. For further information, see page 208.
Unsigned integers (data type „u“) also can be given in hexadecimal representation with the prefix
“0x”. The compiler converts this representation into the respective number.
●
Data type u08: Two digits are required 0xF1 (= 241)
●
Data type u08: Two digits are required 0xF1u08 (= 241)
●
Data type u16: At least two digits and the data type „u16“ are required: 0xF1A3u16 (=
61859u16)
●
Data type u24: At least two digits and the data type „u24“ are required: 0xF1A3u24 (=
61859u24)
●
Data type u32: At least two digits and the data type „u32“ are required: 0xF1A3u32 (=
61859u32)
●
Data type u64: At least two digits and the data type „u64“ are required: 0xF1A3u64 (=
61859u64)
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - mail@enertex.de