In the design of function test bench for XLM oil pump bracket produced by an Automotive Electronics Co., Ltd. in Xi’an, there is a function test for TSG. The test content requires the resistance voltage sampling and the liquid level height to be one-to-one correspondence. It is difficult to ensure the reliability of acquisition by using traditional acquisition methods. Based on the design requirements, this paper proposes a data transmission technology based on LabVIEW FPGA, which can ensure the stability and reliability of data transmission under the premise of high-speed sampling.
1. Data transmission
Data transmission technology is mainly used in the field of multi machine communication. In the process of data exchange, special transmission rules are formulated to ensure the stable and reliable transmission of data. The transmission process is also different according to the physical medium. Specifically, it can be divided into the following categories:
1.1 baseband, frequency band and digital data transmission
① Baseband transmission refers to the transmission mode of binary “1” data transmission or “0” electrical signal directly sent to the circuit by data terminal equipment (DTE). Without modulation, baseband signal can be directly transmitted after code transformation (or waveform transformation).
② Most of the transmission channels are band-pass, but baseband signal cannot pass through. The baseband signal is modulated to the channel bandwidth by modulation method, and then the baseband signal is restored by demodulation method at the receiving end, which is called band transmission.
③ Digital data transmission is a way to transmit data signal by using digital voice path.
Parallel transmission and serial transmission
① Parallel transmission is a way of transmitting binary codes of characters simultaneously over parallel channels.
② Serial transmission is a way that the binary code of characters is transmitted bit by bit in a channel according to the time sequence. Although the speed is slow, but only one transmission channel is needed, which is small investment and easy to realize. It is the main transmission mode of data transmission. It is also a main way of computer communication.
1.3 asynchronous transmission and synchronous transmission
① Asynchronous transmission is a way of character synchronous transmission. When sending a character code, a “start” signal with a length of 1 symbol width and polarity of “0” is added in front of the character, that is, the space polarity; and a “stop” signal with the length of 1, 1.5 or 2 code element width, and the polarity of “1”, that is, the signal transmission polarity. By detecting the start and end signals, the receiver can distinguish the transmitted characters. Characters can be sent continuously or separately. When characters are not sent, stop signals are sent continuously.
② Synchronous transmission is bit (symbol) synchronous transmission. In this way, precise bit timing signals must be established between the receiver and the transmitter in order to distinguish each data signal correctly. In transmission, the data is divided into groups (or frames). A frame contains multiple character codes or multiple independent symbols. Before sending data, the specified frame synchronization code sequence must be added at the beginning of each frame. After the receiver detects the sequence mark, it determines the beginning of the frame and establishes synchronization between the two sides. The receiver DCE extracts bit timing signal from the received sequence to achieve bit synchronization.
1.4 simplex, half duplex and full duplex transmission
Simplex transmission means that data can only be sent and received in a single direction; half duplex transmission means that data can be transmitted in two directions but not simultaneously, that is, alternately receiving and transmitting; full duplex transmission means that data can be transmitted in two directions at the same time, that is, receiving and sending at the same time. Generally, four wire lines are full duplex data transmission, and two line lines can realize full duplex data transmission.
2. Reuse technology
Multiplexing technology refers to the process of synthesizing multiple channels on the transmission path, and then restoring the original mechanism or removing the multiplexing technology of each channel at the terminal
Frequency division multiplexing (FDM): the carrier bandwidth is divided into several sub channels with different frequency bands, and each sub channel can transmit one signal in parallel. FDM is used to simulate the transmission process.
Time division multiplexing (TDM): the transmission of multiple signals on the same channel within the interactive time interval. TDM is widely used in digital transmission process.
Code division multiplexing (CDM): each channel is used as a coding channel for bit transmission (specific pulse sequence). This encoding transmission is accomplished by transmitting a unique time series of short pulses, but in a longer bit time, time segments are used instead. Each channel has its own code, and can be transmitted and asynchronously demultiplexed on the same fiber.
Wavelength division multiplexing (WDM): the simultaneous transmission of multiple optical signals using different wavelengths on a single fiber. WDM is used for fiber channel. WDM is based on the same principle as FDM, but it is applied to optical wave transmission over optical fiber channel.
Coarse wavelength division multiplexing (CWDM): an extension of WDM. Each fiber carries four to eight wavelengths, or more. It is applied to medium-sized network system (regional or metropolitan area network).
Dense wavelength division multiplexing (DWDM): an extension of WDM. Typical DWDM systems support eight or more wavelengths. The display system supports hundreds of wavelengths.
In data communication, the use of multiplexing technology greatly improves the transmission efficiency of the channel, and has been widely used. Multiplexing technology is to combine the multi-channel signals at the sending end, then transmit them on a dedicated physical channel, and then separate the composite signals at the receiving end. Multiplexing technology is mainly divided into two categories: frequency division multiplexing (FDM) and time division multiplexing (TDM). WDM and statistical multiplexing also belong to these two multiplexing technologies in essence. In addition, there are some other multiplexing technologies, such as code division multiplexing, polarization wave multiplexing and space division multiplexing.
3. Network based transmission
Network based transmission is generally divided into TCP / IP transmission and UDP transmission.
UDP is a simple datagram oriented transport layer protocol: each output operation of a process generates exactly one UDP datagram, and assembles it into an IP datagram to be sent. The UDP datagram is encapsulated into an IP datagram in the format shown in Figure 1.
UDP does not provide a reliable connection: it sends data from applications to the IP layer, but does not guarantee that they will reach their destination.
Both TCP and UDP use the same network layer (IP). TCP provides a reliable connection oriented byte stream transport layer service. As shown in Figure 2:
TCP provides a completely different service to the application layer than UDP. TCP provides a connection oriented and reliable byte stream service. TCP packages user data into message segments; it starts a timer after sending data and waits for peer data confirmation; the other end confirms the received data, reorders the out of order data and discards duplicate data; TCP provides end-to-end flow control, and calculates and verifies it.
Connection oriented means that two applications using TCP (usually one client and one server) must establish a TCP connection before exchanging data with each other. This process is similar to making a phone call. First dial the phone and ring, wait for the other party to pick up the machine and say “hello”, and then explain who it is. TCP transport protocol connection process:
First, the connection is established. TCP uses three message segments to complete the connection. This process is also known as a three-way handshake. As shown in Figure 3.
It takes four handshakes to terminate a connection. As shown in Figure 4.
Data transmission must be confirmed by the receiver, and there are protection mechanisms such as timeout retransmission. This is the fundamental reason why TCP transmission has certain guarantee, as shown in Figure 5.
It can be seen that in addition to completing the connection and terminating the connection, at least one data packet and one ACK packet are required to complete a data transmission.
UDP and TCP provide different transmission methods and different transmission quality. TCP provides transmission guarantee by increasing network overhead. In the actual test of GPRS network, when the network is normal, from GPRS DTU to GPRS network to Internet to user data center, the UDP transmission effectiveness is 99%, and the TCP transmission effectiveness is about 100%.
4. Data transmission based on LabVIEW FPGA
Data transmission based on LabVIEW FPGA is an improved way based on TCP / IP. As shown in Figure 6.
This method is mainly used in the communication between c-rio system based on FPGA and upper computer to ensure the reliable transmission of underlying data. Its technical feature is that the data structure is carried out from the bottom layer of FPGA, that is, the general data type (such as fixed-point type and floating-point type) is converted to the Boolean data type recognized by the computer bottom layer for data construction, as shown in Figure 7.
When the data is transmitted to the RT layer, the high-speed data stream of FPGA is identified and converted to the data format that can be transmitted by the upper computer through the process of data analysis, as shown in Figure 8.
In order to ensure that the data is not lost, the RT packaging process adopts the mode of reconnection and data residual clearing to ensure reliable data transmission during each reconnection process. The receiving process of upper computer is shown in Fig. 9.
When the data is transmitted to the upper computer, the different data types are analyzed according to the packet header, and the data reconstruction is carried out according to the structure data type. The process is shown in Figure 10.
FPGA data transmission based on LabVIEW is mainly used for high-speed data stream transmission, which is an improved transmission mode based on TCP / IP. At present, it has been successfully applied in the transformation project of XLM production line function test bench produced by an Automobile Electronics Co., Ltd. in Xi’an. The project requires high-speed and reliable sampling and transmission of resistance voltage in the process of motor operation. The data transmission method based on LabVIEW FPGA solves this problem well. At present, the equipment runs well.
Editor in charge: GT