Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

How to program a CheckBox-Field (31 boxes) and using it as input of a SubVI ?

I would like to program a SubVI.

It should be used as "manual" input-VI with check-boxes (true-false-values) and as "automatic" input-VI with an array of booleans (true-false-values).

 

I would like to klick 31 check-boxes and create a 32-bit integer out of that "manual" input created by that check-boxes.

Each selected check-box represents a "1" (binary) and every unselected check-box should be a "0" (binary).

The "1st" check-box should have the value "2"="2^1" (integer).

The "2nd" check-box should have the value "4"="2^2" (integer).

The "3rd" check-box should have the value "8"="2^3" (integer).

... and so on ...

The "31th" check-box should have the value "2^32" (integer).

[I am using the exponent "^2" for easy writing. - No other reason.]

 

I attached two VI's in which I attempted to realize some (only the "manual-input") of the wanted/liked functions.

In both VI's I realized only a 8 check-box solution. Because if it would work a 8 check-box solution, than I could implement a 31 checkbox-solution.

If possible I would like to use the VI for (1) manual-check-box-input and for (2) automatic-boolean-array-input.

Maybe I need two VI's but I would like to avoid that.

 

It would be great I you would have a solution for me.

Thank you.

Download All
0 Kudos
Message 1 of 2
(2,941 Views)

You could start with an array of Booleans and just wire it to the Boolean Array to Number function. If for some reason you want to keep the individual Booleans, use the Build Array.

 

Also, in the future, you would want to post similar questions to the LabVIEW board since this has nothing to do with instrument control.

Message Edited by Dennis Knutson on 03-05-2009 10:18 AM
0 Kudos
Message 2 of 2
(2,938 Views)