beautypg.com

KROHNE OPTISONIC V6 Modbus User Manual

Page 9

background image


2011-07-19

OPTISONIC_V6_Modbus_6.doc

9/29

K

R

O

H

N

E

C

T

P

ro

d

u

c

ts

5.3

Function 03: READ HOLDING REGISTERS

Function 03 reads the contents of 1 to 125 contiguous holding registers in the slave.

The maximum number of registers at each request is limited to 125 16-bit registers: 125 integers, 62 long
integers, 62 floats, 31 doubles or 31 long longs.

Request

The request message specifies the starting register and the quantity of registers to be read. Registers are
addressed starting from zero. Registers 1-16 are addressed as 0-15.

Example

A request to read from slave device 17, registers 40108-40110 (decimal), or starting from 9CAC (hex):

Starting address

Number of data items

Header


--

Slave

Address

11(h)

Function


03(h)

Hi

9C(h)

Low

AB(h)

Hi

00(h)

Low

03(h)

Error check


--

Trailer


--

Response:

Data

Header



--

Slave

address


11(h)

Function



03(h)

Byte

count


06(h)

(Reg.

40108

Hi)

02(h)

(Reg.

40108

Low)

2B(h)

(Reg.

40109

Hi)

00(h)

(Reg.

40109

Low)

00(h)

(Reg.

40110

Hi)

00(h)

(Reg.

40110

Low)

64(h)

Error

check


--

Trailer



--

For each register the first byte contains the high order byte, the second the low order byte.

The contents of register 40108 are shown as the two byte values of 02 2B hex (555 decimal). The contents
of register 40109 is 00 00 hex (0 decimal) and of register 40110 is 00 64 hex (100 decimal).

If the request is not applicable, an exception response will be sent.

See chapter 5.10 for exception

responses.

5.4

Function 04: READ INPUT REGISTERS

Function 04 performs a “read” operation, similar to function 03. The difference is that function 04 addresses
input registers (which are “read-only”), whereas function 03 addresses holding registers (which are
“read/write”).

5.5

Function 05: WRITE SINGLE COIL

Function 05 writes the status of a logical (Boolean or ON/OFF) variable.

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”).

5.6

Function 06: WRITE SINGLE HOLDING REGISTER

Function 06 presets a value into a single holding register.

When the address is a broadcast, all slaves will process the request.

Request

The request specifies the register reference to be written. Registers are addressed starting from zero.