LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Manuel and Auto switches

How can I make a boolean or switch that can be turned on manually then turned off automatically based on the value of some number? I'm using LabView2014

0 Kudos
Message 1 of 15
(3,893 Views)

If you want a button to remain depressed even after LabVIEW reads its value, then make sure it has a "switch" mechanism (Switch when Pressed, Switch when Released, etc.). This can be changed by right-clicking on it and selecting the mechanical action. A "latch" mechanism will reset the value after it is read.

 

Now if you later want to write to the button control, when your value condition is triggered, then you have several options. You can use a local variable, or a value property, or write to control by index. However, these should never be abused. Do not continually write the same value over and over in a loop, as this will hog the CPU. Also, do not allow for your code to be reading from and writing to the control at the same time, this is known as a race condition and can lead to very hard to find behaviors.

0 Kudos
Message 2 of 15
(3,881 Views)

Ok, the switch when released makes sense. The part I can't seem to get working is the switch release based on a boolean value. I'm probably going about this all wrong because I'm not a real programmer, just a faker :)... But I've managed to get most of the system working except this final part.

 

The system I'm working on uses FieldPoint modules to run lab equipment such as scales for weighing fuel, and pumps that sample fuel exhaust.

 

When fuel weight reaches zero (or near it) the pumps need to shut off and stop sampling.

Snippet attached of what currently exists.

 

Thanks for your guidance

0 Kudos
Message 3 of 15
(3,845 Views)

Here is an example that will reset the push button.

  1. Push the button
  2. Increase value of numeric so it is >= 5
0 Kudos
Message 4 of 15
(3,841 Views)

Can't open the VI, I'm using LabView2014 😞

0 Kudos
Message 5 of 15
(3,837 Views)
0 Kudos
Message 6 of 15
(3,830 Views)