GW-7228 J1939/Modbus RTU Slave Gateway
User’s Manual (Ver 1.3, Apr/2011) ------------- 44
5.3 Modbus Communication
Set J1939 output data
Using the Modbus command as below:
FC16 Write multiple registers (4xxxx) for AO
[Request] (Request by Modbus master device)
Byte 0: Net ID (Station number)
Byte 1: FC=10 (Hex)
Byte 2-3: Reference number
Byte 4-5: Word count
Byte 6: Byte count (B=2 x word count)
Byte 7-(B+6): Register values
Byte (B+7)-(B+8): Value for the CRC calculation
[Response] (Response from the GW-7228)
Byte 0: Net ID (Station number)
Byte 1: FC=10 (Hex)
Byte 2-3: Reference number
Byte 4-5: Word count
Byte 6-7: Value for the CRC calculation
Example:
In the address 40001, write the value in 0x1234.
[Request Command] (Byte0, Byte1... Byten) (Hex)
01 10 00 00 00 01 02
12 34
AB 27
GW-7228
’s response is OK.
[Response] (Byte0, Byte1... Byten) (Hex)
01 10 00 00 00 01 01 C9