beautypg.com

Modbus protocol description and set-up, 8 function 15: write multiple coils, 9 function 16: write multiple holding registers – KROHNE ALTOSONIC V12 EN User Manual

Page 119

background image

MODBUS PROTOCOL DESCRIPTION AND SET-UP

10

119

ALTOSONIC V12

www.krohne.com

04/2013 - 4002643502 - MA ALTOSONIC V12 R02 en

All sub-functions are supported.

10.5.8 Function 15: WRITE MULTIPLE COILS

Function 15 writes the status of 1...2000 contiguous logical (Boolean or ON/OFF) variables.

This function is not used, as in this application Boolean variables are not used as individual
entities. Boolean variables are represented by means of specific bits packed in 32 bit data word
(type “Long”).

10.5.9 Function 16: WRITE MULTIPLE HOLDING REGISTERS

Function 16 writes the contents of 1 to 123 contiguous holding registers in the slave.

When the address is a broadcast, the function pre-sets the same register references in all
attached slaves.

Request

The request message specifies the register references to be pre-set. Registers are addressed
starting at zero (register 1 is addressed as 0).

Example

An example of a request for slave device 17 to pre-set two registers starting at 40002 (decimal),
9C42 (hexadecimal) to 00 0A end 01 02 hex:

Response

The normal response returns the slave address, the function code, starting address, and
quantity of registers pre-set:

Header

Slave address Function

Sub-function Data Hi+Lo

Error check

Trailer

--

11(h)

08(h)

00 00(h)

A1B8(h)

--

--

Table 10-6: Diagnostics

Heade
r

Slave
addres
s

Funct. Starting

address

Quantity

Byte
counts

Data

Error
check
/
Trailer

-

11(h)

10(h)

Hi

9C(h)

Low

41(h)

Hi

00(h)

Low

02(h)

04(h)

Hi

00(h)

Low

0A(h)

Hi

01(h)

Low

02(h)

- / -

Table 10-7: Example multiple holding registers