User`s manual
BL1600 System Development s 51
Master-Slave Networking
Dynamic C contains library functions for master-slave two-wire half-
duplex RS-485 9th-bit binary communication. This protocol is supported
only on Z180 Port 1, which can be configured for RS-485 communication
(see Figure 4-5 on page 4-4). Any Z-World controller with an RS-485
serial port can be the master or the slave. There can only be one master,
with a board identification address of 0. Slaves each have their own
distinct identification number from 1 to 255.
Functional support for master-slave serial communication follows this
scheme:
Z180 Port 1 is initialized for RS-485 communication.
The master sends an inquiry and waits for a response from a slave.
Slaves monitor for their address during the 9th-bit transmission. The
targeted slave replies to the master.
The binary command message protocol adopted is similar to that used for
the opto 22 binary protocol. A master message has this form.
[slave id] [len] [ ] [ ]...[ ] [CRC hi][CRC lo]
The slaves response has this form.
[len] [ ] [ ]...[ ] [CRC hi] [CRC lo]
The term len is the length of the message that follows. len does not
include the slave id byte (if it is part of the message) or the two CRC
bytes. The CRC bytes include the slave id byte (if it is part of the
message) and the len byte.
During a transfer from the master, the address byte is transferred in 9th-bit
address mode, and only the slave that matches this address will listen to the
rest of the message, which is sent in regular 8-bit data mode.