LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make sub vi return a reference to the caller?

Dear All,

        In my program, caller.vi calls the subvi.vi and hopes the subvi.vi return a reference of control(such as Button in the subvi.vi's frontpanel) not the control(button) itself. Would you please give me some suggestion?

        Thanks.

 

 

Hugo

0 Kudos
Message 1 of 11
(4,112 Views)

Why???? 😮

 

 

(You can just create a reference in the subVI, create an indicator wired to the reference, and wire the indicator to an output connector.)

Message Edited by altenbach on 10-07-2009 08:44 AM
Message 2 of 11
(4,110 Views)
You could also set up events so that when your subvi closes it fires an event to let the calling vi know it closed.
Tim
GHSP
Message 3 of 11
(4,089 Views)

Thank you for your reply.

The attachments are the two vi. led2 in caller.vi can be conctrlled by ctl led2 in subvi.vi.But it is not a good way.

I want caller.vi can obtain the references of ctl led2 and led1. caller.vi registers an dynamic event which can know whether ctl led2 is pressed and the button of ctl led1 in caller.vi can control led1 in subvi.vi.

 

Thanks.

 

 

Hugo

Download All
0 Kudos
Message 4 of 11
(4,073 Views)

I am not sure that I understand what you want.  I made a little modification in caller.vi (LV86).  Now you can change the value of led1 with the boolean ctl led1.

 

 

Jean-Marc

Message 5 of 11
(4,065 Views)

Thanks.

My LabVIEW version is 8.5:(,would you please change it?

 

0 Kudos
Message 6 of 11
(4,047 Views)
I don't fully understand why you want to do what you are doing. There are much better ways of passing information from a subVI to the UI of an application. You could use queues, notifiers, or user events to name a few.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 7 of 11
(4,045 Views)
Message 8 of 11
(4,041 Views)

Thank you.

That is really what I want to do. Is there any other way to do it? For in my program, caller.vi is the main vi. If the button in subvi.vi is pressed, the event structure in caller.vi will response.

0 Kudos
Message 9 of 11
(4,030 Views)

hugoliang wrote:

Thank you.

That is really what I want to do. Is there any other way to do it? For in my program, caller.vi is the main vi. If the button in subvi.vi is pressed, the event structure in caller.vi will response.


Have you tired using user events? This would allow you to inject the event into your event structure. Though you will need to be careful when using multiple event structures in an application since only one event structure will capture a given event.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 10 of 11
(4,020 Views)