Network communication mechanismBasic Concepts:Device IP address, destination IP
Each network device located under the LAN has its own IP address, which is used to indicate its own node in the LANusers in the use of PC and network equipment to communicate before, you need to ensure that the user's PC has Ethernet, and the PC and network communications equipment to be in the same network segment. Determine if the device and PC are in the same network segment by the following method.
Communication mode:TCP Server, TCP client, UDP mode
Both the so-called TCP server mode and client mode are for the device itself. For example, setting the operating mode of the Canet-e-u device in the Znetcom software isTCP Sever, and set the IP address and working port of the device. This means that the CANET-E-U device acts as a TCP server, and for a TCP server, it only needs to let the client know its IP address and working port, and then the TCP client can initiate the connection through the server's IP and work port to establish data communication. When using Can-test software to receive CANET-E-U device data set to TCP server mode, select "Device Type" as CANET-TCP and set the property to:
At this point can-test acts as aTCP Client(The so-called use of can-test software to display devices such as can card data, is actually the PC host and these devices communication,if the PC host needs to be in the same network segment as the CANET-E-U device), you can accept data from a TCP server by simply setting the IP address and working port of the TCP server you want to connect to.
If the operating mode of the CANET-E-U device is set in the Znetcom software,TCP Client, when the Canet-e-u device acts as a TCP client, in order to use it to communicate with the PC host, you need to set the target IP and destination port in the znetcom in addition to the IP address, the work port. That is, the client needs to indicate the location of the server on the network (that is, the destination IP and the destination port) that needs to be connected, and note that this is different from the CANET-E-U device acting as a TCP server. When you want to can-test software to receive data, you need to set it toServer Mode, you need to enter the native port, this native port is the target port set for the TCP client in znetcom, so the network communication is established.
If the operating mode of the CANET-E-U device is set in the Znetcom software,UDP, the CANET-E-U device does not need to establish a connection with other devices in the network and can communicate in two directions directly. At this point, you need to set its IP address and working port in the Znetcom software for the canet-e-u device, and you need to set the destination IP and destination port (up to 6 hosts) that need to be sent to the other host. If you want to see the data in the Can-test software, you need to select the device type CANET-UDP, the same first need to ensure that the native IP and canet-e-u device IP address in the same network segment, Then fill in the following window in the local port (that is, with znetcom for the CANET-E-U device set the target port, we are using can-test software on this port to hear the canet-e-u device sent over the data).
On the meaning of the native port, you can help understand through the network debugging assistant, when using Netassitant software to receive network data, if you choose a protocol type of UDP, you need to set the local IP address and local port number, where the local IP address is the target IP canet-e-u device settings, Generally, the default setting of the cost machine IP address, sometimes need to manually set, the local port number is the target port of the Canet-e-u device settings, that is, to listen to the data on this port, click the "Connect" button, if the data is normal, you can display the network data sent over.
can communication mechanism Basic Concepts:Can data frame, can baud rate termination resistor,