LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

reference of calling VI in called VI

Solved!
Go to solution

Hi,

 

I am having a MAin VI that is calling a Sub VI. I am using call chain in SubVI to get the reference of the Main VI but giving me output as SubVI. Is this the way call chain works because I had feeling that call chain returns the caller Vi name.

 

Please help me if someone knows something about this or guide me in case have some other alternative to do it in a better way since adding a terminal and passing the reference to the SubVI is not our requirement. 

 

Thanks in Advance

 

Regards,

Vivek

0 Kudos
Message 1 of 13
(15,042 Views)

Hi Vivek,

 

Call chain returns an array of VI names. The first element is the current VI (SubVI), the second element is the caller.

 

Hope this helps,

Daniel

 

0 Kudos
Message 2 of 13
(15,033 Views)

 I am using call chain in SubVI to get the reference of the Main VI


Call chain returns the vi names of the current vi and the callers. It does not return reference to any vi.  For obtaining the reference of any vi use the open reference function with the path input of the vi for which you want the reference.

 

With regards,
JK
(Certified LabVIEW Developer)
Give Kudos for Good Answers, and Mark it a solution if your problem is solved.
0 Kudos
Message 3 of 13
(15,029 Views)

Depending on what you're trying to do, the following may also be interesting:

 

Drop a property node on the Block Diagram, set the class to "VI" and selest "Caller's names".  this will give yout the names of ALL VIs which call the current VI within your program.  It is perhaps useful if you need to update more than just the VI which called the VI this time.

 

 

 

Call Chain can give VI which called the current VI at this moment in time

Caller's names Property node  can give ALL VIs which can call the current VI at ANY time.

 

Shane.

Message Edited by Intaris on 03-18-2009 03:51 AM
0 Kudos
Message 4 of 13
(15,017 Views)

The OpenG toolkit has a function called 'Current VIs Parents Ref' that returns the reference of the VI calling the VI with this function.

 

 

Ton

Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
Nederlandse LabVIEW user groep www.lvug.nl
My LabVIEW Ideas

LabVIEW, programming like it should be!
Message 5 of 13
(15,005 Views)

Thanks for the answers and the soultion.

 

I practically used both the options i.e call chain and VI reference. I have now one doubt regarding the reading of Controls available in Main VI  through SubVI. I tried with call chain but couldn't able to establish communication between the two VI's. What I am trying to do I'll continously read the value given by the user in MAin Vi and will process those value in the SubVI. I am having an array and hence for the first index able to do but not for the rest of the indices.

 

Please suggest me in case anyone have any knoweldge of this.

 

Thanks In Advance.

 

Regards,

Vivek

0 Kudos
Message 6 of 13
(14,985 Views)
Solution
Accepted by topic author vivekkde

Hi Vivek!

 

Is it something like this you are trying to do?

 

Regards

 

/Thomas

Download All
Message 7 of 13
(14,969 Views)
I have always created a "Pane" reference of the Main, wired that into the Sub VI, then in ths Sub VI, get the names of the controls to read them.
Richard






0 Kudos
Message 8 of 13
(14,966 Views)

Thanks A Million To All of You ....

Now I have acheived the requirement ...

0 Kudos
Message 9 of 13
(14,958 Views)

Hi

 

I think your files are interesting for me as well but I just have an older version of labview installed on my computer. Is it possible for you to save your files in such a way that can be opend in LV 8.2.

 

BR

Afshin

0 Kudos
Message 10 of 13
(14,779 Views)