02-23-2019 09:06 PM
I have come across a very weird problem that I do not understand. When I manually press one of the boolean's in my VI while it is running, if changes from true to false on the interface but the program does not read it. In the images attached, you can see that the button labeled Run Scan in one image is true, in the other is false but the probes I have put in do not recognize this at all.
One other test I did was to add a local variable outside of the while loop which is turned true upon the initialization of the VI. When I do this, the loop runs perfectly, so I don't understand why it won't detect the button press when it is done manually.
Thanks
02-23-2019 09:20 PM
I should also include that the box on event structures labeled "Lock panel" is not checked. And all of the other buttons in the VI are fully functional. This is the only loop which is having the problem.
Thanks
02-23-2019 10:01 PM
You attached a picture. We cannot "execute" a picture. You are saying that a Boolean Control doesn't work. Boolean Controls have been around in LabVIEW for probably 30 years, they work! Do you know that Boolean Controls have "mechanical actions"? If you had attached your VI, we could right-click it and examine its Mechanical Action, and explain why it was (correctly!) behaving the way it was. I'm guessing you have a square button with the Latch when Released mechanical attribute (but I can't tell since you didn't attach your code).
Learn about Boolean controls. Learn about Mechanical actions.
Bob Schor
02-23-2019 10:21 PM
Perhaps you disabled this button?
02-23-2019 11:50 PM
Unless you're implementing a highly advanced interface, having to unlock the front panel means you're doing something wrong.
02-24-2019 12:59 AM - edited 02-25-2019 09:59 AM
We cannot help unless you attach the VI.
Seeing mostly local variables could hint at race conditions. How can we even tell if a button with the label hidden and having a "run scan!" boolean text really is the same as the terminal labeled "run scan" seen on the diagram.
Also "tick count" is relative and does not give you anything resembling a "Step Start time". That indicator does not display anything useful (and even has the wrong representation!), so I guess this is just another scaffold for another local variable, useless to the operator otherwise. Learn about shift registers....
02-25-2019 09:33 AM
If you press PrtScn you'll get a 1Mb image instead of photographing it ...
As you have a wait(5000) it's atleast 5 secs between reads of the button status, and that's assuming nothing else modifies it in your code, which we know nothing about.
/Y
02-25-2019 10:37 AM
Your loop with buttons is not running - the time when the probes were read are the same on both screenshots.
My guess: it has read stop=true from local variable before it has been set to false somewhere else. Race conditions!