Jump to content

Problem using "Two Button Dialog"


Recommended Posts

Hi everybody,

Sorry for my poor English, I'm a french student in internship. I don't master Labview. I have a problem using the "Two Button Dialog". I need to design an application to verify hardware specifications.

What I want to do, is to prevent the user from stopping the VI before the end of the process: I want him to confirm that he wants to stop the VI. So for example, I have two buttons: the first one is used to Close Labview, the second is used to Stop the VI. I have added two Button Dialog with different messages to manage the differents cases.

When I execute the VI, the messages appears and when I click "Ok" to confirm the stopping or closing of Labview, it works. The problem is when I click on "Cancel". The dialog box is closed, and the VI seems to continue working but the User Interface is blocked. I can't click on the buttons or modify a value anymore...

There is a sequence diagram with a while loop in. In the while loop, i have an event struture. It is in this event structure that are managed the click events.

Thanks for your help.

Coco

post-4586-1143631532.png?width=400

Link to comment
When I execute the VI, the messages appears and when I click "Ok" to confirm the stopping or closing of Labview, it works. The problem is when I click on "Cancel". The dialog box is closed, and the VI seems to continue working but the User Interface is blocked. I can't click on the buttons or modify a value anymore...

Strange. Maybe after that event something executes and takes the control of the UI thread. Or perhaps you have a hidden dialog somewhere... :blink:

Could you attach the whole VI?

Saludos,

Aitor

Link to comment

OK, I see the problem. You have two event structures, so the second one is taking control... but execution is still in the first frame, so it doesn't respond.

You can't [OK, too strict, you just probably shouldn't] have more than one event structure for one front panel. You'll have to remove one of them.

Saludos,

Aitor

Link to comment
OK, I see the problem. You have two event structures, so the second one is taking control... but execution is still in the first frame, so it doesn't respond.

You can't have more than one event structure for one front panel. You'll have to remove one of them.

Saludos,

Aitor

Ok thanks.. I thought it was possible because of my sequence structure.. So, if I understand, if I put a stacked sequence diagram, and place a event struture in the first part of the sequence, this event struture will be active for all the sequences of the sequence diagram?

Link to comment
Ok thanks.. I thought it was possible because of my sequence structure.. So, if I understand, if I put a stacked sequence diagram, and place a event struture in the first part of the sequence, this event struture will be active for all the sequences of the sequence diagram?

AFAIK, event listeners are active all the execution. So well, it's not impossible have two event structures, just a good advice. But if you have two or more event listeners (structures), and (like in your case) they listen for the same events, all of them will respond to that event, even if execution haven't reached their sequence yet.

In fact, you could just uncheck the "lock front panel" option in the second event structure's registered events, so the FP won't hang. But I think that's not a good solution because when you reach the second event structure, you probably will already have a waiting event. Since that the "just one event structure" advice.

Saludos,

Aitor

Link to comment
AFAIK, event listeners are active all the execution. So well, it's not impossible have two event structures, just a good advice. But if you have two or more event listeners (structures), and (like in your case) they listen for the same events, all of them will respond to that event, even if execution haven't reached their sequence yet.

In fact, you could just uncheck the "lock front panel" option in the second event structure's registered events, so the FP won't hang. But I think that's not a good solution because when you reach the second event structure, you probably will already have a waiting event. Since that the "just one event structure" advice.

Saludos,

Aitor

Thank you for your advice. My VI runs correctly now. Thanks

See you

Coco

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.