12-15-2017 10:07 PM
Hello,
I have an array of "n" waveforms I got from a cDAQ device, each with their own channel names.
I am trying to create multiple checkboxes with n elements with each bolean text containing each channel names. The "n" elements of the checkbox should resize when sometimes there are 3, 4 or 5 waveforms.
Should I use a cluster? How do I change the bolean text and checkboxes elements programmatically?
Solved! Go to Solution.
12-15-2017 10:18 PM
Use an array of clusters, each cluster containing a checkbox and a string indicator for the name, then resize the array and array container programmatically as needed.
12-16-2017 05:34 PM
12-18-2017 08:05 AM
If you are working with a chart, you can use a Waveform Data type and show the selection check marks in the plot legend. NI DAQmx will automatically set the "NI_ChannelName" attribute of the waveform and as long as the "ignore attributes: is NOT checked, what you asked for will be automatic, no code required.
Ben
12-18-2017 10:09 AM
altenbach escribió:
Here is a very simple example
Thank you so much, It is just what I needed.
12-18-2017 10:38 AM
OF course you should "disable, not greyed" the string so it acts more like an indicator and cannot be modified by the operator at run time. Only the checkbox should be enabled. Modify as needed.
If the array size can get big, it might be better to enable the scrollbar and keep the number of visible elements constant. A control that changes it's size significantly at runtime is often not compatible with a nice UI. (e.g. You suddenly might get overlap or it might extend outside the visible front panel area.)
12-18-2017 12:19 PM
You may also be interested in doing this with a single column listbox, showing a checkbox as a selection item in the form of a glyph. Here is a demo showing how this can be done.
Of course a normal listbox can be used for multiple item selection too but I prefer the checkbox for the UI rather than using CTRL for multiple item selection.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord