Communication with RS232/485

CONTENTS

SETTINGS

The following settings for the RS-232 and RS-485 extensions can be modified in the Properties window.

Baud rate

Data transmission speed in bits per second

Data bits

5-8

Stop bits

1-2

Parity

None, Even, Odd, Always 0, Always 1

End-of-frame symbol

The use of an end-of-frame symbol is optional.

The symbol must be a hexadecimal character (i.e., 0x0A).

When the RS-232/RS-485 extension detects the end-of-frame symbol, it recognises that the received frame is complete and forwards the frame to the Miniserver.

If no end-of frame symbol is specified, a 32 bit period timeout is used to signal end-of-frame. This means that if nothing is received for a period of 32 bits, then the RS-232/RS-485 extension assumes a complete frame has been received and forwards the frame to the Miniserver.

When transmitting over an RS-232/RS-485 relay, the appropriate checksum is calculated and inserted into the data stream.

When receiving with an RS-232/RS-485 sensor, command recognition occurs only when the corresponding checksum has been correctly received. The checksum may not be used for command recognition.

All RS-232 and RS-485 communication will be transported via the RS-485 bus to the Loxone Miniserver. Frequent queries of data (more than several times per second) can lead to an overload of information where command execution could be delayed. Please therefore check with the device information whether data must be queried at a high frequency or whether several queries per second are sensible.

MONITOR

The RS-232/RS-485 Monitor can be activated by ticking ‘RS-232/485 Monitor’ in the Miniserver tab.

For RS-232/RS-485 extensions each received byte is, by default, displayed on the monitor in ASCII format. By checking ‘Hex’, the hexadecimal value of each received byte will be displayed instead.

SENSOR

Whether an RS-232 or RS-485 sensor takes a digital or analogue input can be defined in the Properties window for that sensor by ticking ‘Use as digital input’, or leaving un-ticked as appropriate.

In the Properties window under ‘command recognition’, a character string can be entered. The digital input places a pulse at the output if the received data contains the command recognition string. For the analogue input, any value can be taken from the received data.

The string is interpreted as ASCII characters.

A sensor can receive up to 512 characters.

If checksum is used, command recognition works only if the corresponding checksum has been received correctly. Checksum may not be used for command recognition.

SPECIAL CHARACTERS FOR COMMAND RECOGNITION WHEN USING DIGITAL AND ANALOGUE INPUT

\x

Hexadecimal i.e., \x09 for 0x09 or \x01\x02\x03\x04 for 0x01020304

\\

\

\.

Any sign

\w

Any word

\#

Any number

\t

Tab (0x09)

\b

Tab (0x09) or space (0x20)

\r

Carriage return (0x0D)

\n

Line feed (0x0A)

\d

Any digit (0-9)

\a

Any letter (A-Z, a-z)

\m

Any letter (A-Z, a-z) or any digit (0-9)

SPECIAL CHARACTERS FOR COMMAND RECOGNITION WHEN USING A ANALOGUE INPUT

\v

The value is accepted as an ASCII string. Decimal points must be separated by a comma or a dot.

\1

The numeric value of the received bytes is placed in the least significant byte (LSB) of the output (bits 0 – 7).

\2

The numeric value of the received byte is placed in bits 8-15 at the output.

\3

The numeric value of the received byte received is placed in bits 16-23 at the output.

\4

The numeric value of the received byte is placed in most significant byte (MSB) at the output (bits 24 – 31).

EXAMPLES WITH DIGITAL INPUT

Received data stream

Command recognition

Digital output

This is a test

This is a test

Pulse

This is a test

This is a test

o

CMD01 OK\n\r

CMD\d\d OK\n\r

Pulse

EXAMPLES WITH ANALOGUE INPUT

Received data stream

Command Recognition

Analogue output

1254

\v

1250

1.254

\v

1.254

1,254

\v

1,254

pm 18.5 20 19.25

pm \v

18.5

pm 18.5 20 19.25

pm \# \v

20

pm 18.5 20 19.25

pm \# \# \v

19.25

CMD01 \ Xa5

CMD01 \ 1

0xA5

CMD02 \x01\x02\x03\x04

CMD02 \1\2\3\4

0x04030201

CMD02 \x01\x02\x03\x04

CMD02 \4\3\2\1

0x01020304

ACTUATOR

Whether an RS-232 or RS-485 relay takes a digital or analogue input can be defined in the Properties window for that relay by ticking ‘Use as digital input’, or leaving un-ticked as appropriate.

In the Properties window under ‘Command when ON’ or ‘Command when OFF’ , a character string can be entered. Upon activation/deactivation the digital output sends the appropriate string to the RS-232 interface. For analogue output, the value at the relay input can be forwarded (for any input variation) and placed at the RS-232 output.

The string is interpreted as ASCII characters.

A sensor can receive up to 256 characters.

If checksum is used, the appropriate checksum is calculated and inserted into the data stream to be sent.

Follow us on social media to stay up-to-date with the latest news from Loxone.

Let’s talk about your smart home project…

From your first enquiry to the finishing touches on your project, Loxone and your Loxone Partner will be with you all the way. Benefit from the experience that we have gained through the realisation of tens of thousands of smart homes worldwide to ensure your project exceeds your expectations.

First Name*

Last Name*

Email*

Phone*

Country*

Floor Space

Project Type

Additional information

Newsletter Checkbox

Receive information about life in a Loxone Smart Home, including tips for energy saving, new products and software updates and more!