Signal acquisition and processing based on LabVIEW language

Publisher:知音学友Latest update time:2011-06-10 Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

1 Overview

Laboratory Virtual Instrument Engineering Platform (LabVIEW) is a graphical software specifically used for data acquisition, analysis and instrument control. The virtual instruments it develops combine the powerful data processing capabilities of computers with the hardware test control capabilities of instruments.

The graphical development environment of LabVIEW is accurate, efficient, powerful, easy to develop, real-time, and user-friendly. It provides users with powerful functions and flexibility, and is very suitable for simulation, real-time detection, and control. At present, LabVIEW has become one of the most widely used and promising software development platforms in the field of testing, and is also one of the most widely used, fastest-growing, and most powerful graphical software development integrated environments.

Virtual instruments can use high-performance modular hardware and combine efficient and flexible software to complete various tests, measurements and automation applications. Compared with traditional measuring instruments, they have the advantages of low cost, powerful functions, high integration, reliable quality, and easy maintenance. They can easily build test systems to meet various measurement requirements. Therefore, it is of great significance to develop signal acquisition systems based on virtual instrument technology and using LabVIEW language.

LabVIEW virtual instruments mainly consist of three parts: front panel, block diagram and icon/interface components.

The front panel is the interactive user interface of the VI, that is, the window where the user interacts with the program code. The VI front panel is a combination of controls and indicators. The controls simulate the types of input and output devices on conventional instruments, such as knobs and switches, and provide a mechanism to transfer input from the front panel to the basic block diagram.

The signal acquisition and processing system mainly uses the A/D (analog/digital) conversion function of the data acquisition card. The analog electrical signal collected by the acquisition end is converted into a digital signal through the data acquisition card using a high-speed analog-to-digital conversion circuit. The signal is then cached on the data acquisition card and finally the computer program is used to continuously extract data from the cache, store it in the computer, and perform relevant processing to extract useful data for hard disk storage.

The driver of the data acquisition card is written using LabVIEW language, and the signal analysis, processing and storage process is shown in Figure 1.

1.jpg


Figure 1. Overall flow chart of the signal acquisition and processing system. [page]

2 PCI-1714 data acquisition cards

Advantech's PCI-1714 is a high-speed 4-channel synchronous data acquisition card with a PCI interface. It can be used for high-speed data acquisition applications with a high cost-performance ratio. It is suitable for instrument testing, image processing, video digitization processing, sound and vibration testing, and other fields.

PCI-1714 is a high-speed, high-resolution, high-capacity PCI data acquisition card equipped with 4 analog inputs and synchronous acquisition function. Its features can be summarized as follows: a) Contains 4 independent ADCs (Analog-to-Digital Converters), which can sample 4 channels synchronously. When 4 analog inputs are used simultaneously, the sampling frequency can theoretically reach up to 30 MS/s. b) Each ADC has a built-in 32K FIFO memory, which provides users with sufficient buffer for temporary storage during high-speed sampling to maintain data acquisition speed and integrity. c) Provides a variety of input ranges, including ±5 V, ±2.5 V, ±1 V, ±0.5 V, etc. Users can easily complete the settings through the tool program. d) Up to 6 trigger modes, including software trigger, Pacer, Post-Trigger, Pre-Trigger, Delay-Trigger and About-Trigger trigger modes, which are convenient for customers to set according to their needs.

The structure of the general high-speed data acquisition system based on PCI-1714 is shown in Figure 2.

2.jpg
Figure 2 Structural block diagram of the high-speed data acquisition system based on PCI-1714.

The field signal to be monitored is filtered and sent to the PCI-1714 card. The A/D converter on the card performs high-speed analog-to-digital conversion on the signal. The converted data is first temporarily stored in the 32K onboard FIFO (first in first out) of the card. When the FIFO is half full or full, a DMA request is sent to the DMA (dynamic memory access) controller. Using direct memory access, the data is output from the FIFO to the internal buffer via the PCI (Peripheral Component Interconnect) bus. The PCI bus has a wide transmission bandwidth and can meet the high-speed data transmission requirements brought about by 4-channel high-speed synchronous sampling.

