09-28-2017 10:08 AM
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
09-28-2017 10:12 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2017 10:15 AM
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.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-28-2017 10:16 AM
That is where OO is for. It would fit perfectly.
09-28-2017 10:52 AM
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.