5. Examples
The user can use the included serial debugging assistant to send Modbus instruction debugging.
Please note: choose “hexadecimal display” and “hexadecimal send” when using the serial debugging assistant.


5.1 Receive CAN data
For example, configure the Modbus slave address: 1, Modbus register first address: 0x01, CAN: standard frame, frame ID: 0x181, CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08.
User Modbus master sends request frame:
01 03 00 01 00 04 15 C9
GCAN-204 response frame:
01 03 08 02 01 04 03 06 05 08 07 17 C1
Please note that the CRC is calculated by the CRC16 checksum calculator. (With disk)
At this point, the GCAN-204 module has received a data frame with a frame ID of 0x181 from the CAN terminal of other equipment.
5.2 Transmit CAN data
For example, Modbus slave address: 1, Modbus register first address: 0x101 (decimal: 257), function code: 16 (10H), CAN: standard frame, frame ID: 0x201, CAN frame data: 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08.
User Modbus master sends request frame:
01 10 01 01 00 04 08 02 01 04 03 06 05 08 07 CB 2E
GCAN-204 response frame:
01 10 01 01 00 04 91 F6
Please note that the CRC is calculated by the CRC16 checksum calculator. At this point, the CAN terminal of other equipment has received a data frame with a frame ID of 0x201 from the Modbus side of the GCAN-204 module.