The internal buffer is a massive cache of the high-speed data acquisition system. Like the user buffer, it is two memory areas dynamically allocated to the driver by the data acquisition program. The difference is that the internal buffer stores the original values ​​​​taken from the FIFO, and the user buffer stores the converted voltage values.

When performing long-term high-speed data acquisition, PCI-1714 mostly uses a circular method. In this method, starting a collection process can perform countless A/D conversions. At this time, the internal buffer is divided into two equal halves, the front and back halves. When the front half is full, the data in this half is transferred to the user buffer, and the newly converted data is placed in the back half of the internal buffer. When the back half is full, the data in this half is transferred to the user buffer. At the same time, the newly converted data is automatically placed in the front half of the buffer that has already been transferred. The status of the FIFO buffer can be determined by querying the status of the status register, and the empty flag, half full flag, and full flag can be determined respectively.

The data in the internal buffer and user buffer can be saved in the computer in the form of files under program control, realizing permanent storage of collected data and facilitating later data analysis and processing. [page]

3 PCI-1714 acquisition card data acquisition program example based on LabVIEW language

The following is an introduction to the PCI-1714 acquisition card data acquisition driver written in LabVIEW language. This program can realize the continuous acquisition of external signal data of the sensor system and store useful data as needed.

Functionally, the program is mainly divided into three parts: a) Initialize the acquisition card and complete the setting of important working parameters of the acquisition card, such as user buffer, sampling rate (scan rate), input limit, etc. b) Perform data acquisition and storage of useful data, that is, put the data into the onboard buffer FIFO of the acquisition card first, then read the data in the onboard buffer by the computer, write it into the user buffer allocated from the computer's memory, and then store the useful data from the memory into the computer hard disk as needed. There can be many specific storage formats, and the subVIs included in this part include the data reading module, the data storage module, and the module for displaying the time domain graph of the acquired signal. c) Turn off the acquisition card after the acquisition is completed.

In order to use PCI-1714 for continuous high-speed data acquisition, it is necessary to reasonably set important parameters such as acquisition rate and user cache size. As mentioned above, the data acquisition card performs A/D conversion continuously, that is, the acquisition card puts data into the onboard cache continuously, and the computer reads data from the onboard cache FIFO and puts it into the user cache in batches when the FIFO is half full or full. At the same time, if data storage is to be performed, data is also written from the user cache to the hard disk in batches.

Since the size of the user cache is limited by the size of the computer's memory space and cannot be infinite, it can only be set as large as possible during use, generally about one-tenth of the memory. When maintaining a certain data sampling rate and the user cache is determined, if the data written to the hard disk in a single batch is too small during the storage process, the data cannot be read out from the user cache in time, resulting in an error of user cache overflow. When the data written to the hard disk in a single batch is too much, the data is read from the user cache too quickly, and an error of reading empty data may occur. Therefore, these parameters must be set in coordination with each other to enable the acquisition card to obtain good acquisition and data storage performance.

4 Data calling and processing based on LabVIEW

While completing signal acquisition using the above program, useful signals can be stored for subsequent analysis. The following example illustrates how to retrieve and analyze waveform data after storage.

This program can extract data stored in TXT format from a file and perform spectrum analysis. In the front panel of the program, the time domain waveform of the signal represented by a piece of data and the power spectrum waveform obtained by analyzing with the "FFT Power Spectrum" VI can be displayed at the same time.

Use LabVIEW language to write a program for calling out stored data and analyzing the characteristics of signal waveforms. This program can call out a monitoring signal with multiple channels from a storage file. The monitoring signals of different channels are different. According to the characteristics of the signal waveform, relevant methods can be selected for signal processing to analyze the changes in the monitoring environment corresponding to each signal. Using the "Call Library Function Node" module provided by LabVIEW, it is very convenient to embed the program written in C language into the LabVIEW program, and it can be encapsulated into a subVI for the main program to call. It is suitable for some applications where the programming efficiency of LabVIEW language is not high, and the subVI program is written using the "Call Library Function Node" module.

