Examples of Modbus/TCP to CAN converter_GCAN
5. Examples
Users can send the Modbus instruction through the network debugging software in the CD. Please choose the TCP Client mode and the remote host address is 192.168.1.10:502 (IP address for the factory settings, can be modified; port number can not be modified).
Please note: check the " 十六进制显示" and " 十六进制发送" when using the software Network Debugging Assistant.
5.1 Read the received CAN frame
For example:
Modbus slave address: 1
Modbus register first address: 0x01 (factory setting)
Function code: 03
Frame format: standard frame
Frame ID: 0x181
CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
Modbus master sends request frame:
00 00 00 00 00 06 01 03 00 01 00 04
Response frame of GCAN-205:
00 00 00 00 00 0B 01 03 08 02 01 04 03 06 05 08 07
At this point, the GCAN-205 converter receives a data frame with CAN ID of 0x181.
5.2 Write the CAN frame to be sent
For example:
Modbus slave address: 1
Modbus register first address: 0x101(decimal value is 257, factory setting)
Function code: 16(10H)
Frame format: standard frame
Frame ID: 0x201
CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
Modbus master sends request frame:
00 00 00 00 00 0F 01 10 01 01 00 04 08 02 01 04 03 06 05 08 07
Response frame of GCAN-205:
00 00 00 00 00 06 01 10 01 01 00 04
At this point, the CAN terminal of other converters receive a data frame with a CAN ID of 0x201 from the Modbus side.
Users can send the Modbus instruction through the network debugging software in the CD. Please choose the TCP Client mode and the remote host address is 192.168.1.10:502 (IP address for the factory settings, can be modified; port number can not be modified).
Please note: check the " 十六进制显示" and " 十六进制发送" when using the software Network Debugging Assistant.
5.1 Read the received CAN frame
For example:
Modbus slave address: 1
Modbus register first address: 0x01 (factory setting)
Function code: 03
Frame format: standard frame
Frame ID: 0x181
CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
Modbus master sends request frame:
00 00 00 00 00 06 01 03 00 01 00 04
Response frame of GCAN-205:
00 00 00 00 00 0B 01 03 08 02 01 04 03 06 05 08 07
At this point, the GCAN-205 converter receives a data frame with CAN ID of 0x181.
5.2 Write the CAN frame to be sent
For example:
Modbus slave address: 1
Modbus register first address: 0x101(decimal value is 257, factory setting)
Function code: 16(10H)
Frame format: standard frame
Frame ID: 0x201
CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08
Modbus master sends request frame:
00 00 00 00 00 0F 01 10 01 01 00 04 08 02 01 04 03 06 05 08 07
Response frame of GCAN-205:
00 00 00 00 00 06 01 10 01 01 00 04
At this point, the CAN terminal of other converters receive a data frame with a CAN ID of 0x201 from the Modbus side.