Master-Slave mode

Application

A further possibility is the exchange of data between a master and up to 7 slaves. The address of the slave is set accordingly with the DIP switch. The address may only be used once for each channel. Here too the control byte 1 CB1 must be set to TRUE as bit 0 "Start BIT". Bits 3...5 are used to set the slave address of the target device. The terminal then sends telegrams to the corresponding slave. If the terminal receives a response, this is displayed in the status.

Example: Task – you want to speak to slave 2.

Set bit 0 to TRUE in order to start data exchange. Bit 3 must then be set in order to speak to slave 2. As soon as the reply from slave 2 is received (after approx. 20 ms), the master terminal confirms this in the status byte by setting bit 4. The address is always counted +1 in the status byte (see table).

CB1

Bit

CB1.7

CB1.6

CB1.5

CB1.4

CB1.3

CB1.2

CB1.1

CB1.0

Name

RegAccess

reserve

Add3

Add2

Add1

Scan

EnergyScan

Start

Value

0

0

0

0

1

0

0

1

SB1

Bit

SB1.7

SB1.6

SB1.5

SB1.4

SB1.3

SB1.2

SB1.1

SB1.0

Name

RegAccess

Error

Add3

Add2

Add1

Scan

EnergyScan

Start

Value

0

0

0

1

0

0

0

1

Address

Control byte bit 3...5

Status byte bit 3...5

Slave 1

0dec

000bin

1dec

001bin

Slave 2

1dec

001bin

2dec

010bin

Slave 3

2dec

010bin

3dec

011bin

Slave 4

3dec

011bin

4dec

100bin

Slave 5

4dec

100bin

5dec

101bin

Slave 6

5dec

101bin

6dec

110bin

Slave 7

6dec

110bin

7dec

111bin

Hence, you can now poll the terminals at any desired speed and in any desired rhythm. If you only send data very rarely to a slave, remember that the watchdog in the slave terminal can trigger. The watchdog time in the slave is approx. 400 ms and can be set in register R38. The default value is 20 and must be multiplied by 20 ms.

If a slave does not answer, then either the radio connection is disturbed or bit 0 of the control byte on the slave side is not set; the master terminal sets the error bit 6. The error code is contained in the high nibble in SB2.

If you want to address a new slave, make sure that the data bytes 0...9 are updated on the new slave at the same time. When the slave replies, you should only accept the data from the new slave if the new slave address appears in the status and the error bit is not set.