5 Conclusion

From the above analysis, it can be seen that the use of LabVIEW language can easily solve the relevant problems in the field of signal acquisition and processing. Whether it is the driver writing of the data acquisition card PCI1714, data storage, or the calling and analysis of data, the special VI provided by the language can be fully called, and a clear data flow can be obtained in the graphical language writing environment. Moreover, LabVIEW language also supports users' secondary development of VI, and can call programs written in other languages. It can also conveniently encapsulate the programs written by users into standard VIs for subsequent program calls, which greatly facilitates improving the efficiency of program writing and expanding program functions.

Keywords:LabVIEW Reference address:Signal acquisition and processing based on LabVIEW language

Previous article:Design and Application of Broadband Phase Measurement System Based on Microprocessor
Next article:Spinning Tension Monitoring System Based on LabVIEW and C8051F350

Recommended ReadingLatest update time:2024-11-16 21:02

Stepper Motor Control Based on LabVIEW
A stepper motor is an electromechanical element that converts an electrical pulse signal into an angular displacement or a linear displacement. It is widely used in industrial automation control, CNC machine tools, robots and other fields. In remote experimental systems, it is often necessary to use stepper motors to
[Test Measurement]
Stepper Motor Control Based on LabVIEW
LabVIEW 1.0 Programming Environment (Graphics and Text)
LabVIEW 1.0 was born in 1986. Do you want to see what LabVIEW looked like at that time if you have used LabVIEW 7.0 or above? Here are some screenshots of LV 1.0. I forgot where I got them, but they should be quite valuable.
[Test Measurement]
LabVIEW 1.0 Programming Environment (Graphics and Text)
Development and monitoring system of grid-connected photovoltaic equipment based on LabVIEW
  Challenge: Build a custom real-time monitoring system capable of evaluating the performance and characteristics of grid-connected PV systems using a variety of measurement devices in a short time and at a low cost.   Solution: Use the open NI LabVIEW software platform to design the monitoring system and dedicated in
[Test Measurement]
Realize quantitative testing and time-frequency analysis based on LabVIEW software and computer sound card
In the field of electronic measurement, signal generators and oscilloscopes are one of the most basic and widely used electronic measurement equipment. Their functions are to provide electrical signal sources that meet certain technical requirements for electronic measurement and to graphically display electrical sign
[Test Measurement]
Realize quantitative testing and time-frequency analysis based on LabVIEW software and computer sound card
In-depth exploration of LabVIEW - file series: writing spreadsheet files
There are many types of LABVIEW file operations. The simplest and easiest to use is WRITE TO SPREAD SHEET FILE (usually translated as writing a spreadsheet file). This so-called spreadsheet file is actually a text file, not a real spreadsheet file. A real spreadsheet file has a format. General text editors, such as NOT
[Test Measurement]
In-depth exploration of LabVIEW - file series: writing spreadsheet files
Analysis of the design principles of wireless monitoring remote medical system
   This paper introduces a wireless remote medical monitoring system based on GPRS technology. With SPCE061A as the main control chip, the data acquisition module and the GPRS communication module are combined to connect to the Internet wirelessly. The monitoring center receives the data and saves it in the database
[Medical Electronics]
Analysis of the design principles of wireless monitoring remote medical system
In-depth exploration of LabVIEW - basic types of state machines sequential structures
The previous article introduced the important concept of LV programming---state machine. State machine is a basic concept or theory. Its specific forms are too diverse and difficult to classify. Based on my personal experience in programming practice, I summarize several common types. 1. Sequential structure LV it
[Test Measurement]
In-depth exploration of LabVIEW - basic types of state machines sequential structures
Broken rotor bar detection of asynchronous motor based on LabVIEW
The broken rotor bar fault of cage asynchronous motor will lead to the deterioration of motor running performance and cause certain losses to production development. The probability of broken rotor bar fault is as high as 10%. Therefore, it is necessary to detect and warn in time at the early stage of fault developm
[Test Measurement]
Broken rotor bar detection of asynchronous motor based on LabVIEW
Latest Test Measurement Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号