LabWindowsCVI Application in Wind Tunnel Data Acquisition

Author: Yang Da-cheng (Beijing Branch of the Office of Global China Control Technology Co., Ltd. Chengdu, Chengdu 610031)

Abstract: This article describes the use of LabWindows/CVI development environment to provide powerful tools and rich function interface and a variety of convenient and practical tools to quickly complete the wind tunnel data acquisition and analysis software. Describes the implementation of several key features used in the software.
Keywords: LabWindows/CVI, Wind Tunnel, SCXI, PXI, Multithreading.

LabWindows/CVI appiacation in the acquisition of the Wintunnel
Yang Da-cheng
(Beijing Zhong Ke Fan Hua Measurement & Control Technology Co. Ltd. Chengdu ReoPOffice, Chengdu 610031)
Abstract: Completed the acquisition and analysis of the windtunel quickly with the powerful tools and functions in LabWindows/CVI. Descript how to implement these important functions.
Key words: LabWindows/CVI; Windtunnel; SCXI; PXI; Multithread

Today, the development platforms used to develop software systems in the field of measurement and control are: LabVIEW, C++, VB, Agilent VEE, LabWindows/CVI. The LabWindows/CVI has been favored by many users because of its rich function library and various convenient functions. LabWindows/CVI is an ANSI C-based development platform developed by National Instrument Inc. It integrates compilers, connectors, and advanced editing and debugging tools. Built-in powerful instrument library, from instrument control, data acquisition to data analysis and image display. LabWindows/CVI comes with code generation, interactive function panels, function prompts, and quick control lookups to help developers quickly develop.
Wind tunnel data collection mainly includes pressure, temperature, and day equal signals.
1 System Configuration In this system, the hardware products of National Instrument PXI-6052E data acquisition card and SCXI-1143 signal conditioning card are mainly used. The system adopts the IPC plus remote control module and the structure is as follows:


The main functions of the software include hardware parameter settings, acquisition parameter settings, time domain signal analysis, frequency domain signal analysis, zero point processing, and sensor calibration. The software flow chart is as follows:


2 Software function implementation
2.1 main interface design
LabWindows/CVI has a user interface editor that provides various controls such as: numeric controls, string controls, waveform controls, Tabs, Tables, and so on. Using automatic code generation tools can help developers quickly create user interfaces and corresponding callback functions. The main interface of the program is as follows:


2.2 Thread Considerations The entire software uses multi-threaded mode, the main thread is used to manage the user interface, and a separate collection thread is created in the main thread for collecting and saving data. Here mainly uses the thread function that LabWindows/CVI provides to be able to establish, manage the thread conveniently.
errorCode=CmtScheduleThreadPoolFunctionAdv(DEFAULT_THREAD_POOL_HANDLE,DAQThreadFunction, NULL, THREAD_PRIORITY_NORMAL, NULL,(unsigned int)NULL, NULL, (unsigned int)NULL, &DAQThreadID); This function is used to create a collection thread. DAQThreadFunction is a custom thread function. For data acquisition and data storage.
errorCode = CmtReleaseThreadPoolFunctionID (DEFAULT_THREAD_POOL_HANDLE, DAQThreadID); This function is used to release the thread.
2.3 Data Acquisition
Based on the system architecture of PXI+SCXI, a channel of PXI-6052E is used to control all channels of SCXI during data acquisition. Taking into account the number of channels, set the parameters, need to wait for enough time to collect and other characteristics, so that when the hardware initialization will take more time, so the acquisition program does not put the initialization hardware into the thread function, specifically listed in the function . This ensures that the required test data can be obtained after the start of acquisition and after the required waiting time.
In this software, NI's early data acquisition card driver, Traditional DAQ, was used. Buffer technology is used to achieve continuous data acquisition.

errorCode = DAQ_DB_Config (config.daq[0].iDevice, 1); configure buffer mode; errorCode = DAQ_DB_HalfReady (gHardwareConfig.daq[0].iDevice, &halfReady, &DAQStop); check the buffer is full, start reading after the buffer is full Data; if((halfReady == 1) && (DAQStop == 0)) {

errorCode = DAQ_DB_Transfer (gHardwareConfig.daq[0].iDevice, pdsVoltBuffer, &points, &DAQStop);
If(errorCode != 0)
Goto error;
} Read buffer data.
2.4 Database Function The database function mainly uses the database connection toolkit provided by LabWindows/CVI. The toolkit provides a wealth of database manipulation functions that bring convenience and speed to development. The link diagram of LabWindows/CVI and database connection is as follows:

Hdbc=DBConnect (MD_DATABSE_NAME); establishes a connection with the database. The parameters are the string consisting of the database name, user ID, and password. Hstmt=DBActivateSQL (hdbc, string); Activate the SQL statement. DBPutRecord (hstmt); refresh the database. DBDeactivateSQL (hstmt); Deactivate the active SQL statement. DBDisconnect (hdbc); disconnects the database connection.

2.5 Signal Analysis Inside LabWindows/CVI comes with commonly used signal analysis and processing functions, which can be used for common time domain signals, frequency domain signal processing, and digital filter processing.
In this program, time domain signal processing mainly uses Convolve, Integrate, and Difference. Frequency domain signal processing uses FFT. There is a configurable dialog box at the digital signal that allows the user to configure the filter parameters.


Conventional mathematical processing functions are also useful in this program. They all use the mathematical functions that LabWindows/CVI brings, such as basic arithmetic operations of waveform data, Add1D, Sub1D, Mul1D, and Div1D.
3 Test report After the test is completed, a Word or Excel report is generated according to the requirements of the test. There is no need to manually edit the report, saving a lot of time. This is also a report generation toolkit provided by LabWidnwos/CVI. This toolkit contains a number of simple and useful functions that can automatically generate histograms, pie charts, etc. You can also automatically insert the waveforms displayed on the panel into the specified positions.
4 Conclusion Through the use of LabWindows / CVI to provide a variety of controls to quickly build a good user interface, but also use a variety of rich functions and toolkit functions provided by the perfect and rapid completion of the entire program development. In a short period of time, it is ensured that the development will be smoothly carried out in accordance with the established plan and the development task will be successfully completed.
references:

Song Yufeng. LabWindows/CVI Step-by-Step Deeper and Development Example National Instrument. LabWindows/CVI Basics I Course Manual National Instrument. LabWindows/CVI Basics II Course Manual