LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how do I make a checkbox that allows numbers to be assigned to each boolean?

I would like to create a checkbox with 6 booleans named 1,2,3,4,5,6. Then, when the user checks, for example, box 1 and 3, I would like the numbers 1 and 3 to be passed into a while loop as controls, first running the loop with 1 as a control and then running again with 3.
How can I do this?
 
Thanks.
- josh
0 Kudos
Message 1 of 6
(3,276 Views)

Try this in 7.0 format. I put the checkboxes into an array control.

 

Message 2 of 6
(3,273 Views)
You can also do the same with a listbox when you set it to Array data type and selection mode of 0 or more. Then set it to show symbols and it will show a checkmark when selected. There are 20+ symbols that could be used.
0 Kudos
Message 3 of 6
(3,264 Views)
As any real programmer, unclebump starts counting at zero, not at one, of course. 🙂
 
Here's another possibility using a FOR loop. It eliminates the comparison operation in the loop and the trimming of the final array (at the cost of a conversion and summing operation). Note that I tap into the index AFTER the increment operation, so the indices are as desired.
 
 
Of crouse it would make more sense to pass the resulting array into an autoindexing FOR loop. Depending on your code, you can probably even do everything in one loop at once, just add your code to process each index into the existing loop of my example.

Message Edited by altenbach on 06-21-2006 05:27 PM

Message Edited by altenbach on 06-21-2006 05:31 PM

Download All
Message 4 of 6
(3,264 Views)

Hi Altenbach,

You have no idea how long it took me to get used to that zero index concept. I was a Modicon plc user for about ten years before using labview. The register bits are numbered 1 to 16 in the plc.

Message 5 of 6
(3,253 Views)

Thanks altenbach for the great help.

Starting from 1 was necessary since 1-6 represent filter positions to control an instrument.

Thanks again for the vi's.

0 Kudos
Message 6 of 6
(3,233 Views)