Manual

ALTOSONIC V
ModBus Manual 0300 rev07 E 7.30855.35.00 Page 13 of 64
Example
Here is an example of a request to preset register 40002 to 00 03 in slave 17.
Register Address Data Header
--
Slave
Address
11(h)
Function
06(h)
Hi
00(h)
Low
01(h)
Hi
00(h)
Low
03(h)
Error
Check
--
Trailer
--
Response
is an echo of the query, returned after the register contents have been pre-set.
Register Address Data Header
--
Slave
Address
11(h)
Function
06(h)
Hi
00(h)
Low
01(h)
Hi
00(h)
Low
03(h)
Error
Check
--
Trailer
--
If the request is not applicable an exception response will be sent.
See chapter 5.10 for exception responses.
5.7 Function 8: DIAGNOSTICS
Description
Function 8 provides a test for checking the communication system between the master and the slave.
Query
The function uses a two-byte sub-function field in the query to define the test to be performed.
Header
--
Slave address
11(h)
Function
08(h)
Sub-function
00 00(h)
Data Hi+Lo
A1B8 (h)
Error check
--
Trailer
--
Only sub-function 0 is supported, which response is to loop back the query data.
Function 8 is only supported in slave mode.
5.8 Function 15: WRITE MULTIPLE COILS
Description
Function 15 forces each coil (0x reference) in a sequence of coils to either ON or OFF.
When the address is a broadcast, all slaves will process the request.
Query
The query message specifies the coil reference to be forced. Coils are addressed starting at zero (coil
1 is addressed as 0).
Example
Here is an example of a request to force a series of coils starting at coil 20 in slave 17. The query data
contents are two bytes CD 01 hex, the binary bits correspond to the coils in the following way:
Bit
1 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1
Coil
27 26 25 24 23 22 21 20 x x x x x x 29 28
X means don’t care and are made zero.
The first byte transmitted (CD) addressed coils 27…20, where by the least significant bit addresses the
lowest coil (20) in this set.