In the field of industrial automation, differences in communication protocols between different devices often become obstacles to data transmission. Chengdu Ebyte Electronics Technology Co., Ltd.'s independently developed EID091-A701-S series CANFD to serial port modules and EID091-A701-SC series CANFD to serial port module test kits, with their superior performance, rich functionality, and wide compatibility, have become ideal choices for solving industrial communication problems. This article will provide an in-depth introduction to the transparent conversion mode, transparent conversion mode with identifier, protocol mode, Modbus protocol conversion mode, and custom protocol conversion mode of the EID091-A701-S and EID091-A701-SC series CANFD to serial port modules.

I. Transparent Conversion Mode of CANFD to Serial Port Module

Transparent Conversion: The converter converts bus data of one format to another bus data format as is, without adding data or modifying the data. This achieves data format exchange without changing the data content; for both buses, the converter is "transparent," hence the name transparent conversion.

1. Serial Frame to CAN(FD) Message:

All data from the serial frame is sequentially filled into the data field of the CAN(FD) message frame. The module receives and converts data immediately upon detecting it on the serial bus. The converted CAN(FD) message frame information (frame type) and frame ID are derived from the user's pre-configuration, and the frame type and frame ID remain unchanged throughout the conversion process.

2. CAN(FD) Message to Serial Frame:

During conversion, all data in the CAN(FD) message data field is sequentially converted into the serial frame. If "Enable Frame Information" is selected during configuration, the module will directly fill the "Frame Information" byte of the CAN(FD) message into the serial frame. If "Enable Frame ID" is selected, the "Frame ID" byte of the CAN(FD) message will also be filled into the serial frame.

Note: To receive CAN(FD) frame information or frame IDs on the serial interface, the corresponding function must be enabled.

II. CANFD to Serial Port Module Transparent Identifier Conversion Mode

Transparent identifier conversion is a special application of transparent conversion. It includes the ID information of the CAN(FD) message in the serial frame, allowing the transmission of CAN(FD) messages with different IDs as needed. This facilitates users in easily building their own networks and using custom application protocols. This method automatically converts the ID information in the serial frame into the frame ID of the CAN(FD) bus. Simply specify the start position and length of this ID information in the configuration, and the module will extract this frame ID and fill it into the frame ID field of the CAN(FD) message, using it as the ID for the CAN(FD) message when forwarding the serial frame. The CAN(FD) message ID is also converted to the corresponding position in the serial frame during the conversion of the CAN message into a serial frame.

1. Serial Frame to CAN(FD) Message Conversion:

The start address and length of the "frame ID" of the CAN(FD) message in the serial frame can be set by configuration. The starting address ranges from 0 to 7, and the length ranges from 1 to 2 (standard frame) or 1 to 4 (extended frame). During conversion, according to the pre-configured settings, all CAN(FD) message "frame IDs" in the serial frame are converted to the frame ID field of the CAN(FD) message (if the number of frame IDs is less than the number of frame IDs in the CAN(FD) message, the high byte of the frame ID in the CAN(FD) message is padded with 0s). Other data is converted sequentially. If a CAN(FD) message does not completely convert the serial frame data, the same ID is used as the frame ID of the CAN(FD) message to continue conversion until the serial frame conversion is complete.

Note: If the ID length is greater than 2, the frame type sent by the device will be set to extended frame. In this case, the user-configured frame ID and frame type are invalid, and the data in the serial frame determines the frame type. The frame ID range for standard frames is 0x000-0x7ff, represented as frame ID1 and frame ID0 respectively, where frame ID1 is the high byte. The frame ID range for extended frames is 0x00000000-0x1fffffff, represented as frame ID3, frame ID2, frame ID1, and frame ID0 respectively, where frame ID3 is the high byte.

2. CAN(FD) Message to Serial Frame Conversion:

For CAN(FD) messages, each received frame is immediately forwarded. During each forwarding, the ID in the received CAN(FD) message is converted according to the pre-configured position and length of the CAN(FD) frame ID in the serial frame. Other data is forwarded sequentially. It is important to note that whether using serial frames or CAN(FD) messages, the frame format (standard frame or extended frame) must conform to the pre-configured frame format requirements; otherwise, communication may fail.