04-18-2010 03:46 AM
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
Solved! Go to Solution.
04-18-2010 04:06 AM
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
04-18-2010 04:44 AM
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
04-18-2010 06:35 AM
Hi Danielle,
from what i understand what you try to do, something like the attached should work for you.
Mike
04-18-2010 06:45 AM
Thanks Mike, this is exactly what we were looking for!
Danielle
04-18-2010 08:54 AM
Dear mike,
Can you save it as a VI file? I have problem loading the VI example using snippet. Thanks!
04-18-2010 11:42 PM
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