Design of Multi-purpose Virtual Voltmeter Based on LabVIEW 8.2

Publisher:咖啡小熊Latest update time:2012-07-04 Source: 21ic Keywords:LabVIEW Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

O Introduction

Virtual instrument is a new type of instrument developed with the development of computer technology, electronic measurement technology and communication technology. It makes full use of the powerful data processing and display capabilities of computer systems, uses software to complete data acquisition, control, data analysis and processing, and display of test results, etc. Through the coordination of software and hardware, it realizes various functions of traditional instruments, truly realizing the concept of "software is instrument", and users can easily maintain and expand the instrument.

Voltage is a common electrical signal in circuits. Other parameters can be derived from voltage measurements using basic formulas. Therefore, voltage measurement is the basis for many other electrical and non-electrical parameters. A very popular measuring instrument for measuring voltage is the voltmeter, but the commonly used one is the analog voltmeter. Analog voltmeters are divided into peak voltmeters, mean voltmeters, and average voltmeters according to different detection methods. They are all made into independent instruments. In this way, when using an analog voltmeter to measure AC voltage, the instrument must be selected according to the measurement requirements. In addition, the meter heads of most voltmeters are scaled according to the sinusoidal AC effective value, and when measuring non-sinusoidal waves, they must be converted to obtain the correct measurement results, which brings inconvenience to actual work.

By using a virtual voltmeter, the peak value, average value and effective value that characterize the AC voltage characteristics can be displayed on a panel . When measuring, the instrument can be selected on the panel according to the waveform. The user can analyze and compare the measurement results only through the panel indication value, which greatly simplifies the measurement steps.

1 Design idea of ​​virtual voltmeter

The engineering technology of LabVIEW 8.2 is richer than any previous version. It uses a Chinese interface, and the functions of each control are clear at a glance. With its new user interface objects and functions, you can develop a professional and fully customizable front panel. LabVIEW 8.2 also makes significant additions and improvements to mathematics, signal processing and analysis. Signal processing analysis and mathematics have more comprehensive and powerful libraries, including more than 500 functions. Therefore, it is more convenient to design a virtual voltmeter under LabVIEW 8.2.

The virtual voltmeter is a modular system based on computer and standard bus technology. It is usually composed of control modules, instrument modules and software, and the functions of the instrument are realized by software programming. In the virtual instrument, the computer 显示器\'); companyAdEvent.show(this,\'companyAdDiv\',[5,18])"> display is the only interactive interface. Physical switches, buttons, knobs, digital tubes and other display devices are replaced by graphic controls similar to the physical appearance. The operator can define the function of the instrument according to his needs by operating the knobs, switches, buttons and other parameters on the virtual instrument panel through the mouse or keyboard. In the design of the virtual voltmeter, considering that the instrument is mainly used for teaching and experiments and the users are students, the three detection methods mentioned in the introduction are integrated into one, which simplifies the panel operation and facilitates direct comparison.

The voltmeter is mainly used as a teaching and measuring instrument for experimental courses such as circuit analysis and analog electronic technology, which enables learners to understand and master the measurement of voltage and the different responses of the voltmeter to various waveforms. Therefore, the virtual voltmeter should have the functions of power switch control, waveform selection, display of three results: peak value, effective value and average value, and adjustable input signal size. The virtual voltmeter consists of hardware devices and interfaces, device driver software and virtual instrument panel. Among them, the hardware devices and interfaces include instrument interface devices and computers, the device driver software is the driver that directly controls various hardware interfaces, and the virtual instrument communicates with the real instrument system through the underlying device driver software, and displays various controls corresponding to the real instrument panel operation on the computer screen in the form of a virtual instrument panel. Here, a signal generator is virtualized by software. The signal generator can generate sine waves, square waves and triangle waves, and can also input formulas to generate arbitrary waveforms. According to needs, the controls on the panel can be adjusted to change the adjustable parameters such as the frequency and amplitude of the signal, and then the operation of the voltmeter can be detected. Therefore, the virtual voltmeter designed in the LabVIEW graphical language environment is mainly divided into two parts: the first part is the design of the virtual voltmeter front panel; the second part is the design of the virtual voltmeter flow chart.

2 Front panel design

The front panel simulates the front panel of a real voltmeter, which is used to set input values ​​and observe output quantities. Since the virtual panel is directly facing the user, it is the core of the virtual voltmeter control software. When designing this part, the main considerations are beautiful interface and simple operation. Users can control the virtual voltmeter to perform measurements through various buttons, switches and other controls on the panel. According to the functions of the traditional voltmeter panel control, the control template in LabVIEW is used to place data input controls, displays, data output controls, switches and selectors that simulate actual voltmeter controls on the design panel. The display is used to display the input signal waveform; the data input control is mainly used to input the signal frequency, sampling frequency, number of samples, amplitude and phase of the measured signal; the data output control is used to output the peak value, average value and effective value obtained after the measured signal is processed and the effective display of the standard frequency. Open the editing window of the LabVIEW front panel, click the right button of the mouse to display the control template, and select the graph-waveform graph as the display of the voltmeter. Click the right button of the mouse on the display template to set its properties. For example, according to the changes in the frequency and amplitude values ​​of the oscilloscope, use the text tool in the tool template to reset the scale of the horizontal (time) and vertical (amplitude) coordinates of the oscilloscope. The oscilloscope designed with Graph control is fully synchronized and the waveform is stable. [page]

