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,835 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,823 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,787 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,783 Views)

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

0 Kudos
Message 5 of 15
(3,779 Views)
0 Kudos
Message 6 of 15
(3,772 Views)

This works, thanks! Now to figure out how to configure it

0 Kudos
Message 7 of 15
(3,752 Views)

Do I need to put the FieldPoint device inside the case structure?

0 Kudos
Message 8 of 15
(3,751 Views)

Yes, with modification. You'll probably want to add another condition such as Value > 5 AND Boolean (meaning Boolean == True). The reason is that you don't want to keep writing a False value if it is already False.

0 Kudos
Message 9 of 15
(3,747 Views)

I'm stumped again. How can I get case structure to read the value coming from the Fieldpoint AI110?

0 Kudos
Message 10 of 15
(3,708 Views)