Presentation is loading. Please wait.

Presentation is loading. Please wait.

LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7.

Similar presentations


Presentation on theme: "LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7."— Presentation transcript:

1 LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7

2 LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs Reduce I/O overhead GPIB Data Acquisition File I/O Networking Reduce screen updates Use efficient indicators (graphs and charts) Eliminate unnecessary controls/indicators Improve memory use –Use efficient array functions –Carefully manipulate strings and arrays –Avoid unnecessarily complex data structures

3 LabVIEW.com.tw LabVIEW Community Reduce Number of I/O Operations File I/O, GPIB, DAQ, Networking VIs I/O VIs take much more time than computational operation Minimize the number of I/O calls –Transfer a lot of data in each call –Use multiple-point DAQ VIs instead of single-point VIs Slow Method (many I/O calls) Fast Method (One I/O call)

4 LabVIEW.com.tw LabVIEW Community Reduce Opening and Closing of Resources Slow Method Fast Method Use low-level VIs to reduce the number of times a resource is opened and closed. In Slow Method, the file is opened and closed 100 times. In Fast Method, the file is opened and closed only once.

5 LabVIEW.com.tw LabVIEW Community Reduce Screen Display Updates Updating front panel objects can be time consuming Use efficient controls and indicators Graphs and charts redraw when they receive new data and therefore affect execution speed Minimize display overhead by designing subVI’s with front panels closed during execution Use multiple-update plotting methods –Minimizes the number of chart updates –Get highest data display rates

6 LabVIEW.com.tw LabVIEW Community Screen Display Example Slow Method (updates chart 1 point at a time) Fast Method (updates chart 100 points at a time)

7 LabVIEW.com.tw LabVIEW Community Reduce SubVI Overhead Each subVI call involves certain overhead (tens of µs); not significant, but this can add up if the subVI is placed inside a looping structure. Do not display the front panels of subVIs called in a loop running at high speed. If possible, place the looping structure inside the subVI instead.

8 LabVIEW.com.tw LabVIEW Community Reduce Unnecessary Computation in Loops Avoid putting calculation in loops that produce same value each iteration Avoid unnecessarily accessing global variables in loops

9 LabVIEW.com.tw LabVIEW Community Global and Local Variables Each read of a variable creates a new data buffer for the data Can add up significantly if using large arrays, strings or complex data structures Using a wire is always more efficient, both in memory and execution time

10 LabVIEW.com.tw LabVIEW Community Property Nodes and Control References Runs in the user interface thread Using a property node or control reference results in a thread swap which causes a loss in efficiency Do not use a property node or a control reference only to update the value of a control If changing other properties, adding a value update does not cause a further loss since thread swap is already occurring

11 LabVIEW.com.tw LabVIEW Community Updating the Value of a Front Panel Object GoodBetterBest

12 LabVIEW.com.tw LabVIEW Community Updating the Value of a Front Panel Object Bad Good

13 LabVIEW.com.tw LabVIEW Community Create Efficient Parallel Diagrams LabVIEW periodically switches between parallel loops Use the Wait (ms) function - this ensures that less important loops use less processor time A wait of 0 will also free the processor for other tasks!


Download ppt "LabVIEW.com.tw LabVIEW Community Speeding Up Your VIs 參考 NI 官方教材: LabVIEW Intermediate II for 7."

Similar presentations


Ads by Google