CANFDNET-400U
High-performance Four-channel CANFD Bus-to-Ethernet Converter User Manual
©2021 Guangzhou ZLG Microelectronics Technology Corp.,Ltd.
36
User Manual
Modbus RTU. In conversion, convert them in turn in the data field of the CANFD message
frame (starting from the second data byte, the first data byte is used by the segmentation
protocol). The length of the Modbus RTU frame varies according to the function code.
Because the first byte is used for segment identification, only seven pieces of data can be
transmitted in one frame of CAN message. A CANFD message can only transmit 63 bytes
of data in one frame. The converter will segment the longer Modbus RTU frame into
CAN(CANFD) messages and send them using the above-mentioned CAN(CANFD)
segment protocol. When you receive them on the CAN (CANFD) node, you can
reassemble the data according to the segmentation protocol, extract the function code,
and process the data field.
For the Modbus protocol data of CAN (CANFD) bus, there is no need to perform
cyclic redundancy check (CRC16), and the converter receives data by using the
segmented protocol. After receiving a frame, it will automatically add a cyclic redundancy
check (CRC16), convert data into a Modbus RTU frame and send it to the serial bus. If the
received data does not conform to the segmentation protocol, the group of data is
discarded without conversion.
4.4.3 Conversion Examples
When the CAN mode is configured and the frame type is set to extended frame, as
shown in Table 4.30, if the Modbus RTU frame is converted into a CAN message, the
address field 0x08 is directly filled into the frame ID0, and other frame IDs are filled with
0x00; that is, the CAN ID is 0x08. Keep this frame ID unchanged during the conversion of
this Modbus frame.
If the data in the function code + data field is less than 7 bytes, a single message can
be sent, as shown in Table 4.31. When one frame of CAN message cannot process one
frame of Modbus message, the CAN message adopts segmentation protocol.
The "data 1" of each CAN message is used to fill the segment information (0x81,
0xC2), which is not converted into the ModbusRTU frame, and is only used as the frame
format to confirm the frame information. The value of the function code and data field is
filled in the data 2-8 of the CAN message in turn.
The CANFD mode is similar to CAN, except that the segmented protocol is used to
divide the message when the data exceeds 63 bytes.
Table 4.30 Example of the mutual conversion format for the CAN extended frame communication frame
(Modbus mode segmented message)
Modbus RTU
frame
CAN
message
CAN message
1
CAN
message 2
Addres
s field
0x08
Frame
information
0x88
0x84
Functio
n Code
0x11
Frame ID3
0x00
0x00
Data
field
0x00
Frame ID 2
0x00
0x00
0x01
Frame ID1
0x00
0x00
0x00
Frame ID0
0x08
0x08