03-01-2012 04:03 PM
Hello all,
I am trying to figure out how to send a command to a Boolean to make it switch based on a met condition.
What I have is a Button 1 that is going into a case statement in order to run a desired function. But I want to turn it off based on the conditions of another function, in this case a while loop running a mathematical function that stops when it meets the specified condition of less than 20.
When that happens I want to turn the Boolean button going into the case statement to False to stop the function inside the statement, but I also want the button to still have user control. This way the program will self monitor and but also be controllable. I have played around with a lot of options but haven't been able to figure one out.
Any help is much appreciated.
03-01-2012 04:15 PM
@whitenun wrote:
Hello all,
I am trying to figure out how to send a command to a Boolean to make it switch based on a met condition.
What I have is a Button 1 that is going into a case statement in order to run a desired function. But I want to turn it off based on the conditions of another function, in this case a while loop running a mathematical function that stops when it meets the specified condition of less than 20.
When that happens I want to turn the Boolean button going into the case statement to False to stop the function inside the statement, but I also want the button to still have user control. This way the program will self monitor and but also be controllable. I have played around with a lot of options but haven't been able to figure one out.
Any help is much appreciated.
Would be nice to see the VI in question. There are various ways to remotely "turn on" a Boolean control -- one way is to create a Local Variable for the control (right-click the control, chose Local Variable), the other is to create a Property Node and wire to the Value property.
However, you say you want to change a Boolean button going into a case statement to stop the function inside the statement. I'm not sure quite what you mean. If you are already inside the Case statement, then changing the button won't change the behavior of the Case until the next time you execute it.
03-01-2012 05:06 PM
I built a small basic program to illustrate what I am talking about. My actual VI I am trying to make has a lot more stuff that may just distract.
Anyway, what is going on is there is a State of Charge while loop with various indicators. When the State of Charge percentage reaches less than 20, the loop ends. When that happens, I want the boolean to send a fase to the case structure. In this case while the loop is running, the case outputs a 3. When the loops stops, it outputs a 1.
Hopefully this is more informative of what I am trying to accomplish.
03-01-2012 08:53 PM
Your upper case structure only runs one time, right when the program begins. So I don't know how you plan on changing that boolean. It seems you are lacking the concept of how data flows in LabVIEW. I would recommend looking at the online LabVIEW tutorials
LabVIEW Introduction Course - Three Hours
LabVIEW Introduction Course - Six Hours