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6
Preset Single Register – Function Code 06
5.6.1
Preset Single Register Query
The preset single register allows the user to modify the contents of a holding register.
Note. To write to a register, the register’s offset address must be used, e.g. to write to register 31, the offset address 30
(1EH) is transmitted.
The use of slave address zero (broadcast mode) forces all attached slaves to modify the desired register.
Example
– a preset single register request to write the value 500 to holding register address 31 (maths 1 constant a) in slave 01
is shown below.
5.6.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
:
5.7
Loopback Diagnostic Test – Function Code 08
5.7.1
Loopback Diagnostic Test Query
The purpose of the loopback diagnostic test is to test the Modbus system, it does not affect the content of the controller. Variations
in the response may indicate faults in the Modbus system. The information field contains 2 bytes for the designation of the
diagnostic code followed by 2 bytes to designate the action to be taken.
Example
– a loopback test query of slave 01 is shown below.
5.7.2 Loopback Diagnostic Test Response
The response always echoes the query, only diagnostic code 0 (bytes 3 and 4) can be used.
Example
: