LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to poll a button twice

Hi Group

How do i poll the state of a boolean-button at two different positions in my
labview-diagram/chart?

Thanx

Frank
0 Kudos
Message 1 of 4
(2,918 Views)
Frank:

You can simply create a local variable (ON diagram: right click/create/local variable). Then right click on the local variable, select change to read. You can then place this local variable at any part of the diagram according to your need, as it will give you the latest state of your Boolean.
Hope this helps,

Santiago
0 Kudos
Message 2 of 4
(2,918 Views)
If the two locations in the diagramme are in the same loop etc. you just wire the output to both positions.

If they are in different loops you can use a local, however then you might miss clicks (race condition), if that is critical then you might want to use e.g. events, occurences or similar...

If they are in different VIs the closest solution is globals, however then you can get race conditions again. Using a VI-global is a better choice, see:

http://sine.ni.com/apps/we/niepd_web_display.DISPLAY_EPD4?p_guid=B45EACE3DB4956A4E034080020E74861&p_node=174821&p_submitted=N&p_rank=&p_answer=&p_source=External
0 Kudos
Message 3 of 4
(2,918 Views)
Thanx a lot it worked well and now I finally understand what locale
variables are for 🙂

Frank
0 Kudos
Message 4 of 4
(2,918 Views)