GW-7238D J1939 to MBTCP Server / MBRTU Slave Gateway User’s Manual (Ver.1.0, Nov. 2011) --- 44
5.3 Modbus Communication – Modbus RTU
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-7238D)
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-7238D’s response is OK.
[Response] (Byte0, Byte1... Byten) (Hex)
01 10 00 00 00 01 01 C9