Lebview is now more and more widely used in measurement, control, teaching, scientific research and other fields. It adopts graphical programming and has a large number of built-in functions. It can easily complete various operations such as data acquisition, analysis and display, instrument control, measurement and testing, industrial process simulation and control, and has good scalability.
When using Labview for actual project development, the program is often required to achieve multi-functional integration. At this time, the program interface is unified and easy to operate. This paper takes the development process of a virtual signal generator as an example to study the design and implementation of the human-computer interface mode when using Labview to develop virtual instruments .
2 System Requirements and Analysis of Virtual Signal Generator
2.1 System Requirements
The overall design requirements of the virtual signal generator are as follows: 1. Realize multifunctional signal generation, be able to generate common waveforms (sine wave, triangle wave, square wave, saw wave, etc.), user-defined function waveforms, noise waveforms, etc. 2. Be able to adjust parameters and complete the digital storage function of waveforms. 3. Require a good human-computer interaction interface and easy operation.
2.2 Design Analysis
It is relatively simple to realize the signal generation of a single function in Lebview. You only need to place the corresponding controls on the front panel to set waveform parameters, waveform display and data storage path, then select the appropriate function node in the block diagram program window and complete the logical connection of each node and endpoint to meet the requirements.
According to the system design requirements, the program not only needs to realize multiple functions, but also should have the characteristics of allowing users to operate conveniently. Simply putting multiple sub-function programs together cannot meet the requirements.
We conducted a comprehensive analysis of the system requirement of "easy to operate and good human-computer interaction interface" and designed three human-computer interface modes with different characteristics: overall interface mode, pop-up interface mode, and dynamic call interface mode.
3 Human-machine interface design of virtual signal generator
3.1 Overall interface mode design
Features of the overall interface mode: parameter settings and implementations of all functional modules are in the same interface, and different functions correspond to different function buttons. When a button is pressed, the corresponding function operation will be realized.
3.1.1 Front panel design
In the front panel design, we put common parameters in one group to avoid duplicate controls; we divide the characteristic parameters of each sub-function into different groups to facilitate user operation. The waveform display is completed by a graph control, and the data storage also shares the same functional area. Interlocking buttons are used to switch between sub-functions. The front panel in this mode is shown in Figure 1.
Figure 1 Front panel of the overall interface mode
3.1.2 Key points of block diagram programming
We chose the selection structure to complete the implementation of the overall interface mode: the common signal module, user function signal module, and noise signal module are used as the three branches of the selection structure. When the required function button is pressed, the selected sub-block diagram program is executed to complete the corresponding operation. It should be noted here that each sub-function button should be set to an interlocking relationship, that is, only one button is allowed to be pressed at any time. When another button is pressed, the button that was originally pressed will automatically pop up.
We put each sub-function button into an array, and the array content corresponds to the switch state of each button. Then set a while loop structure, and use the shift register of the loop structure to compare the button array content in this loop with the button array content in the previous loop. If they are equal, it means that no other buttons are pressed; if they are not equal, it means that another button is pressed. At this time, the content of the button array needs to be rewritten: the logic value of the button originally pressed should be changed to "false", and the logic value of the newly pressed button should be changed to "true". The current button state content and the previous button state content can be XORed to achieve these two functions. The updated button state is completed by rewriting the original button array content through local variables. The block diagram program of the interlocking logic is shown in Figure 2.
Figure 2 Interlocking logic block diagram program
The advantage of the overall interface mode is that all sub-function modules are in the same interface, and the overall visibility and operability are good. However, when there are many sub-module types, the interface will be too bloated and difficult to operate, and the programming will be too complicated. At this time, we can use the Tab control to classify the function modules to achieve the purpose of simplifying the front panel interface. [page]
3.2 Pop-up interface mode
Features of the pop-up interface mode: When you press a sub-function button on the main program panel, a sub-program panel of the corresponding function will pop up, and the sub-panel will return to the main panel after it finishes running.
3.2.1 Front panel design
We make each sub-function module into multiple sub-programs and place them in the same path as the main program for easy calling. The front panel of the main program only needs to implement the call button configuration of the corresponding function. When a certain function needs to be used, press the corresponding button to call out the sub-program interface. After the execution is completed, close the sub-program and return to the main program interface to call other functions. The pop-up interface during the operation of the virtual signal generator is shown in Figure 3 (calling the "common waveform generation" sub-function program).
Figure 3 Front panel architecture in pop-up interface mode
3.2.2 Key points of block diagram programming
The event-driven function of Labview can easily realize the design requirements of the pop-up interface, so we choose the event structure to implement the programming of the pop-up interface of the virtual signal generator.
In the event structure of the main program, the call of the corresponding sub-function program is specified for each function button event. In this way, every time a function button is pressed, Labview will automatically notify the program of the event, and then respond to the event according to the program code specified for this event. The block diagram design of the main program is shown in Figure 4.
Figure 4 Main block diagram of pop-up interface mode
The advantage of the pop-up interface mode is that the interface and program structure are clear, all sub-modules are programmed separately and called by the main program on demand, which can greatly reduce the complexity of programming.
3.3 Dynamic Call Mode
Characteristics of dynamic calling mode: The sub-function program is dynamically loaded into the memory only when it is called and is released after the call ends.
3.3.1 Front panel design
We divide the program interface into two areas: the left area is set with various function buttons, which can call sub-functions as needed; the right area is composed of subpanel controls, which display and run the corresponding interface and functions when the sub-function is called. Figure 5 shows the interface when the program calls the "Function Signal Generation" sub-function program.
Figure 5 Front panel of dynamic call mode
3.3.2 Key points of block diagram programming
In order to facilitate calling sub-function programs, the main program and each sub-function program are saved in the same path.
When the main program is running, if you need to call a sub-function program, you should first know the overall path of the sub-program: you can first use the current VI'S Poih function and the Stdp Path function to obtain the path of the main program, and combine this path with the name of the sub-program to be called to form the overall path of the sub-program. Then use the loadondRun function to load and start the sub-program with the known path, and finally use the Insert VI method in the call node corresponding to the subponel control to insert the sub-program panel into the sub-panel control.
The selection requirements of different sub-function programs are implemented by the selection structure.
The advantages of the dynamic call interface mode are that the sub-modules are programmed separately, the structure is clear, and the programming complexity is low; the program is dynamically loaded, occupies less memory, and has a fast loading speed.
4 Conclusion
Based on the design of the virtual signal generator, we have conducted a detailed analysis and research on the three commonly used human-computer interface modes in Labview programming: the overall interface mode, the pop-up interface mode, and the dynamic call interface mode. In actual project development, these modes can be directly selected for interface design according to specific circumstances, or they can be used in combination to meet higher design requirements.
It should also be pointed out that the implementation method of each mode is also flexible and changeable. For example, the interlocking buttons involved in 2.1 can also use the Enum control to achieve the same function. The implementation of interlocking logic can also be achieved by using the event structure combined with the method of setting the control property node: when a function button (such as the "Common Waveform" button) is pressed, the corresponding program code is executed: the logic value of itself is set to lrue, and the values of other function buttons are set to false.
Previous article:Application of LabVIEW in Intelligent Virtual Instrument Simulation
Next article:Solar street light charging and discharging monitoring system based on LabVlEW
Recommended ReadingLatest update time:2024-11-15 13:24
- Popular Resources
- Popular amplifiers
- 100 Examples of Microcontroller C Language Applications (with CD-ROM, 3rd Edition) (Wang Huiliang, Wang Dongfeng, Dong Guanqiang)
- Arduino Nano collects temperature and humidity data through LabVIEW and DHT11
- Modern Testing Technology and System Integration (Liu Junhua)
- Computer Control System Analysis, Design and Implementation Technology (Edited by Li Dongsheng, Zhu Wenxing, Gao Rui)
- Seizing the Opportunities in the Chinese Application Market: NI's Challenges and Answers
- Tektronix Launches Breakthrough Power Measurement Tools to Accelerate Innovation as Global Electrification Accelerates
- Not all oscilloscopes are created equal: Why ADCs and low noise floor matter
- Enable TekHSI high-speed interface function to accelerate the remote transmission of waveform data
- How to measure the quality of soft start thyristor
- How to use a multimeter to judge whether a soft starter is good or bad
- What are the advantages and disadvantages of non-contact temperature sensors?
- In what situations are non-contact temperature sensors widely used?
- How non-contact temperature sensors measure internal temperature
- LED chemical incompatibility test to see which chemicals LEDs can be used with
- Application of ARM9 hardware coprocessor on WinCE embedded motherboard
- What are the key points for selecting rotor flowmeter?
- LM317 high power charger circuit
- A brief analysis of Embest's application and development of embedded medical devices
- Single-phase RC protection circuit
- stm32 PVD programmable voltage monitor
- Introduction and measurement of edge trigger and level trigger of 51 single chip microcomputer
- Improved design of Linux system software shell protection technology
- What to do if the ABB robot protection device stops
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Wi-Fi 8 specification is on the way: 2.4/5/6GHz triple-band operation
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Vietnam's chip packaging and testing business is growing, and supply-side fragmentation is splitting the market
- Three steps to govern hybrid multicloud environments
- Three steps to govern hybrid multicloud environments
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Microchip Accelerates Real-Time Edge AI Deployment with NVIDIA Holoscan Platform
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Melexis launches ultra-low power automotive contactless micro-power switch chip
- Design and implementation of STC single-chip water temperature intelligent control system based on Gizwits Cloud
- Send me the latest cracked file of MDK5, so you don't have to look for it everywhere
- DC PWM motor driver only needs current loop, what are the domestic devices?
- C2000 built-in comparator error sources and correction methods--F28004x, F2807x, F2837x
- [Problem Feedback] Anlu TangDynasty ChipWatcher can drive people crazy
- [2022 Digi-Key Innovation Design Competition] 7508DK CNC adjustable power supply power supply part update
- Regarding the erase and write life of FLASH, does erasing and writing count as one time each?
- Mir MYC-YT507 development board review: image burning and experience (warm reminder of driver installation problem TIPS)
- Share an example of my own single-chip thermocouple temperature measurement design
- 【DIY Creative LED】Main Program