Variables andKNX™ group addresses
P.
161 of 349
“Manual“ group addresses
The if-statement
Besides the possibility to use group addresses by using the ets project data, you can define any
group address itself without having to resort to the ets Now, you must only use the following notation:
Manual address:
'
Group address
'
Data type
Group addresses without using the ets
begin with a single quote, followed by the major
group/middle group/subgroup (in numerical format), followed by a single quote and the data type, as
was shown in Table 1.
Example:
'1/0/0'u08
'1/0/1'b01
'5/0/81's16
In the example above, the first group address 1/0/0 is of the type of an unsigned integer with 8 bits in
length, the address 1/0/1 is of a binary type and 5/0/81 is of the type of a signed integer with 16 bits
length. The simultaneous use of imported and manual addresses is possible at any time.
As could already be found within the step-by-step introduction (see page 32), the if statement, thus
the conditional statement, is the central point of automation. The syntax of an if statement is as
follows:
if (
query condition
) then
Statement
endif
if (
query condition
) then
Statement1
else
Statement2
endif
The query condition must be of type b01. If the query condition is not of this type, the integrated
compiler of the Enertex
®
EibStudio issues an error.
Multiple statements can also be executed as a block. In this case, the instructions are separated by
semicolons point.
After the last statement, there is no semicolon.
A query condition is considered true when it takes the value
ON
(1b01). In this case, the then-branch
is not executed. If the
if
query contains an
else
branch, so this is considered for non-compliance, i.e.
the value of the query condition is
OFF
(0b01),
Example
if (a==23u08) then write('1/2/3's16,-234s16) else write('1/2/3's16,0s16) endif
For the query condition of the if statement applies the validation scheme as described for the
variables on the following page 162. This means that an if statement is evaluated only (once) when
the query condition changes. If
a
assumes the value 23u08, then the
then
branch is executed once.
In the subsequent cycle, if
a
does not change, the if function does not run again. If
a
changes, but
the query condition is not met, the
else
branch is once performed at each of these changes. For
further information refer to page 162 or the step-by-step introduction.
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]