Select Control → Numeric → Numeric Input Control/Numeric Display Control to display the input and test results in the voltmeter parameter settings.

Select Controls → Drop-down List and Enumeration → Menu Drop-down List, place the input waveform selection switch, right-click in the drop-down list, and select "Edit Item" to edit it.

Select Classic → Classic Boolean → Square Button for the " Power Switch " control. When the switch is pressed, the virtual voltmeter starts running and the indicator light of the power switch turns on. Similarly, when the switch is released, the virtual voltmeter stops running. Front Panel As shown in Figure 1.

Front Panel

3. Flowchart design

Each front panel corresponds to a flowchart program. After the design of the front panel is completed, the flowchart program can be designed. Open the window in the LabVIEW design environment → Display the program flowchart, enter the flowchart editing window, and the port icons corresponding to the front panel controls automatically appear in the flowchart editing window. Using the functional modules in LabVIEW, according to the functions and connections of the virtual oscilloscope front panel controls, and the control of the data flow after the virtual oscilloscope is operated, place each functional module in the flowchart design panel respectively. After reasonable placement, use the connection tool to connect them in sequence to realize the function of the virtual oscilloscope. The editing of data flow is mainly the connection of port icons. When connecting with the connection tool, if the port flashes, it means that the connected data type matches, otherwise it cannot be connected.

3.1 Implementation of Virtual Signal Generator

Since the virtual voltmeter is mainly used for demonstration, for convenience, LabVIEW software can be used to directly generate simulation signals. In this design, sine waves, square waves, triangle waves, and arbitrary waveforms determined by formulas are set. In the program design block diagram, a Case (selection) statement is used to select four waveforms. In the Case statement, each number (0, 1, 2, 3, 4) represents a waveform, corresponding to the five states in the front panel control. As for the production of the Case statement, just frame one of the four icons, such as the sine wave generator, with a Case frame, and then write the corresponding number in the blank space above, such as 1; then click the arrow to set the second icon. If you want to add a Case, you can right-click the mouse, add it directly, and edit the corresponding node in the corresponding basic signal generator VI. When adding a formula wave, the basic signal generator VI should be replaced with a formula waveform VI. 0 represents the default state, indicating that there is no waveform input. This article gives a branch of the Case structure, and the flow chart of the formula waveform is shown in Figure 2. This sub-VI can generate a function waveform using a formula string of a specified time function. It requires that the independent variable of the formula must be t, and it supports operators and commonly used functions.

Flowchart of formula waveform

In addition, in the analog state, the signal frequency is measured in Hertz or cycles per second. However, in digital systems, digital frequency is usually used, which is the ratio of the signal frequency to the sampling frequency, called the standard frequency. Therefore, in the block diagram program, a divider should be loaded between the signal frequency and the sampling frequency.

After the waveform generator generates the waveform according to the specified parameters, it would be wrong to input the waveform directly into the waveform display control. Because the waveform display control does not only require one or one set of data like the data display control, whether the waveform can be displayed as required depends on the input of several different and decisive data, such as period, phase, etc. In this design, the z-axis starting coordinate, period, and waveform are bundled into an array and input into the waveform display control at the same time.

3.2 Data processing part

The function of the data processing part is to obtain different specified results by detecting and calculating the generated signal in different forms. In this design, the AC effective value, peak value and average value are displayed at the same time. For a pure AC voltage, the positive half-cycle signal is symmetrical with the negative half-cycle signal, and the average value of U is equal to zero, so the average value is generally not measured directly. When designing, press Function → Value → Absolute Value to take the absolute value of the AC voltage, then calculate the average value and take the full-wave average value. The maximum value in the AC voltage is the peak value. The maximum value can be obtained by comparing the data, which requires the use of the waveform maximum and minimum sub-virtual instruments to process the block diagram. Effective value display: Select the basic average DC RMS in Function → Signal Processing → Waveform Measurement. Its block diagram symbol is shown in Figure 3.

Block diagram symbol

[page]

In Figure 3, DC value is the measured DC component; RMS is the effective value of value measurement; reset is used to restart the time signal and average measurement parameters recorded in the past; averaging type is the average type in the measurement. In a single module VI, the average time can be automatically set according to the input record length; Window is the window used to record time before DC/RMS calculation; error in is to describe the error environment before the VI runs, and the default value is no error. If an error has occurred, the VI returns an error code at the errorout end, and the subVI runs normally only when there is no error.

