LabVIEW is a development environment based on a graphical programming language. It has many similarities with traditional programming languages, such as similar data types, data flow control structures, program debugging tools, etc. However, the biggest difference between the two is that traditional programming languages are programmed in text languages, while LabVIEW is programmed in graphical languages (i.e. various icons, graphic symbols, connections, etc.).
The programming is simple and convenient, the interface is intuitive, and it has powerful data visualization analysis and instrument control capabilities.
Labview has a rich file operation function library that can easily read and write files. Labview can read and write text files, data report files, binary files and test files. The data read from the readbuffer end of VISAread in the main program needs to be converted into table data for saving. The data saving is divided into two stages. In the first stage, it is displayed in the main program interface in the form of a form (with a time header), which is convenient for users to intuitively check whether the test parameters have met the requirements. In the second stage, the form data is saved in an Excel file, which can be printed and queried by users. If the data does not need to be displayed intuitively on the main program interface, it can also be saved in a TXT file (which can be opened with Excel).
1. Design of data display module
The project takes full account of dynamic real-time performance. Each frame of data displayed corresponds to a different moment. The time size and time interval can be set for data display and storage functions to meet the data requirements at different test moments. Figure 1 shows the dynamic data table displayed by the display subroutine.
figure 1
Considering the frequency of reading the serial port, we propose two possibilities: ① The host computer needs to read the serial port periodically, so that the data from the serial port can also be displayed and saved periodically; ② The host computer's reading operation on the serial port is non-periodic, and the interval time is sometimes long, so that the serial port data is displayed when it comes up, and it will not be displayed if there is no data.
For the first case, Figure 2 shows the specific subroutine code. The serial port data from the main program is separated by each parameter of the StringSubset function module. Then, it is finally implemented as Table3 in Figure 1 through MergeSignals and BuildTable. From Figure 1, we can see that the data is periodically saved in the form at intervals of 3s. How to achieve this periodicity? This requires the use of the Combobox control in the While loop, and the various required saving cycles are preset for selection. It is worth noting that the data displayed by the subroutine in Figure 1 is the fixed value of the analog input.
figure 2
For the second case, you need to make some changes to the source program (Figure 2) and remove the Combobox control from the original program. In order to achieve the function of displaying only when data is available and not displaying when no data is available, you can consider adding a Case box and setting a local variable (whether there is data read from the serial port) to decide whether to display or not. The specific program can be written by the reader.
In order to display each test parameter in real time, each parameter data is connected to its own WaveformChart (real-time trend chart control), so that the waveform changes of each parameter can be displayed in real time by the trend chart. Users can intuitively judge whether the test parameters meet the requirements from the PC.
2. Save the form records displayed by the main program to a file
The serial port data in the program can be intuitively displayed on the front panel and saved, but in order to accurately analyze the experimental results, data storage is also important. Good data storage is conducive to the later processing and analysis of the data.
In the interface diagram of the real-time test main program, after the last module data is displayed in the main program form, the test setting button uses a Boolean type button "Save Data", which is a setting button used to set whether the data is saved. When it is True, all the real-time test data displayed in the form can be saved to the specified test file; when it is False, the real-time test data will not be saved. The essence is that the user selectively decides whether the data is saved through the state of the save setting button. There is such a program in the example provided by LabVIEW7.1/help/findexample. What needs to be changed is to replace the Table with the Table to be saved, create the corresponding attribute node, and select Rowheaders[] and Columnheaders[] to be effective. In this way, the form file in ⑴ can be saved to the file together with the row header and column header.
Previous article:LabVIEW reads serial port data
Next article:Labview serial data processing_labview serial communication
- Popular Resources
- Popular amplifiers
- From probes to power supplies, Tektronix is leading the way in comprehensive innovation in power electronics testing
- 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?
- 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
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Download from the Internet--ARM Getting Started Notes
- Learn ARM development(22)
- Learn ARM development(21)
- Learn ARM development(20)
- Learn ARM development(19)
- Learn ARM development(14)
- Learn ARM development(15)
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Why can't this circuit achieve bistable state?
- Power Management Guide
- Can the Unix version of MicroPython call system commands?
- These two sources contradict each other.
- 【ST NUCLEO-G071RB Review】_03_Breathing light experiment
- Problems that DC constant current source cannot solve
- TI-DSP Family
- I found out that GigaDevice has become a RISC-V MCU tool chain partner. Will it finally take action after GD32V103?
- [GD32E503 Review] 07 Review of SDIO Bus Driver SD Card (Part 2)
- Recommend a data acquisition card based on Ethernet bus NET-2411