記事コンテンツ画像

In the application field of CAN bus communication

In the application field of CAN bus communication, many customers need to put the CANID in the CAN message, which is more convenient to connect to different devices, and it is beneficial for users to build their own network more easily through the module, and use a rs485 ethernet adapter self-defined application protocol. However, to achieve such an application, users often need to constantly modify the parameters, and the transparent belt identification function of the ECAN-401 developed by our company can handle this problem well. This method automatically converts the ID information in the serial frame into the frame ID of the CAN bus. As long as the module is told in the configuration that the ID information is at the starting position and length of the serial frame, the module extracts the frame ID and fills it in the frame ID field of the CAN message during conversion, as the CAN when the serial frame is forwarded. ID of the message. When the CAN message is converted into a serial frame, the ID of the CAN message is also converted into the corresponding position of the serial frame.

The starting address and length of the "frame ID" of the CAN message in the serial frame can be set by configuration. The range of the start address is 0 to 7, and the range of the length is 1 to 2 (standard frame) or 1 to 4 (extended frame). During conversion, the CAN message "frame ID" in the serial frame is correspondingly converted into the frame ID field of the CAN message according to the prior configuration (if the number of frame IDs carried is less than the number of frame IDs of the CAN message, then The high byte of the frame ID in the CAN message is filled with 0.), and other data are converted in sequence. If a frame of CAN message does not convert the serial frame data, the same ID is still used as the frame of the CAN message. The ID continues to convert until the serial frame conversion is complete.

If the ID length is greater than 2, the frame type sent by the device will be set to extended frame. At this time, the frame ID and frame type configured by the user are invalid, ethernet to rs485 converter and are determined by the data in the serial frame. The frame ID range of the standard frame is: 0x000-0x7ff, which are respectively represented as frame ID1 and frame ID0, where frame ID1 is the high byte, and the frame ID range of the extended frame is: 0x00000000-0x1ffffffff, which are respectively represented as frame ID3, frame ID2, Frame ID1, Frame ID0, where Frame ID3 is the high byte.

この記事をシェア