Super Systems AC20 RS485 Modbus User Manual

Page 11

Advertising
background image

Page 11/59

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

Function code 16: Multiple words writing

This function code is used by the master unit to write a consecutive group of words .
The master unit can change a maximum of 20 words at a time.

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 (16)

1

Function code (16)

1

Word starting address (high
byte)

1

Word starting address (high byte)

1

Word starting address (low byte)

1

Word starting address (low byte)

1

Number of words (high byte)

1

Number of words (high byte)

1

Number of words (low byte)

1

Number of words (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 data imposed for read only words will be ignored.
The command will be processed starting from the first word 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.
The 8000h value, present in the “data” field, should be considered as a don’t care value,
this is, the value present in the device at this address will not be modified.

Example:
Set words 139 (8Bh), 140 (8Ch), 141 (8Dh) of slave at address 10 (Ah) with 300 (12Ch),
don’t care (8000h) and 700 (2BCh) values.

Command from master to slave

Reply from slave to master

Range

Byte

Range

Byte

Slave address

0Ah

Slave address

0Ah

Function code

10h

Function code

10h

Word starting address(high byte)

00h

Word starting address (high byte)

00h

Word starting address (low byte)

8Bh

Word starting address (low byte)

8Bh

Number of words (high byte)

00h

Number of words (high byte)

00h

Number of words (low byte)

03h

Number of words (low byte)

03h

Byte counter

06h

Error check (CRC-16) (low byte)

F1h

Data

01h

Error check (CRC-16) (high byte)

59h

Data

2Ch

Data

80h

Data

00h

Data

02h

Data

BCh

Error check (CRC-16) (low byte)

33h

Error check (CRC-16) (high byte)

00h

Advertising