LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

When does LabVIEW compile a VI?

I am writing a large, CPU-intensive program in LabVIEW, which I need to run as fast as possible. Obviously, compiled code runs much faster than interpretted code, and it is my understanding that LabVIEW is capable of compiling VIs (not to run as a stand-alone executable - just to run faster). However, I can't figure out under what conditions it compiles a VI. Is the VI compiled every time I hit the run button? If so, it's compiling VERY quickly. What exactly does Mass Compile do? How does it differ from "standard" compiling? Thanks.

Jason
Jason Rolfe
0 Kudos
Message 1 of 3
(3,069 Views)
You don't have to worry about compiling issues, LabVIEW always runs compiled. (Mass compile is a differenet tool and is usually used to convert a hierarchy of folders containing VIs to a new version. It's more a mass-convert, while of course it includes a recompile as part of the process).

The answer to your issues are elswhere. Here are some of my favorites, but I'm sure others will have more to add:

(1) Programming skills: Have a look at e.g. the results of the first LabVIEW Zone Coding challenge. An inefficiently coded solution took 14 seconds to complete the taks, while the top solutions did the same in about 60ms. There are many ways to code a certain task and some ar
e significantly faster than others. Carefully check for unecessary data copies and use the profiling tools to see where most of the time is spent. Be especially picky for the innermost loops of critical code sections, here it might be worth to flatten subVIs out to the main diagram to avoid the small subVI call panalty. Have a look at the LabVIEW Performance and Memory Management
application note for some starting points. If in doubt, code alternate version, then pit them against each other in a speed competition.

(2) Tweaking of VI settings: Disabling debugging, setting priorities (e.g. subVIs to "subroutine"), etc. can make a difference.

(3) Avoid unecessary tasks: Don't waste CPU resources to constantly redraw indicators, graphs, etc. make sure that these things occur sparingly and not deep inside loops. Avoid local variables, global variables, property
nodes, etc.
Message 2 of 3
(3,069 Views)
Hello!

Here you can find a very nice article about some points in your question:

Inside LabVIEW - How the Compiler Works
http://www.ni.com/devzone/lvzone/dr_vi_archived6.htm

Take a look on assembler code too:
http://www.ni.com/devzone/lvzone/dr_vi_archived6_fulldetails.htm
0 Kudos
Message 3 of 3
(3,064 Views)