cocowk Posted March 29, 2006 Report Share Posted March 29, 2006 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 Quote Link to comment
Aitor Solar Posted March 29, 2006 Author Report Share Posted March 29, 2006 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... Could you attach the whole VI? Saludos, Aitor Quote Link to comment
cocowk Posted March 29, 2006 Report Share Posted March 29, 2006 ok thanks.. here are the main vi and its sub vis. Quote Link to comment
Aitor Solar Posted March 29, 2006 Author Report Share Posted March 29, 2006 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 Quote Link to comment
cocowk Posted March 29, 2006 Report Share Posted March 29, 2006 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? Quote Link to comment
Aitor Solar Posted March 29, 2006 Author Report Share Posted March 29, 2006 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 Quote Link to comment
cocowk Posted March 29, 2006 Report Share Posted March 29, 2006 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 Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.