Jump to content

User dialog loop locking up...


egraham

Recommended Posts

Hi, I'm new to LabVIEW and I've been working on this one for hours before coming here for help. I've created a switched start button that generates a dialog before performing an action. If the user selects "yes" it signals a case structure to do something - in this case hold a boolean value true. If the start button is pressed again it turns the boolean indicator off and waits for the start button to be pushed again.

In the case that the use selects "no" at the dialog, the switch should reset to default (false) and wait for the switch to be pressed again.

I've got the whole thing working except for when the user selects "no". When that happens, the switch resets to default, but then it locks the entire VI. I'm not sure what else to try at this point. I've tried using a local variable instead of an invoke node to reset the switch, but it doesn't help. What perplexes me is it doesn't lock up when the user selects "yes" and then turns the switch off.

Any help would be greatly appreciated. Maybe I'm going about this the wrong way?

Link to comment

You have an event structure that is registered to handle the value change of the OK button. Any time that button changes values, you must give the event structure a chance to run. Until the event structure gets a chance to handle the event, no further UI events can be processed. The way you have your code set up, when the Start button changes to True and then you hit No in the dialog, the event structure never gets a chance to execute.

Here's a revised version of your VI:

Download File:post-5877-1200633606.vi

It is not completely what you want -- the inner loop won't stop if you click the small stop button.

Link to comment
QUOTE(Aristos Queue @ Jan 17 2008, 09:03 PM)
Hey, thanks. I think that will do. I really don't need a stop button on the main loop because for this VI as long as LV is open, the loop should be running. I'm starting to understand event structures. I thought if it existed in a case structure that was never called that it would be ignored. I see that's not the case.By the way, I think I got the inner loop to stop with the stop button. See attached.
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.