04-01-2013 08:49 PM
Hello,
I'd like to clarify the concept of inlining VIs. Does it matter whether I choose "shared clone" or "preallocated clone" for an inlined VI?
From my understanding, inlining is like "copying" the code from the subVI into the calling VI itself before compilation, such that a subVI call does not occur at runtime. Thus, an inlined VI will effectively use the memory space(s) of the calling VI(s), thus it's not possible to reduce its memory footprint using shared clone reentrancy -- is this correct?
Solved! Go to Solution.
04-02-2013 08:05 AM
Inlining a subVI will literally place the subVI code content into the calling VI. This is a useful tool for reducing calling overhead and compiled code footprint. If you are calling this subVI in a large number of places then inlining it will more likely increase your code footprint as it essentially gets copied into each of its instances, but the overhead is still reduced per call.
All this means the code is effectively reentrant and set to 'preallocated clone'. Changing these settings in the subVI probably has no effect (other than possible breaking your code if you set it to shared clone)
Read here for more info: http://forums.ni.com/t5/LabVIEW/Dr-Damien-s-Development-Improve-Load-Time-with-Inlining/m-p/823418
04-02-2013 04:32 PM
You are correct Dave, Inline and shared clones are not compatable and the compiler breaks the vi
04-02-2013 05:00 PM
@JÞB wrote:
You are correct Dave, Inline and shared clones are not compatable and the compiler breaks the vi
This is not actually true. You can set the reentrancy of an inlined VI to "shared clones" and it will not break the VI. However, and inlined VI will effectively behave as if "preallocated clone" is selected.
08-07-2014 03:58 PM - edited 08-07-2014 03:58 PM
I was doing some research on this issue and this thread is the first result that comes up in Google. However with a little more work you can find a more official source:
http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/vi_execution_speed/#SubVI_Overhead
"LabVIEW automatically preallocates clones for each instance when it inlines the subVI."
Just thought I'd include this for anyone else who comes along in the same way I did.