10
8
MODBUS FUNCTIONS…
Note
. To write to a register, the register’s offset address must be used, e.g. to write to register 50, the offset address
49(31) is transmitted.
01
06
00
31
04
02
5B
04
Register
Offset High
Function
Address
Register
Offset Low
Error Check Field (CRC-16)
Data Value High
Data Value Low
01
06
00
31
04
02
5B
0B
Register
Offset High
Function
Address
Register
Offset Low
Error Check Field (CRC-16)
Data Value High
Data Value Low
8.4
Preset Single Register – Function Code 06
8.4.1
Preset Single Register Query
The preset single register allows the user to modify the contents of a holding register.
Note
. Function codes 5, 6 and 16 are the only messages that are recognized as valid for broadcast.
Example
– a preset single register request to write the value 501 to holding register address 50 (Output Range 1) in slave 01 is
shown below.
Since all register values for measured variables and alarm set points are ranged to 12 bits (for RTU), then to calculate the Data
Value High and Data Value Low for a setpoint of 501 the following method is used:
Instrument Range
=
0 to 2000
therefore
501 x 4095 = 1026
10
2000
converted to hexadecimal
1026
10
= 402
8
therefore
Data Value High = 04
Data Value Low = 02
8.4.2
Preset Single Register Response
The normal response to a preset single register request is to retransmit the query message after the register has been altered.
Example
:
Содержание 8241
Страница 26: ...24 NOTES ...