LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Sending data from one VI to another

Solved!
Go to solution

My test application consists of several VI's. One of them is just for entering/editing test information, e.g. tester's name, date, DUT model names and serial numbers etc. Another is for entering test equipment data (serial numbers, calibration due dates, VISA resourse names etc). Third is for measurement settings (frequencies, power limits, timing, etc). And I have Calibration, Measurement and Reporting VI's which use the entered data.

 

What's the best way of communicating between these VI's? I use global variables, but every now and then I read in this and other forums that overusing variables is bad practice and should be avoided.

0 Kudos
Message 1 of 5
(2,473 Views)
Solution
Accepted by topic author Arkady_V

The best way is to use wires in cases where the data dependency created by the wires is accepatable.  In your case it is not only acceptable beu mandatory. You cannot run the test until the paramters have been entered.

 

I would suggest a state machine architecture with states which call the various subVIs. The data can be passed on shift registers from one state to the next.

 

If parallel execution is required for portions of the program, then wiring will not work.  A functional global variable or Action Engine may be prefereable to the global variables.  Queues are also a good way to pass data to a parallel loop.

 

Lynn

Message 2 of 5
(2,464 Views)

Thank you, Lynn! It seems to me the state machine can be appropriate solution.

0 Kudos
Message 3 of 5
(2,456 Views)

It wasn't mentioned, but I would recommend grouping all of your parameters into clusters to make wiring from VI to VI a lot easier.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 4 of 5
(2,439 Views)

Thank you. Yes, I did it, and then saved clusters to Globals.vi. 

0 Kudos
Message 5 of 5
(2,428 Views)