LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Shared clone reentrancy and inlining

Solved!
Go to solution

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?

Certified LabVIEW Developer
0 Kudos
Message 1 of 5
(3,041 Views)

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

Thoric (CLA, CLED, CTD and LabVIEW Champion)


Message 2 of 5
(3,005 Views)

You are correct Dave,  Inline and shared clones are not compatable and the compiler breaks the vi


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 5
(2,984 Views)
Solution
Accepted by topic author JKSH

@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.

Message 4 of 5
(2,978 Views)

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.

Message 5 of 5
(2,837 Views)