|MORECHEMISTRY.COM::MORE CHEMISTRY ON THE WEB|
LabVIEW programming topics - optimize vis for speed
LabVIEW vi optimization tips
When 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 subroutines
This 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 variables
When 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.
Don't use anti-aliasing
Anti-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 loops
There 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 open
If 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.
Bart Boshuizen, 2006/01/16