Commands and functions
P.
228 of 349
RS232 interface
Configuration
Readrs232
If you establish your KNX
TM
connection with an IP interface, you can freely program the RS232 to
have access to other devices via the RS232. The syntax is analogous to the network functions for
reading and writing on UDP and TCP interfaces, respectively. Cf. the statements on page 64 and
page 71.
You have to configure the RS232 Interface to fit to your application. Insert the section [
RS232
] into
the application program or use the Dialog O
PTIONS
- RS232
SETTINGS
.
[RS232]
// Baud rate of the RS-232 user interface: Decimal notation.
// Permitted values: 0 , 50 , 75 , 110 , 134 , 150 , 200 , 300 , 600 , 1200 , 1800 , 2400 , 4800
// 9600 , 19200, 38400 , 57600 , 115200 , 230400
9600
//Data bits of the RS-232 user interface: Decimal notation. Permitted values: 5, 6, 7, 8
8
//Stop bits of the RS-232 user interface: Decimal notation. Permitted values: 1, 2
1
//Parity of the RS-232 user interface: Decimal notation. OFF = 0 / EVEN = 1 / ODD = 2
0
//Flow control of the RS-232 user interface: Decimal notation.
//OFF = 0 / RTS/CTS = 1 / Xon/Xoff = 2
0
Definition
●
Function
readrs232
(
arg 1
[
, arg2, ... argN
])
Arguments
●
arg2
to
argN
arbitrary
Effect
●
If an arbitrary RS232 telegram is sent to the Enertex
®
EibPC, every function
readrs232
updates its arguments. If this is the case, the arguments of the function are “filled” with
data until the amount of received data complies with the data length of the arguments of
the function
readrs232
.
●
To detect incoming telegrams, the function
event
can be applied to
readrs232
. This will
become necessary if telegrams with identical content have to be evaluated (see below).
Data type result (Return)
●
none
Remark
Depending on the configuration of the RS232-Interface (Baudrate) more than one character can be in
the buffer, while the Enertex® EibPC is running a process cycle. The lengh of the buffer is provided
with the 2
nd
argument.
Example
: Reading RS232 Data
New data shall be written into a string buffer.
[EibPC]
rawdata=$$
len=0u16
Buffer=$$
if event(readrs232(rawdata,len)) then {
Buffer= split(rawdata,0u16,len);
len=0u16
} endif
Example
: Reading exactly 10 Bytes from RS232
HandbuchEibPC_USA-30.odt, 2017-05-11
Enertex
®
Bayern GmbH - Erlachstraße 13 - 91301 Forchheim - [email protected]