LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Numerical List Box to Boolean array

Solved!
Go to solution

Hello,

 

I have two listboxes. One of them has different frequences and the other one has difference voltages.

For each interation, one freq and one voltage should be seleted and the correspoding elements in the boolean array should be high.

 

 

Freq                   Voltage

100                        2

200  <                    4                                   ====>  0100 0010 

300                        6 <

400                        8

 

Does anyone know how to do the convertion from numerical listboxes to the boolean array?

 

Thanks!

0 Kudos
Message 1 of 9
(3,206 Views)
Solution
Accepted by tian66

Try this

 

 

 

Of course this assumes that the listboxes have exactly 4 elements each.

Message 2 of 9
(3,201 Views)

Thank you for your answer.

Actually there 5 frequecies and 8 output voltages.

But the the boolean array output is in an inner loop and the listboxes are outside of the inner loop.

How should I arrange these listboxes?

 

 

0 Kudos
Message 3 of 9
(3,191 Views)

Thank you. I got it. Please ignore the previous reply.

0 Kudos
Message 4 of 9
(3,187 Views)

I should have gone to Perdue...

 

Example_VI.png

 

They probably wouldn't have me 😄

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 9
(3,180 Views)

@jcarmody wrote:

I should have gone to Perdue...


Are you trying to get a honorable mention in the Rube Goldberg thread? 😄

 

(Also, the output is supposed to be a boolean array, not a U8 numeric.)

Message 6 of 9
(3,173 Views)

I found a problem for the listbox.

 

If the I just select two freq from the listbox, the indexes are always 1,2 but not 2,3.

How should I solve this problem because not all of the values in the listboxes will be selected.

 

Thanks,

Tianshu

0 Kudos
Message 7 of 9
(3,163 Views)

Well, you did not tell us that you allow multiple selections. Still, it should be easy to modify my example. Can you attach some simplified code.

0 Kudos
Message 8 of 9
(3,154 Views)

Try this:

 

 

Download All
0 Kudos
Message 9 of 9
(3,152 Views)