30
12. Modbus telegram examples
12.1 Diagnostics: return query data
This function is useful to ensure that the communication path and
slave configuration are correct. It will echo the request in the
response.
In the example, slave address 0x01 is used.
Request from master to slave
Example of response from slave to master
If there is no response from the slave, see section
12.2 Reading the CIM configuration register block
This section shows how to read the first four registers of the
CIM configuration register block.
In the example, slave address 0x01 is used.
Request from master to slave
Example of response from slave to master
If there is no response from the slave, see section
12.3 Tripping the MP 204
This section shows how to set the control bit that trips the
MP 204.
In the example, slave address 0x01 is used.
To trip the MP 204, the ControlRegister (register address 00101,
bit 1) must be raised.
Hence the value to set is 0b0000000000000010 = 0x0002.
Request from master to slave
Example of response from slave to master
If there is no response from the slave, see section
.
12.4 Resetting an alarm
This section shows how to set the control bit that resets MP 204
alarms.
In the example, slave address 0x01 is used.
To reset an alarm, the ControlRegister (register address 00101,
bit 0) must be raised.
Hence the value to set is 0b0000000000000001 = 0x0001.
Request from master to slave
Example of response from slave to master
If there is no response from the slave, see section
.
Note
CRC fields are not shown in the following
examples.
Note
The Modbus data model states that registers
numbered X are addressed in telegrams as X - 1,
e.g. register 00104 (setpoint) is addressed as
00103 in a Modbus telegram.
Field
Value
Description
Slave address
0x01
-
Function code
0x08
Diagnostics
Subcode
0x00
Echo request
Data
0xAB
Test data
Data
0xCD
Test data
Field
Value
Description
Slave address
0x01
-
Function code
0x08
Diagnostics
Subcode
0x00
Echo request
Data
0xAB
Test data
Data
0xCD
Test data
Field
Value
Description
Slave address
0x01
-
Function code
0x04
Read input registers
Start address HI
0x00
Start address
= 0x0001
Start address LO
0x00
Quantity HI
0x00
Number of registers
= 0x0004
Quantity LO
0x04
Field
Value
Description
Slave address
0x01
-
Function code
0x04
Read input registers
Byte count
0x08
8 bytes follow
00001 HI
0x00
SlaveMinimumReplyDelay
= 0x000A
00001 LO
0x0A
00002 HI
0x00
RegisterOffset
= 0x0000
00002 LO
0x00
00003 HI
0x00
Reserved value
= 0x0000
00003 LO
0x00
00004 HI
0x00
ModbusBitRate
= 0x0004
00004 LO
0x04
Field
Value
Description
Slave address
0x01
-
Function code
0x06
Write single register
Start address HI
0x00
ControlRegister address
= 00101 (0x0065)
Start address LO
0x64
Value HI
0x00
ControlRegister value
= 2 (0x0002)
Value LO
0x02
Field
Value
Description
Slave address
0x01
-
Function code
0x06
Write single register
Start address HI
0x00
ControlRegister address
= 00101 (0x0065)
Start address LO
0x64
Value HI
0x00
ControlRegister value
= 2 (0x0002)
Value LO
0x02
Field
Value
Description
Slave address
0x01
-
Function code
0x06
Write single register
Start address HI
0x00
ControlRegister address
= 00101 (0x0065)
Start address LO
0x64
Value HI
0x00
ControlRegister value
= 1 (0x0001)
Value LO
0x01
Field
Value
Description
Slave address
0x01
-
Function code
0x06
Write single register
Start address HI
0x00
ControlRegister address
= 00101 (0x0065)
Start address LO
0x64
Value HI
0x00
ControlRegister value
= 1 (0x0001)
Value LO
0x01
Subject to alterations.