07-07-2025 09:58 AM
Hello,
I want to do a continuous loop, that changes the value of valves over and over again. I want to be able to stop this loop by pressing the boolean again and switch it to off. But once my loop is running, the boolean cant be pressed anymore.
Could you maybe help me?
Thanks so much in advance!
07-07-2025 11:19 AM
I'm guessing that you are also very new to LabVIEW (I know you are new to the LabVIEW Forum). Here are some suggestions to both help you in getting started with LabVIEW and in helping us to help you:
Bob Schor
07-07-2025 11:21 AM
Most likely, your event case is set to "Lock panel until the event case completes". This mean the user cannot interact with the front panel until that event case is complete, keeping you from being able to press the button.
Architecturally, there should never be a "long" running task inside of an event case. A basic state machine may be good enough for what you are doing.
07-07-2025 12:21 PM - edited 07-07-2025 12:23 PM
We don't "do" pictures of code because it is impossible to see the whole picture (sic) 😄
All we can see is a lot of "code smell" (yes, pictures can smell)
so please attach your actual VI and I am willing to take a look. I won't just widely guess because there can be tons of reasons.
07-07-2025 06:21 PM
@crossrulz wrote:
Most likely, your event case is set to "Lock panel until the event case completes". This mean the user cannot interact with the front panel until that event case is complete, keeping you from being able to press the button.
Architecturally, there should never be a "long" running task inside of an event case. A basic state machine may be good enough for what you are doing.
I see the "Lock panel until the event case completes" being frequently cited as the issue. I prefer to think of that as a symptom and not the problem. The real problem is simply that you aren't doing it right.
07-08-2025 07:54 AM
Hello, sorry yes I am new to Labview and this community. I got the main part of the code from a supervisor (which doesnt have time to explain anything further) and wanted to adapt this code. And apparently it went wrong 😄
I dont know why there are so many pointless local variables, i was just attempting to get my code running.
Here I will share it code, I hope that you can help me with the "Loop feeding".
Thanks a lot!
07-08-2025 09:21 AM
Please take enough of the LabVIEW Tutorials (see first page of the Forum, I think there's something called "Learn LabVIEW" or something similar).
Did you notice there are two "styles" of Boolean controls on your Front Panel? Boolean controls have a "Mechanical Action" (there are 6 varieties of such actions). If you right-click a Boolean control, you can examine its Mechanical Action properties, with a nice diagram that explains them. Rectangular ones typically have "Latch when Released" -- this means that nothing happens until you release the button, at which point it stays "pressed" (or True) until you read it, when it resets to the "default state" (almost always "False"). This makes them ideal for Event structures -- if it triggers an Event, then it went from False to True, and them moment you read it in the Event structure, it resets itself to False (so you don't need a local variable to do that -- LabVIEW does it for you.
The Oval buttons, by default, are "Switch when Pressed". That means, "one push to turn on, a second push to turn off". (They also have a little Light that comes on to remind you to turn them off). If you want them to turn themselves off, replace them with a Square Button (maybe the OK button), but give it a new name (Flush Chamber?) and edit its "image" so it says "Flush Chamber".
That's one small lesson. Go learn more.
Bob Schor