EasyManua.ls Logo

Datakom DK-45 - Modbus Data Handling; Modbus Data Reading

Datakom DK-45
64 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
DK-45 Kullanım Kılavuzu V1.0 (22.09.2016)
- 50 -
Data reading
The function 03 (read multiple registers) will be used for data reading. The MODBUS master will send a
query. The answer will be one of the below:
-A response containing the requested data
-An exceptional response indicating a read error.
The maximum number of registers read in one message is 120. If more registers are requested, the unit
will send only the first 120 registers.
The query message specifies the starting register and quantity of registers to be read. The message
structure is below:
Byte
Description
Value
0
Controller address
254
1
Function code
3
2
Starting address high
See chapter 11.2 for the description of available
registers
3
Starting address low
4
Number of registers high
always 0
5
Number of registers low
max 78h (120 decimal)
6
CRC low byte
See below for the checksum calculation
7
CRC high byte
Here is the sequence to read 16 registers starting from address 20h (32 decimal):
01 03 00 20 00 10 45 CC (each byte is expressed as 2 hexadecimal characters)
The checksum value in the above message may be used for the verification of checksum
calculation algorithm.
The normal response will be:
Byte
Description
Value
0
Controller address
same as in the query
1
Function code
3
2
Data lenght in bytes (L)
number of registers * 2
3
High byte of 1st register
4
Low byte of 1st register
5
High byte of 2nd register
6
Low byte of 2nd register
....
L+1
High byte of the last register
L+2
Low byte of the last register
L+3
CRC low byte
See below for the checksum calculation
L+4
CRC high byte
The exceptional response will be:
Byte
Description
Value
0
Controller address
same as in the query
1
Function code
131 (function code + 128)
2
Exception code
2 (illegal address)
3
CRC low byte
See below for the checksum calculation
4
CRC high byte

Related product manuals