Super Systems AC20 RS485 Modbus User Manual

Page 10

Advertising
background image

Page 10/59

TITLE: MODBUS/J-BUS Protocol for SSi’s- AC20 ENG. 824E REV. 1

Function code 15: Multiple bits writing

This function code is used by master unit to set/reset a consecutive group of bits (max 24).

Command from master to slave

Reply from slave to master

Range

Byte

Range

Byte

Slave address (0*-255)

1

Slave address (1-255)

1

Function code (15)

1

Function code (15)

1

Bit starting address (high byte)

1

Bit starting address (high byte)

1

Bit starting address (low byte)

1

Bit starting address (low byte)

1

Number of bits (high byte)

1

Number of bits (high byte)

1

Number of bits (low byte)

1

Number of bits (low byte)

1

Byte counter (n)

1

Error check (CRC-16) (low byte)

1

Data

n

Error check (CRC-16) (high byte)

1

Error check (CRC-16) (low byte)

1

Error check (CRC-16) (high byte)

1

* To use the address 0, see note 1 at page 12: “Broadcast address”.
The desired status of each bit is packed in the DATA field (1 = ON, 0 = OFF).
The status imposed for read only bits will be ignored.
The command will be processed starting from the first bit and it will be executed or not
executed depending on the actual device status.
At the first error found, the command will be aborted and the slave will answer with an
error.

Example:
Send to slave, at address 2 (2h), the following set of 9 bits:
bit 224 status = 0

(bit 0)

bit 232 status = 1

(bit 0)

bit 225 status = 1

(bit 1)

Don’t care

= 0

(bit 1)

bit 226 status = 1

(bit 2)

Don’t care

= 0

(bit 2)

bit 227 status = 0

(bit 3)

Don’t care

= 0

(bit 3)

bit 228 status = 1

(bit 4)

Don’t care

= 0

(bit 4)

bit 229 status = 0

(bit 5)

Don’t care

= 0

(bit 5)

bit 230 status = 1

(bit 6)

Don’t care

= 0

(bit 6)

bit 231 status = 1

(bit 7)

Don’t care

= 0

(bit 7)

NOTE: 2 bytes with 9 bits and 7 don’t care bits must be sent

Command from master to slave

Reply from slave to master

Range

Byte

Range

Byte

Slave address

02h

Slave address

02h

Function code

0Fh

Function code

0Fh

Bit starting address (high byte)

00h

Bit starting address (high byte)

00h

Bit starting address (low byte)

E0h

Bit starting address (low byte)

E0h

Number of bits (high byte)

00h

Number of bits (high byte)

00h

Number of bits (low byte)

09h

Number of bits (low byte)

09h

Byte counter

02h

Error check (CRC-16) (low byte)

94h

Data

D6h

Error check (CRC-16) (high byte)

08h

Data

01h

Error check (CRC-16) (low byte)

78h

Error check (CRC-16) (high byte)

4Ch

Advertising