Jump to content

How to read the name of caller inside his subvi.


Recommended Posts

Hi all,

I don't know if it's possible, but I would like to be albe to read the path of a Caller inside the subvi.

Let's say that I have many VIs call Mater 1.vi, Master 2.vi, Master 3.vi ..... and a VI call Slave.vi.

The Slave.vi is a subvi of all masters

Is it possible create a code inside the Slave.vi in way to know which is the name of the caller? o_O Something that tell me if the caller is Master 1.vi or Master 2.vi .....

Link to comment

Hi all,

I don't know if it's possible, but I would like to be albe to read the path of a Caller inside the subvi.

Let's say that I have many VIs call Mater 1.vi, Master 2.vi, Master 3.vi ..... and a VI call Slave.vi.

The Slave.vi is a subvi of all masters

Is it possible create a code inside the Slave.vi in way to know which is the name of the caller? o_O Something that tell me if the caller is Master 1.vi or Master 2.vi .....

That's a pretty standard operation using the Call Chain node in LabVIEW.

post-3370-0-02246000-1290096533_thumb.pn

Link to comment

OK, this doesn't answer your question directly, perhaps, but can you explain further what you are trying to accomplish by doing this?

I can imagine a situation where a method (your subVI) operates on any of a number of instances of some component.

In an Object-Oriented world I would instantiate an object for each instance of the component and then pass that object as an input to the subVI. Certainly one could do a similar thing without objects by passing some sort of reference (could be just a VI name) from the caller to the subVI.

Does this get you any closer to what you are trying to accomplish?

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.