CANFDNET-400U
High-Performance Four-Channel CANFD Bus-to-Ethernet Converter User Manual
©2021 Guangzhou ZLG Electronics Technology Co.,Ltd.
42
User Manual
7. Providing the Secondary Development Guidance for the
Host Computer
Use one of the following methods for the CANET-8E-U host computer
(communication) development:
Application programming interface functions using CAN cards (both 32-bit and
64-bit).
Directly use the standard TCP programming interface API to establish a Socket
connection.
The difference between these two methods is mainly reflected in the data format
received by the host computer. At the same time, when a frame ID is 0 and the data is a
standard data frame of 00 01 02 03 04 05 06 07. The display difference between the two is
as follows:
Figure 7.1 Data format displayed by the host computer when the CAN card interface function is used
If the first method is used, the CAN card interface functions will be listed in the format
of ID, data, etc., as shown in Figure 7.1.
Figure 7.2 Data format displayed by the host computer when using the Socket function
If the second method is used, the received data format is shown in Figure 7.2. For the
same data, the Socket link will only display 13 bytes of data (for the specific meaning, see
Section 8.1); follow the rules to write a program for analysis.
If you choose the first method, ZLG Electronics provides 32-bit and 64-bit CAN card
application programming interface functions to support most mainstream development
environments; it provides demonstration codes for users to learn and develop. For the
development process of this method, see Sections 7.1 and 7.2.
7.1 Preliminary Preparation for CAN Card Interface Function
Development
If you are going to start designing your own PC software, you are advised to prepare
the following documentation first. The documentation can be obtained from the product
documentation download page at ZLG Electronics' official website:
CAN Test software and Interface Function User Manual;
Secondary development interface function library for the CAN interface card;
CANET-8E-U host computer routine.
The
CAN Test Software and Interface Function User Manual
mainly introduces CAN
card type definition, function library data structure definition, and interface library function
usage and parameters.