LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Call By Reference Node

Would someone please breakdown “Call By Reference Node” property in LabVIEW for me (and everyone else who might be confused)? What are some advantages of using this reference, as opposed to linking directly to subVIs? What are the disadvantages?

 

Thanks,

 

 

0 Kudos
Message 1 of 4
(2,873 Views)
> What are some advantages of using this reference, as opposed to linking directly to subVIs?
The main advantage comes when the programmer wants to run a VI like a Sub-VI, but wants to call the Sub-VI by name
I think the most common scenario in which the "Call By Reference Node" is used, is when the programmer is using a "plug-in" architecture.  Call by reference allows a program component - the called VI - to be changed without requiring editing the "main" program - all the program needs is to create a reference from the path of the callee, and that's supplied at run-time.  Even if all possible sub-VIs are known at compile-time, the programmer may opt for this structure instead of calling every possible VI - perhaps 10s or 100s - in some sort of Case structure.  Also, The  "Call By Reference Node"  is the only way I know to accomplish "recursive" VI calls (prior to LV 8.5.)
 
I'd bet my life there are lots more applications for "Call By Reference"!
 
Cheers. 
"Inside every large program is a small program struggling to get out." (attributed to Tony Hoare)
0 Kudos
Message 2 of 4
(2,855 Views)
As mentionned in this document there is also an important difference in the memory usage.

See attached example (upgraded to LV7.1 to be readable with LV8.5 from this LV5 source) to get a general idea about the use of Call By Reference Node.
0 Kudos
Message 3 of 4
(2,845 Views)

Thanks for your help,

Santiago

0 Kudos
Message 4 of 4
(2,830 Views)