LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically set the value of the switch back to false

Hello,
 
although we have a link (http://forums.ni.com/ni/board/message?board.id=170&message.id=216160#M216160), we still can't exactly see how to programmatically set the value of the switch back to false. Is there a kind of a property setting node?
 
Any help would be great! 🙂
0 Kudos
Message 1 of 5
(5,050 Views)

If you re using a latch action boolean, it ll automatically get set to False once the button value is read by your code, else it wont...

However, if you use a switch action boolean, you can use a local variable or a Value property node to set its value back to False.

The Value property node colur appears Green, if it is a Switch action boolean.

The Value property node colur appears Purple, if it is a Latch action boolean.

- Partha ( CLD until Oct 2027 🙂 )
Message 2 of 5
(5,044 Views)

Hello,

we found it ourselves. 😉

With selecting a boolean control in the block diagram, a new method node can be created which resets the control back to its standard value. 🙂

0 Kudos
Message 3 of 5
(5,044 Views)

It is nice to see you found it yourself.

But be aware that when you use a Method [Invoke] node, you somehow lose the control of setting the value by yourself in the code.

What you re using is the Reinit to Default method for a boolean.

Today, the default value of your boolean may be False. What if tomorrow another crazy developer sets it to True from the Rt Click menu option -->> Data Operations -->> Make Current Value Default ?

So. you cannot be sure what is the actual default value for that boolean [ for that matter, any control/indicator ].

So, it is better to use locals to set back to the value of our wish [ anywhere we want in the code].

Run the attached Vi & see to it...

- Partha ( CLD until Oct 2027 🙂 )
Message 4 of 5
(5,038 Views)
Property nodes: Value, Value (Signalling)

Or use a Local.

Regards,

Wiebe.


0 Kudos
Message 5 of 5
(5,036 Views)