From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
04-08-2019 08:16 AM
Hello again, you marvellous people!
I have what I hope is a simple question. I'm not including the VI because it's not really relevant (I think).
I have a boolean button controlling an LED, but I want a secondary control that, if I press it, changes the state of the boolean, irrelevant of which state it's in at the time (i.e. if it's off, turn it on, if it's on, turn it off). Kind of like a "Not" gate, but without an input.
This seems like it should be a simple thing but I cannot for the life of me figure out how to do it.
Solved! Go to Solution.
04-08-2019 08:32 AM
You want the NOT function on the boolean palette and apply it to its current value.
04-08-2019 09:46 AM
If you XOR the two controls you will get what you need.
0xDEAD
04-08-2019 10:16 AM
@kathmonkey wrote:
Hello again, you marvellous people!
I have what I hope is a simple question. I'm not including the VI because it's not really relevant (I think).
I have a boolean button controlling an LED, but I want a secondary control that, if I press it, changes the state of the boolean, irrelevant of which state it's in at the time (i.e. if it's off, turn it on, if it's on, turn it off). Kind of like a "Not" gate, but without an input.
This seems like it should be a simple thing but I cannot for the life of me figure out how to do it.
Your statement is ambiguous; specifically, which boolean are you referring to here: "changes the state of the boolean"? The button or the LED? I'm going to guess that you mean the button. If the button has a mechanical latching action, you can't* change it programmatically. If it's a non-latching button, you can write to it using a local variable, or a Value property node (but you may actually need to use the Value Signalling property).
* Well, OK, there is a way to do it, but you shouldn't.
04-08-2019 11:26 AM
P- node...read value, NOT value, set value. Now, let's talk about the boolean button. Is it a control or an indicator? What is it's mechanical Action ( I hope it is a switcher not a latcher)
We will get you straight yet!
04-08-2019 04:35 PM
Thank you everyone for your input. I ended up scrapping the whole system and starting from scratch from a different direction. Your suggestions were all excellent though, thank you!