LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LV Front panel controls get locked

Hi! All,
I am developing a LabVIEW program password
verification.
Front Panel Controls do not respond and get locked
up. To regenerate the error do the following
1. Enter the password "employee1"
2. Press LOGIn button
3. Press CLOCK OUT button
After this the front panel controls gets locked and
does not take any value.

If you try to give the password as employee2 and
perform the above steps..the front
panel gets locked up.

The only case it keeps working is when password is
"employee1" and everytime "ClockIN"
button is selected.

The BD has an event case for the controls "Clock In" and "Clock Out".
I have tried to debug and everything seems right....is there a way I
can attach the snap short or the VI itself? If not then in case
anyone
wants to have a look at the VI can can send it to his/her email ID.
Any help is appreciated!!
0 Kudos
Message 1 of 7
(3,328 Views)
Assuming that you're using NI's Developer Exchange to post this question, there was an attach button on the screen that you could have used to include your VIs. You can still do this by responding to the post and agian you should see the Attach Files button. If you've got subVIs, don't forget to include them as well. The best way is to do a Save with Options and select Development Distribution. This will create a .llb file with everything.

Your problem could be several things. Maybe a subVI you call is in an infinite loop or you've got something wrong in the event structure. Do you have a single event structure or multiple?
Message 2 of 7
(3,328 Views)
Thanks for your help. I was posting the question from google before.
The llb is attached below.
0 Kudos
Message 3 of 7
(3,328 Views)
Try this version. I think it's about what you want and it doesn't lock up. The main thing I did was eliminate the second event structure (look into caveats on event structures in the on-line help) and redo the single one to have separate events for the clock in and clock out events.
0 Kudos
Message 4 of 7
(3,328 Views)
So if I understand it clearly then handling of multiple controls in one event was the cause of the deadlock as it was waiting for "Clock Out" value change event to occur and then again "Clock In" value change to occur? I thought that if I change the value of one of the controls it would exit the loop and move on to the next case as I was using State Machine concept.

Thanks for all your help and your informative email also.
0 Kudos
Message 5 of 7
(3,328 Views)
Hi software enigineer,

The reason your front panel is locking up is indeed because the event structure was set to handle more than a single event. In an event structure, when one event fires, it will lock up the front panel until that event handler is released. Since the event structure was set to handle both the "Clock In" and "Clock Out" events, the "Clock Out" event was locking up the front panel until the "Clock In" event occurred. In general, it is a good idea to only place a single event to be handled for each case of the event structure.

The modification to your program posted by Dennis Knutson above should fix your issue.

There is a useful KnowledgeBase that discusses front panel lock-up when using event st
ructures:
Why Does My User Interface Lock-Up when Using Event Structures?

Additionally, here are two helpful links at the bottom of that KB for more information about event-driven programming in Labvew that may prove useful:
Event-Driven Programming Technical Presentation
Event-Driven Programming in LabView

For a brief tutorial on Event Programming with further information on creating a UI state machine using the event structure, please refer here:

A Powerful New Tool for UI Programming--User
Interface Event Programming
.

Best of luck and happy programming!

Kileen Cheng
Applications Engineer
National Instruments
0 Kudos
Message 6 of 7
(3,328 Views)
Hello All,

I agree with KillenC response.

Sanaa TAZI
Application Engineer
National Instruments
0 Kudos
Message 7 of 7
(3,328 Views)