In a conditional structure, there are two completely different ways to handle display controls. Although these two methods seem to be not much different on the surface and may have been used in specific programming, the operating efficiency varies greatly when processing large data, such as large arrays, and may inadvertently cause the program to run slowly and be difficult to detect errors.
Method 1: Display input controls and indicators outside the case structure. In this method, the input controls and indicators are located outside the case structure branch. As shown in the following figure:
Method 2: Processing controls and indicators in a case structure. In this method, the controls and indicators are placed in the case structure branch. From the flowchart, it seems to be more concise, but it is very wrong, as shown in the following figure.
In method 2, no processing is performed in the error branch, and the input and display controls are placed in the non-error branch.
OUT.VI and IN.VI implement exactly the same functions, but their running efficiency is very different. The larger the array, the more obvious the difference. Of course, the running time will be different on different computers. The following is the test program flowchart.
Below are the test results. The running time of the two differs by more than 20,000 times.
Next, we introduce a "top-level flowchart". The top-level flowchart is often seen in articles written by LV enthusiasts, but there is no such concept in LV-related books. In OUT.VI, the input controls are on the left and the display controls are on the right, both outside of all structures. The area outside of all structures is called the "top-level flowchart", which is similar to the formal parameter part in C language.
In the top-level flowchart, the running efficiency is extremely high. This is because before entering the subVI, LV can easily determine that the cache is reusable, so there is no need to copy the array each time in the loop. However, when the input control and indicator are located inside the conditional branch, LV may not be able to determine that the cache is reusable, so the value copy method is used, which sacrifices efficiency but ensures the correct result.
Method 2 seems more reasonable on the surface, but it is wrong. Therefore, we can conclude that the input controls and display controls in the subVI should be located in the top-level program flowchart and should not be located in any structure.
Previous article:In-depth exploration of LABVIEW: linked control references and unlinked control references
Next article:In-depth exploration of LabVIEW - double precision number accuracy issues
Recommended ReadingLatest update time:2024-11-16 13:33
- 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)
- Keysight Technologies Helps Samsung Electronics Successfully Validate FiRa® 2.0 Safe Distance Measurement Test Case
- 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?
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Sinlinx A64 development board Linux kernel waiting queue poll --- blocking and non-blocking
- iTOP-iMX6 development board-device tree driver-compile driver as module
- How to read TI DSP's complex technical documents
- FPGA and Digital Image Processing
- Differences between power meter and spectrum analyzer in measuring power
- Some strange problems with mm32F103
- [TI mmWave Radar Review] IWR1443 BOOST CLI Commands
- Selection and comparison of reed switches and Hall effect sensors
- [Project source code] [Modelsim FAQ] vsim-3033 Instantiation of 'xxxx' failed
- micropython update: 2020.12