LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Boolean doesn't work when manually pressed

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

Download All
0 Kudos
Message 1 of 8
(3,935 Views)

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

0 Kudos
Message 2 of 8
(3,926 Views)

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

0 Kudos
Message 3 of 8
(3,909 Views)

Perhaps you disabled this button?

0 Kudos
Message 4 of 8
(3,905 Views)

Unless you're implementing a highly advanced interface, having to unlock the front panel means you're doing something wrong.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 5 of 8
(3,899 Views)

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....

0 Kudos
Message 6 of 8
(3,892 Views)

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

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 8
(3,855 Views)

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!

0 Kudos
Message 8 of 8
(3,841 Views)