LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can you create a local variable from a boolean control?

I want to create a local variable from a boolean control, but it says that boolean latch actions are incompatible with local variables, but I need a way to check this boolean control in two differents loops, how can I do it?
Message 1 of 8
(19,722 Views)
Hi,
yes, you can not use local variables of controls which have mechanical action equal to:
latch when pressed
latch when released
latch until released
If you need to use local variables you must change mechanical action to appropriate one. To do it right-click on the button on front panel and go to "Mechanical Action->" submenu in drop-down menu.
But in this case you have to write your own code for simulating of latch actions.

Good luck.

Oleg Chutko.
Message 2 of 8
(19,722 Views)
"Graci" schrieb im Newsbeitrag
news:5065000000080000005CA70000-1042324653000@exchange.ni.com...
> I want to create a local variable from a boolean control, but it says
> that boolean latch actions are incompatible with local variables, but
> I need a way to check this boolean control in two differents loops,
> how can I do it?

Use global variables.
Compare them with a constant Boolean like F or T.
The result is true or false and then you can use it in a Cae-Loop.

Martin
0 Kudos
Message 3 of 8
(19,722 Views)
and how do you do that??

I am having the same problem....
0 Kudos
Message 4 of 8
(19,722 Views)
Look back at Oleg's answer. In many cases you can use switching rather than latching. Then your local variable should be able to work.
Message 5 of 8
(19,722 Views)
sorry but I don't know the difference between switching and latching.

Sorry but I am not an expert in LV.

I don't know how to solve tihs problem and I am posting it here to get some help.
0 Kudos
Message 6 of 8
(19,722 Views)
I expect that switching will work fine for your application. Try changing the boolean control to switching (you do this by right clicking on the control and selecting the appropriate switching action). Most likely this will work for your application. Just make sure that you change the value back once it has been read. If you need further help it would be beneficial to have more information about what you are trying to do and post the code that you have so that we can see where you may be going wrong.
0 Kudos
Message 7 of 8
(19,722 Views)
thanks it's working now...
0 Kudos
Message 8 of 8
(19,722 Views)