LabVIEW enables remote data acquisition and transmission.
2026-04-06 05:10:12··#1
Abstract: This paper describes the working method of data transmission in combination with TCP/IP protocol on the NI LabView platform, and gives a simulation example of data acquisition, transmission and monitoring in industrial field. Keywords: TCP/IP; virtual instrument; LabView 1. Introduction In modern instrument systems, computers have been closely integrated with instruments and have become the core of the entire system. Many traditional instruments are gradually being replaced by computers, or even completely. Roughly speaking, there are two ways of this integration: one is to install the computer into the instrument; the other is to install the instrument into the computer, that is, to rely on general computer hardware and operating system to realize various instrument functions. Virtual instruments mainly refer to this method, which is essentially a data acquisition system organized according to the needs of the instrument. LabVIEW of NI is currently the most widely used computer language in this field. With the development of computer networks, the combination of virtual instruments and Internet technology provides a better implementation platform for the networking of virtual instruments and remote measurement and control in industrial field [1]. This paper introduces the implementation of a remote data acquisition and transmission system in combination with TCP/IP technology on the LabView development platform. 2. Introduction to LabView LabView is widely used in data acquisition and control, signal processing and data expression. It provides a new programming method, namely, to perform graphical combination operations on the software object "Virtual Instrument (VI)" [2] [3]. The execution order of LabView programs is determined by the data flow, which can realize the parallel operation of multiple tasks. The LabView program consists of two parts: the front panel and the block diagram. The entire program is based on multi-threaded design, with the front panel and the block diagram each occupying one thread. The front panel is the graphical user interface of the LabView program. This interface integrates user input and displays the program output, which is equivalent to the panel of a traditional instrument. The block diagram contains the graphical source code of the virtual instrument program, programming control and defining the input and output functions on the front panel. In the design of virtual instruments, the required control and display objects are selected from the control template to build the operation panel of the instrument; appropriate functional modules are selected from the function template and necessary connections and settings are made to create the control block diagram and complete the functions that the designed instrument should have. The modularization and hierarchy of the program are more intuitive. 3. TCP Technology The TCP/IP protocol system is currently the most successful and most frequently used Intranet/Internet protocol [5]. As a popular industry standard, TCP/IP technology has good practicality and openness. It defines the Internet Protocol IP at the network layer, the Transmission Control Protocol TCP at the transport layer, the User Data Protocol UDP, and so on. Based on TCP/IP technology, various Web services can be built, such as SMTP for mail transmission, FTP for file transmission, and the use of the Hypertext Transfer Protocol HTTP to realize dynamic web page publishing [5] and web browsing. In data transmission, the TCP/IP network provides general network services, making specific network technologies transparent to users or applications, thereby freeing specific communication problems from network details and making network applications more flexible and convenient. In LabVIEW applications, we can directly call the TCP module to complete the process writing without having to consider the underlying implementation of the network too much. In terms of protocol structure, the TCP/IP system uses the IP protocol based on connectionless transmission, specifically manifested as IP addresses, to distinguish different data stations in the network. Two transmission modes are provided: Transmission Control Protocol (TCP) offers connection-oriented and reliable communication for applications that typically transmit large amounts of data or require permission to receive data; User Data Protocol (UDP) provides connectionless communication, typically used by applications that transmit small amounts of data instantly. Based on the IP protocol content and TCP message format (Figure 1), data transmission requires determining the IP addresses of each host and the source and destination port numbers, commonly referred to as sockets, thus achieving connection-oriented data communication based on port-to-port connections. Compared to other network protocols, TCP/IP's end-to-end transmission has two major advantages. First, TCP/IP is simpler and clearer than other protocols. It is easy to implement using a common interface. Second, TCP/IP is highly efficient. The IP protocol in TCP/IP uses a "best-effort" delivery method; only the TCP layer performs the necessary work to ensure transmission reliability. This working mode is highly efficient in a reliable physical network environment, and the end-to-end connection implemented by TCP effectively guarantees transmission accuracy. This paper uses TCP and IP protocols to implement the connection between each data acquisition point and the processing host. 4. Implementation of TCP Transmission in LabVIEW In LabVIEW, TCP communication can be implemented using the published TCP VI and related subroutines [4]. Beforehand, the TCP/IP protocol suite needs to be correctly installed on the computer being communicated. In Windows/Unix systems that are already connected to the Internet/Intranet, the TCP/IP protocol is built-in; if it is a newly connected computer system, it is necessary to ensure that TCP/IP is correctly installed and configured, and at the same time ensure that the source port/destination port required for communication is open. Since the implementation is to aggregate the data of each data point to the processing host, the design adopts a server/client communication mode. The VI program is divided into two parts: the processing host works in Server mode, completes data reception, and provides an interface for the relevant subsequent processing of the data; the data point computer works in Client mode to realize data transmission. The working mode is designed as follows: (1) The server host is in working state and listens to the communication port, waiting for the client to send a connection request; (2) The client computer opens a TCP connection; (3) The server host responds and establishes a data transmission channel; (4) The connection process judges network errors, and if there are any, the connection is interrupted; (5) Data transmission is completed using the VI module TCP read/write; (6) The connection is interrupted after the transmission is completed. The design process calls the VI function module based on TCP connection provided by LabVIEW as shown in Figure 2, which can be directly applied in blockdiagram. The following is a data transmission example designed according to this working mode. For general purposes, the data used by the client is generated by a sine wave generator. An error detection mechanism is introduced into the communication process, which can judge the errors in the transmission process, facilitate management, and also shield relevant network errors for different applications. [align=center] (Figure 3 Server-side flowchart) (Figure 4 Client-side flowchart)[/align] From the working situation, the Server can correctly receive the data from the Client and output it in real time. The working delay is only affected by the network conditions, indicating that this method successfully realizes the TCP transmission of data and can be fully applied to distributed field monitoring. [align=center] (Figure 5 Client working process panel display) (Figure 6 Server working process panel display)[/align] 5. Summary In remote measurement and control, due to the existence of multi-level dispersed data collection points, data collection and transmission usually require dedicated networks, which are costly. This method can effectively improve the utilization rate of resources and reduce application costs by utilizing the existing Intranet/Internet network. Furthermore, the connection-oriented transmission mode can better ensure the correctness of data transmission. Due to the use of an open protocol, the application can utilize LabVIEW's embedded Web Server to publish [3], making it convenient for engineers in various regions to understand the processing results. References: 1. Application of VI technology in distance education, [J/OL] http://www.haitai.com.cn/cn_zh/download/soft/VI2.doc 2. Liu Junhua, Virtual Instrument Design Based on LabVIEW, Electronic Industry Press [M], 2003 3. NI Corp, LabVIEW User Manual [M], USA, 1998 4. NI Corp, Using LabVIEW with TCP/IP and UDP [M], 2003 5. Andrew S. Tanenbaum, Computer Networks (Third Edition) [M], Tsinghua University Press, 2002