09-11-2014 03:54 PM - edited 09-11-2014 03:55 PM
I frequently do something like this for indicators on a panel, as you can see the block diagram gets messy and it takes up a lot of space.
There has to be a better way.
Solved! Go to Solution.
09-11-2014 04:02 PM
09-11-2014 04:28 PM
The indicators are gauges in a tabbed interface, one tab for each device under test.
I really do not like the look of an array of gauges, besides all of the array elements have to be identical and we need different scales on each.
This I will have to think about...
09-11-2014 09:05 PM
Use the value of the tab control and array subset. Basically get a subset of your array from 5*<tabindex> with a length of 5, and then wire those 5 up to your gauges on the front panel. Don't actually use the tab control to switch screens. And at that, you might just use an enum to select which set of gauges you want. Depending on the timing of your program you may want to cache the entire array in memory (shift register, local, something) and use an event structure to handle value changes of your selector.
If its important to have other data on each tab besides what you've shown here, I'd do the array->cluster conversion on a reshaped array (1x25 array->5x5 array->5x5element cluster)
09-11-2014 09:46 PM
Re: "messy and it takes up a lot of space"...
The attached VI tries to improve the "messy" array indexing with a reusable sub-VI.
Unfortunately, individual control terminals are still present.
If you like this approach, but it doesn't work because the GUI employs nested tab-controls, the sub-VI can be modified to handle that.
09-12-2014 09:15 AM
Yeah go with array subset. Break up the array into 6 arrays, one for each group. Or you can use decimate if you want to get the one signal from each group that represents the same signal. Then when displaying you have have an array, or a cluster for each tab.
There's also options using control references, getting them by name can make things simpler in the code. But be sure and leave lots of comments stating references are being found dynamcially otherwise the next developer maybe confused.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-12-2014 10:12 AM
You could also use auto-indexing with a case structure to have a cleaner diagram.