LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

number to boolean array problem

I am tring to program a programmable attenuator using a number to boolean function.  It looks like a default number to boolean array function counts in binary (1, 2, 4, 8, 16, 32, 64, 128).  If I were to choose 8, for example, it will turn on the 4th bit.  This would be great if the attenuator (HP11713A) was able to be programmed like that.  The unit in question counts differently (1, 2, 4, 4, 10, 20, 40, 40).  So if I were to send and 8, the unit would receive only the 4th bit on, instead of the 3rd and 4th bits on.  There has got to be a way around this within Labview.  If I bang my head against the wall anymore, I may not be able to show up to work tommorow...Smiley Mad
 
I can send an image to make more sense if needed.
 
Thanks for taking a look! 
Message 1 of 8
(3,492 Views)
The 3rd and 4th bits on would be 12, and I don't see that in your list, and I also see 4 show up twice. Are you looking for a front panel control to use? One way to do what you want is to use a menu ring in which you define the actual values corresponding to the items in the menu ring. This is easily done by right-clicking on the control and selecting "Edit Items..." In the dialog box uncheck the "Sequential Values" checkbox, and specify the numeric values you actually want in the "Values" column. In the "Items" column just specify whatever text you want to display as the menu item.
Message 2 of 8
(3,482 Views)
I used one of these years ago... I used a look up table then, this time I upgraded... LV 8.0
In case you are using an older version, see pic

smercurio_fc Sorry about the neg. rating hit no rather than post options. it was an accident. 

Message Edited by Stradis on 08-27-2007 06:22 PM


Paul
Download All
0 Kudos
Message 3 of 8
(3,474 Views)
clipped the diagram.  Sorry

Message Edited by Stradis on 08-27-2007 06:27 PM


Paul
Message 4 of 8
(3,465 Views)
I think this might work (or at least give you an idea).
Message 5 of 8
(3,457 Views)


@novajeeper wrote:
It looks like a default number to boolean array function counts in binary (1, 2, 4, 8, 16, 32, 64, 128). 

The number to boolean function does not "count". It is a well defined atomic function and there is no "default" behavior from which you can deviate at will. If you need to randomly map values to bit patterns, call the function something else. 😉

How many possible input numbers do you have? Can you give a few more examples for input vs. desired it pattern?


@novajeeper wrote:
I can send an image to make more sense if needed.

Yes, please do.

Message 6 of 8
(3,446 Views)

Thanks Matt and Stradis!!

This is exactly what I was looking for and works like a charm!    I'll be combining both designs for error handling and simplicity.

Thanks to both of you very much!!

0 Kudos
Message 7 of 8
(3,406 Views)

Hi All,

Can anybody save the attached VIs in 7.1 ? I ve back-saved upto 8.0 using 8.5 eval...

- Partha ( CLD until Oct 2027 🙂 )
Download All
0 Kudos
Message 8 of 8
(3,382 Views)