3.3 Switch part

The entire block diagram program is designed using a while conditional statement. When the analog voltage switch is "1", the virtual voltage meter works and the program in the conditional statement starts running; when the analog switch is "0" or off, the program in the conditional statement stops running and the virtual voltage meter does not work. The designed flowchart is shown in Figure 4.

flow chart

4 Conclusion

After actual use, all the control keys and functions of the virtual voltmeter are normal and meet the use requirements. It should be pointed out that when designing the virtual voltmeter, for the purpose of teaching use, only the function was considered, and the technical indicators of the virtual voltmeter were not studied in depth. In fact, the peak value is the maximum value of the sampling value, and it is impossible to obtain too many sampling points, otherwise the running speed will be too slow. Therefore, the displayed peak value is different from the theoretical value. Attention should be paid to the reasonable selection of parameters during design.

The virtual instrument designed in the LabVIEW graphical language environment is simple and fast. Users can call software modules with different functions to build their own instruments according to the needs of the test functions. This is very convenient for measurement personnel, especially laboratories in colleges and universities. Different grades of instruments can be designed for teaching according to different teaching levels on the same computer . How to design the hardware driver part, virtual panel part, and signal post-processing part partially or completely for different teaching purposes? The signal post-processing program can be designed as an independent functional module, which can perform non-real-time on-site and offline analysis of the sampled signal, which not only meets the requirements of students, but also avoids the repeated purchase of equipment.

Keywords:LabVIEW Reference address:Design of Multi-purpose Virtual Voltmeter Based on LabVIEW 8.2

Previous article:Research on Memory Detection System Based on LabVIEW
Next article:Developing a Part Finishing and Inspection System Using NI Smart Cameras and LabVIEW

Recommended ReadingLatest update time:2024-11-16 16:33

Three Steps to Develop Good LabVIEW Programming Habits
Part 1~ VI Place the VIs in a systematic manner. You can use folders to manage subVIs or save subVIs as LLB files. Do not save too many VIs to LLB files, because it will take more time to save VIs to LLB files later. Use Tools»Edit VI Library to set the top VI in the LLB. Usually the main program is set as the t
[Test Measurement]
Design of constant current source circuit based on LabView
  The constant current source circuit uses an operational amplifier and a triode to form a voltage-current conversion circuit. Among them, the main function of OPA211 is to achieve high-precision V/I conversion, and the main function of the triode is to achieve power amplification. As shown in Figure 2.   Figure 2 Co
[Power Management]
Design of constant current source circuit based on LabView
Application of LabVIEW counting filter in signal noise reduction
Square wave frequency signals have a series of advantages such as stable operation, high precision, strong anti-interference ability, and easy to interface with computers. Therefore, they are widely used in modern measurement and control systems. However, in some industrial field environments with high voltage, high cu
[Test Measurement]
Application of LabVIEW counting filter in signal noise reduction
[]LabVIEW Application-SubVI Call
Summary When the main program executes a task, a "waiting..." dialog box will pop up to prompt the user to wait until the task is completed and the "waiting..." dialog box disappears. The following mainly introduces its implementation method... Create SubVI Creating a SubVI Call SubVI 1. Drop 'VI RefNu
[Test Measurement]
[]LabVIEW Application-SubVI Call
RF/communication physical layer research based on LabVIEW and NI USRP
   Figure 1: Overview of symbol, BER, SNR, current estimate, and transmission status information displayed on the detector before and after suppression.   "LabVIEW system design software is really good at parallel programming, and it is a great helper for developing signal processing and communication algorithms in
[Test Measurement]
RF/communication physical layer research based on LabVIEW and NI USRP
Research on the realization method of database establishment and management function in LabVIEW
  In LabVIEW, we use the ActiveX function to call the Microsoft ADO control, and then use the SQL language to access the database through the underlying ODBC interface function and ODBC database driver. The structural hierarchy is shown in Figure 1.     The goal of ADO is to access, edit, and update data sources
[Test Measurement]
Research on the realization method of database establishment and management function in LabVIEW
Using LabView to control DS3900 serial communication module
This application note discusses the use of the DS3900 serial communication module and LabView, a graphical interface development platform for embedded applications. This article serves as a user guide for the LabView interface for the DS3900. LabView has been widely used as a graphical interface development platform
[Test Measurement]
Using LabView to control DS3900 serial communication module
Design of high-speed multi-channel signal acquisition system based on virtual instrument technology
In 1986, the National Instruments Corporation of the United States first proposed the concept of virtual instruments. Virtual instruments organically integrate computer hardware resources (such as microprocessors, memory, displays, etc.) with instrument hardware (such as A/D, D/A, digital I/O, timers, signal conditioni
[Test Measurement]
Design of high-speed multi-channel signal acquisition system based on virtual instrument technology
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号