LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reference to calling vi from subvi

Is there a way fora subvi to get a reference to the vi that called it?

Bill F
0 Kudos
Message 1 of 6
(3,695 Views)
You can either get a reference in the caller and wire it to a terminal of the sub-VI, or you can use the call chain function to get the name of the caller and then wire that string to an open reference function.
Message 2 of 6
(3,695 Views)
Hi,

If you do chose to use the call chain function, please read the following KB that discusses one limitation to it.
Why is the Parent VI Not Being Returned When I Use the Call Chain Function?

Feroz
0 Kudos
Message 3 of 6
(3,696 Views)
Hi
 
I want to know , how and where to use call by reference function ? What are its advantages.Also give me a tutorial which will explain all these with some examples.
 
Raman
0 Kudos
Message 4 of 6
(3,539 Views)
Hi,


You use call by reference if you want to execute a vi, and want to determine which vi during runtime.


I'm sure there is a nice example in the LabVIEW Search Examples. My Search Examples is not working anymore since I installed LabVIEW embedded evaluation, so I can't help you there.


Regards,


Wiebe.


"can we generate frequency using counters . if so then what is the range and resolution." <x@no.email> wrote in message news:1151053807060-382656@exchange.ni.com...
Hi
&nbsp;
I want to know , how and where to use call by reference function ? What are its advantages.Also give me a tutorial which will explain all these with some examples.
&nbsp;
Raman
0 Kudos
Message 5 of 6
(3,515 Views)

Hi Raman,

Generally speaking, using "call by reference" or VI Server with an invoke node accomplish the same goal -- loading a VI dynamically. Many programmers have used this functionality to achieve a "plug in" architecture with their subvi's, since they do not have to be part of the top-level VI's hierarchy. The two methods differ from each other in two main ways:

1. Call by Reference allows to you to wire just like a subvi's (with a connector pane), but the VI must execute in sequence according to the dataflow on the parent block diagram.

2. Using an invoke node allows you to truly launch the VI "in parallel" to the calling (parent) VI. However, you must use Get/Set control value methods to send data to it...which can make your block diagram a little messier 🙂

You may also find these links helpful:

Using Call by Reference with VI Server
http://sine.ni.com/apps/we/niepd_web_display.display_epd4?p_guid=B45EACE3DA8056A4E034080020E74861&p_...

Call By Reference Node
http://zone.ni.com/reference/en-XX/help/371361A-01/glang/call_by_reference_node/

Good luck!

Charlie S.

Visit ni.com/gettingstarted for step-by-step help in setting up your system
0 Kudos
Message 6 of 6
(3,486 Views)