LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass different clusters from multiple Sub-VIs to Main-VI

Hello there,

I am working on an application that runs different tests on a device, for each test I have created a specific sub-VI which ultimately generates one result cluster. As each test case has its own set of samples, I have to create a distinct cluster for each case. The results of the latter are to be displayed on the GUI of the main-VI, all test results have to be shown consecutively. What options do I have when it comes to passing multiple clusters from their respective sub-VIs to the main-VI? Any help would be appreciated!

 

Regards

 

Philip

0 Kudos
Message 1 of 5
(2,449 Views)

Well if you aren't using type defs, you should be.  You can have a typed cluster for each sequence output then you could have a single master cluster, which is a type def containing all the other sequence clusters.  Then a bundle by name can bring all the sub clusters into a single master cluster.

 

Then if you need to update the output on a subsequence cluster you change it, and the type def'ed clusters will all be updated.  It is really the purpose of a typed cluster that updating it in one place updates it in all the places that call it.

 

Another option might be to have a unified output that all subsequences can return.  I've seen some that are a 1D array of Signals, and a 1D array of Values which each subsequence just updates adding new values to it.

Message 2 of 5
(2,446 Views)

Also these clusters of clusters of clusters can get kinda complicated and large, and that is where object oriented code can help out a bit.  Instead of clusters of clusters, you can create an array of objects, and each object can be a subsequence output.  These OO concepts with inheritance can be quite advanced and are concepts taught in CS and CE degrees but getting your toes wet with large clusters is a good start.

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

That is where OO is for. It would fit perfectly.

0 Kudos
Message 4 of 5
(2,442 Views)

Object Oriented is immediately where my mind went as well.  You can have an object for the test.  All tests inherit from the same parent test class.  Then just use dynamic dispatch to call the test you need.  This makes it very simple to add new tests since your top level VI will never have to change.  As far as showing your data, I find a table to work the best in these situations.


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
Message 5 of 5
(2,423 Views)