Share this

LabVIEW-based automation control and programming design

2026-04-06 06:57:07 · · #1
Abstract: This paper introduces three methods for automated instrument control in the LabVIEW programming environment, based on the requirements of experimental measurement data and the conditions of the instrument itself, under the LabVIEW virtual instrument development platform. The paper focuses on two methods: buffered acquisition and real-time acquisition, and provides examples. Using LabVIEW to control the automated data acquisition of instruments not only facilitates accurate recording, display, and storage of data, but also allows for real-time data processing using LabVIEW's powerful data processing capabilities. This enables curve fitting, calculation to obtain parameters and results, and intuitive acquisition of desired physical quantities. Practice has proven that these methods are simple, practical, and efficient, making them an excellent approach for integrating experimental data acquisition, processing, and analysis. Keywords: Virtual instrument; Automated control; Data acquisition 1 Introduction There are many development environments for virtual instruments (VI), but NI's LabVIEW is the most well-known. Unlike text-based programming languages ​​(such as Fortran and C), LabVIEW is a graphical programming language—often called G programming language—where the programming process describes program behavior through graphical symbols. LabVIEW uses terminology familiar to scientists and engineers and employs easily recognizable graphical symbols for constructing the G language, making it easy for even those with little programming experience to learn. In experimental physical quantity measurement, precise and real-time measurements of various parameters are desirable. For measuring rapidly changing physical quantities, it is necessary to utilize the instrument's built-in buffer memory or use a computer for automated instrument control. Most experimental instruments now provide computer interfaces, allowing for automated control of instrument data measurement, data storage, and basic data processing and analysis via various interfaces. In programming, the software uses the powerful virtual instrument programming software LabVIEW, along with some basic instrument driver functions downloaded from the internet. The program primarily implements two functions: real-time continuous data acquisition and display, and buffered acquisition of specified data. 2 Program Design 2.1 Classification and Characteristics of Acquisition Methods Based on different measurement requirements, control methods are classified into three types: buffered acquisition, real-time acquisition, and timed acquisition. These three methods can meet the requirements of general experimental data acquisition. (1) When the experiment requires acquiring the measured data as quickly as possible under the conditions allowed by the instrument, the instrument’s own buffer memory should be used to collect a large amount of data and display it on the computer. Only by acquiring data quickly can the changes of physical quantities in a short period of time be reflected. (2) Real-time acquisition refers to the simultaneous acquisition and display of data. This allows for a direct view of the changes in the measured physical quantity. It does not have high requirements for data rate. The main part of the program is data processing and display. User control parameters include the number of screen displays and the data acquisition time interval. If the frequency of changes in the acquired physical quantity is too fast, the interface is limited by the data transmission rate, and the computer is limited by the processing power, so real-time acquisition cannot truly display the changes in data and cannot be used. Therefore, when the changes in the physical quantity acquired in the experiment are not very large, real-time acquisition is used. The results are more intuitive and easier for the experimenter to grasp the overall trend of the experimental data and display the dynamic curve of the data. (3) Timed data acquisition is also very common and important. Generally, it is desirable for the instrument to acquire a segment of data within a specified time. 2.2 Program Flow Three program flows are: (1) Real-time acquisition: The instrument is controlled to collect data in real time. After each data point or set of data is obtained, it is transmitted to the computer through the interface between the instrument and the computer and displayed. Users can observe some phenomena of the current experiment based on these real-time data and save the current data. (2) Buffer acquisition: When the experimental instrument itself has a memory, the instrument parameters are set, the collected data is put into the memory, and then the data is transmitted to the computer through the interface between the computer and the instrument. The computer controls the instrument to pause acquisition and proceed with the next step of data processing and analysis. If the experimental instrument itself does not have a memory, in order to improve the acquisition speed, the raw data is directly put into the array function without considering the data processing. When a certain amount is reached, it is put into the file for storage processing. (3) Timed data acquisition: A time judgment statement is added to the program. When the set acquisition time arrives, the buffer acquisition (or real-time acquisition) data program is called to collect and store the data. The following mainly introduces buffer and real-time acquisition. When programming, the instrument parameters can be set according to the instrument's programming manual. 2.2.1 Data Buffer Acquisition First, at the start of the program, the given prompt message ("Please Waiting…") is displayed on the panel, indicating that the program has started and the user should wait. Then, various parameters of the instrument buffer are set, such as the acquisition volume and the number of data to be stored. After the data acquisition and storage are complete, the data is read from the buffer and transmitted to the computer through an interface (such as GPIB) for display of data and graphs. Finally, the instrument panel displays the acquisition completion message ("Transmission has been done!"), restores the initial display of acquired data, and places the obtained data into a table. Data graphs are displayed using LabVIEW's WAVEFORM GRAPH control. The main program flowchart is shown in Figure 1. [align=center] Figure 1: Main Flowchart of Data Buffer Acquisition[/align] 2.2.2 Real-Time Data Acquisition Real-time data acquisition is similar to data buffer acquisition. First, the basic instrument parameters are set, and then the programs controlling the display of two sub-functions are edited: StrChangeData and ScrDisplay. After setting the instrument acquisition type, accuracy, and other parameters, the instrument panel information is read, the obtained data is analyzed, and the dynamic display of data and graphs is controlled by setting parameters through the program. The main program flow is shown in Figure 2. [align=center] Figure 2: Main flow of real-time data acquisition[/align] Sub-function introduction: StrChangeData converts a string containing measurement data, measurement units, and other information into actual data. ScrDisplay adjusts the displayed data and graphics in real time according to user-set parameters (number of screen displays, etc.). ⑴, StrChangeData sub-function: [align=center] Figure 3: StrChangeData sub-function[/align] Reads the measurement information string from the panel according to the commands in the instrument programming manual. The string generally contains the data size, data unit level, and data unit. The string is concatenated into a judgment statement. According to the instrument range, there are 5 possible cases in the judgment statement: " " represents the basic unit; "m" represents 10-3; "µ" represents 10-6; "n" represents 10-9; "p" represents 10-12. Then it is multiplied by the data converted from the data string to obtain the actual data. The sub-function is shown in Figure 3. (2) ScrDisplay subfunction: Data display is important here. The number of screen displays and the size of the data array need to be compared. There are three cases: (1) If the number of screen displays is greater than the size of the data array, it means that the data has not been fully collected. The newly collected data is put directly into the array. (2) If the number of screen displays is equal to the size of the data array, the data needs to be refreshed. First, remove the first data in the array, move all data forward, add new data, and finally refresh the display graphics. (3) If the number of screen displays is less than the size of the array, it means that the user has readjusted the number of data displayed in the graphics. First, delete the redundant data in front of the array (array size - number of screen displays + 1), move the remaining data forward, add the newly collected data, and finally refresh the display graphics. 3 Test examples, results and discussion In actual experiments, multiple instruments are often involved in simultaneous data collection. The data collection flowchart and program architecture of each instrument are almost the same, only the internal instructions of the instruments are different. Therefore, the above method can be used to control several instruments to collect data at the same time with one program. In the experiment, Keithley's 6517 and 2000 instruments were used for real-time data acquisition. Both instruments have GPIB ports, allowing simultaneous data acquisition and transmission. Below is the background noise of the current (measured by 6517) and voltage (measured by 2000) measured in the early stages of the experiment. [align=center]Figure 4: Experimental Test Program[/align] In the experiment, the single data acquisition time for both the 6517 and 2000 was set to 1 second, and the number of graphs displayed was set to 50. This allowed for simultaneous real-time acquisition of two data streams (current and voltage values), with the data dynamically displayed in the graphical controls and data lists, and stored in a specified file. 4 Conclusion There are many application software programs for real-time data acquisition, ranging from serial ports to high-speed GPIB ports. However, these are often specific to a particular hardware or test system, and there are very few articles discussing the overall data acquisition architecture. Now, with the full range of instrument functions and the improvement of computer data processing speed and interface data transmission speed, automated control of experimental instruments not only reduces workload and human error, but also integrates data acquisition and data processing, allowing for intuitive acquisition of measured physical quantities. At the same time, the data processing capabilities of LabVIEW software can be used to flexibly analyze and process data in real time. The innovations of this paper are: (1) It discusses several software control methods for data acquisition, solving the overall design of general data acquisition. (2) The software is structured and can be made into DLL files and sub-functions. For different instruments, as long as the instrument driver parameters are modified, the others can call the same sub-functions or DLL files, which greatly facilitates the writing of laboratory instrument measurement and control software. (3) The data is directly stored in the database, which facilitates data management and use. It is significantly better than the traditional data acquisition. (4) According to the requirements of experimental measurement or time, buffer acquisition, real-time acquisition and timed acquisition can be designed. If the interface allows, multiple instruments can also be controlled to acquire data simultaneously in real time through multiple channels. References Bi Hu, Lü Fangcheng, Li Yanqing, Li Heming. Several different methods for accessing databases in LabVIEW. Microcomputer Information, 2006, 1-1: 131-134. Wu Miao, Xu Jiangning, Miao Xiuhua, Ji Bing. Research on device driver development technology based on LabVIEW. Microcomputer Information, 2006, 2-1: 153-155. Mao Jiandong. Design of a single-chip microcomputer data acquisition system based on LabVIEW. Microcomputer Information, 2006, 3-2: 41-42. Zhou Weilin, Li Qingfeng, Yang Huayong. Driver for AC1077 data acquisition card based on LabVIEW. Microcomputer Information, 2006, 1-1: 121-123.
Read next

CATDOLL CATDOLL 115CM Shota Doll Kiki Male Doll (Customer Photos)

Height: 115cm Male Weight: 19.5kg Shoulder Width: 29cm Bust/Waist/Hip: 57/53/64cm Oral Depth: 3-5cm Vaginal Depth: N/A ...

Articles 2026-02-22