LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I Pass Parameters to/from a SubVI Opened by Reference?

I am using an Open VI Reference, a Property Node with 'FP Open' and a Close LV Object Reference to pop-up a subVI from a main LV program. Changing the boolean constant wired to Property Node to false closes it.

Is there any way to read parameters from it while it's open? I need to transfer indicator readouts on the subVI to similar indicators on the main front panel.

If there is a cleaner/simpler way to pop-up the subVI, where I could wire local indiators directly to it, I'd appreciate hearing how.

I have tried going the route where I check the Show Front Panel When Called in the SubVI Node Setup dialog box, but the thing just flashes rapidly on and off. -Garth
0 Kudos
Message 1 of 5
(2,699 Views)
Hi Garth,

If you just want know what the values left in some of the sub-VI's indicators are, you can use a call by reference node and just wire from the available terminals.

If you want to know (in the main VI) what the values are while the sub-VI is running, use the reference from the VI to get a reference to to front panel. Use that to get an array of references to the controls. You could then use these references to get there names and search for the controls you are interested in. After that you will then be able to read or write the controls as you choose.

If I have completely missed the mark here, let us know and we try again.

Willing to help,

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 2 of 5
(2,699 Views)
Ben, thanks for your reply. Please pardon any 'dumb' questions, as I'm new to LV programming at this level.

The set-up I'm using (copied from an example - I don't thoroughly understand how it works) uses an Open VI Reference connected to a Prop. Node (in write mode with FP. Open) connected to a Close LV Object Reference. My requirement is to be able to open and interact with the subVI, then close it again. While it is open, I want to read or copy the contents of (or subVI outputs to) a few subVI indicators and write that info to similar displays on my main VI front panel.

I do not know how to or where to insert a Call by Reference node you suggested into the setup I described above. Do I just add it between the Prop. Node and the Close LV Obje
ct Reference?

I've attached the part of my program I'm referring to. -Garth
0 Kudos
Message 3 of 5
(2,699 Views)
Hi Garth,

I have modified your VI.

Is this getting closer to what you want?

Ben
Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 5
(2,699 Views)
Yes. Many thanks for your assistance.
0 Kudos
Message 5 of 5
(2,699 Views)