| Home | Member Area | Links | Events | Publications | Promotions |
LabVIEW programming topics - Optimize vi's for Speed
[LabVIEW vi collection]
[LabVIEW links]
[LabVIEW store]
[programming topics] [drivers] [utilities] [projects] [events] [related topics]
LabVIEW vi optimization tipsWhen your virtual instrument (VI) is too slow then take notice of the following methods that are available to optimize your vi for speed.Run sub VI's as subroutinesThis method will reduce the overhead when the sub VI is called. The payoff is that you cannot run the sub VI as a normal VI and that the sub VI is somewhat limited; like you can't use property nodes.
Use property nodes rather than local variablesWhen you make a local variable you make a local copy of the original variable. When you make a property node you make a reference to the original value.In the case of single values the use of local variables may still be prefered because of the increase in readability. In the case of larger structures, such as an array, it is worth the effort to make the right property node.
Don't use anti-aliasingAnti-aliasing in graphs can be used to enhance the visual aspect of graphs. The disadvantage is the time it seems to consume.
Consider small delays in parallel loopsThere are many cases where using parallel loops in a VI is really convenient. If a loop doesn't need attention all the time then you should add a (small) delay. For example:
Keep the communication openIf you communicate with a serial device, or even with a DDE server, then keep the communication open. While you open the communication you create a reference that you may use throughout the lifespan of your VI. Just before the VI ends you can wire this reference to a close node.Opening the communication takes typicaly 10 times longer than simple 'write command - read answer' structures. Bart Boshuizen, 2006/01/16
|
|