LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing an array from Sub panel to sub menu VI

Hello,

In an application for a test rig I have the following setup :

- LV7.1  + WIN_XP + PCI6229 M series card.
- Main.VI which is a sub panel and acts as a container for 5 different test sequences which are Test_1.vi,......Test_5.vi
- The fundamental rig safety interlocks  run in the Main.vi inside of a 50ms timed loop. There are some 6 different digital inputs that are to be acted upon and the rig shut down in different fashion for each. So  this loop has to run as long as the rig is powered up.
- When the user selects a particular sub-menu from main, say Test_1 then I load  the Test_1.vi. Now this also needs to read some 8 different digital inputs, 5 analog inputs and step through the specific sequence based on the status of each input. A state machine basically.

Now I have the following options :

- For data I/O for the sub.vi,  I can run a dedicated timed loop inside it and use the data.
OR
- Use the  Main.VI timed loop to update all data arrays inside of the 50ms loop and pass the  updated data arrays to the particular Test.VI that is currently  loaded. One way to do this is to resort  to  Global variables. But the total I/O count is something like 40 and I am scared to go this route as the Globals will get written once every 50 ms.

What else can be done to pass this I/O image between the Main.vi and another VI that runs inside the conatiner ?

Thanks

Raghunathan

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 1 of 2
(2,270 Views)

The best way to do this would be in either a functional global (also called shift register or LV2 global) or a single element queue. You can also use either of the two GOOP toolkits. I would recommend the queue approach, as its performance is much better than the others. You can find code examples and more information on this thread - Clusters as data structures.

I have also attached a presentation I gave at NI-Week a year or so ago explaining the design of large LabVIEW programs using the shift register approach. It should give you a few hints (and laughs). Let me know if the LabVIEW version is wrong for you and I can down convert as necessary.

Message 2 of 2
(2,247 Views)