LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using booleans to change a large number of parameters

Solved!
Go to solution

Hi all,

 

We have a number of booleans. We want that when any one becomes TRUE, we would change a parameter in a different button.

 

If it was only one boolean, we would have no problem, but we have 36 such booleans. Does anyone have a way of programming this so that we don't have 36 nested IF cases? the booleans can become TRUE together.

 

To check if any boolean is true, we poll all of them in a while loop (they are hardware-connected and unfortunately the hardware is not built for interrupts, so polling is the only way).

 

Can anyone help?

 

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 1 of 7
(3,129 Views)

Hi Danielle,

where do you get the boolean values from? Is it necessary to poll them? You can use refnums from your controls. Build an array of all these refnums. With index array you can then set a specified value.

 

Mike

Message 2 of 7
(3,123 Views)

Hi Mike,

 

It is unfortunately necessary to poll them.

 

The problem is not setting the values, it is knowing to which control to set the value. We get a number of booleans, and we need to check which are true and set our controls accordingly. for example, booleans 1,6 and 20 are true, so we need to change controls 101, 106 and 120. Other then checking each of the 36 booleans in 36 parallel IF loops, are there any suggestions for how to determine which controls we need to change?

 

Thanks,

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 3 of 7
(3,114 Views)
Solution
Accepted by topic author dsavir

Hi Danielle,

from what i understand what you try to do, something like the attached should work for you.

 

Mike

Message 4 of 7
(3,106 Views)

Thanks Mike, this is exactly what we were looking for!

 

Danielle

"Wisdom comes from experience. Experience is often a result of lack of wisdom.”
― Terry Pratchett
0 Kudos
Message 5 of 7
(3,100 Views)

 

Dear mike,

 

Can you save it as a VI file? I have problem loading the VI example using snippet. Thanks!

0 Kudos
Message 6 of 7
(3,073 Views)

Joven wrote:

 

Dear mike,

 

Can you save it as a VI file? I have problem loading the VI example using snippet. Thanks!


It's not a snippet. 😉

 

Mike

0 Kudos
Message 7 of 7
(3,030 Views)