LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data in subVI

I build a program with 7 layers. Each layer is a subVI of next layer. I forget some data in the first layer is important for the 7th layer. How can I get the data from the first layer without change all other layers since it will be very mess to re-connect all wire in other layers??
Thanks
0 Kudos
Message 1 of 5
(2,855 Views)
Sound like you might want to use Local Variable or Global Variable. It can be done with using local and global variable however if you can do with wiring, it is better to use with wiring. Local and Global are not recommended but if you have no choice, then just use them.
------------------------------------------------------------------
When you feel sad, laugh
Message 2 of 5
(2,855 Views)
I don't know if these are relevant to your particular problem, but here are a couple of tips to help avoid these situations in future:

- always leave spare terminals on your VI connector pane (the 12-terminal pane is often a good choice)
- if you use a cluster to pass data around, save it as a strict typedef, and access its elements by name, then you can add extra elements later without having to rewire any of your existing work.
Message 3 of 5
(2,855 Views)
Another option is to use Queue VIs found under Advanced>>Synchronization>>Queue Operations. One advantage of these is that it is easy to avoid race conditions.

Regards,
Doug Norman
Message 4 of 5
(2,855 Views)
The other solution is to put the data into a control or indicator on the main VI and then access it via reference from the subVI. This allows you to get or change data from any subVI, but you have to be careful to avoid race conditions.

There are front panel reference libraries that have been posted here (you can find them by searching for front panel reference).

Wiring is still the best solution, but there are a few other options.

Rob
0 Kudos
Message 5 of 5
(2,855 Views)