LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

simple doubt on how to control mouse down event

Hi all,

 

I just have a doubt regarding the vi that I have attached with the question.

 

 When I press the ok button, I need to choose  from the input data. If the boolean is false, it is the parameters with A that I have to choose and B otherwise. But since there is a loop that I have to execute in the event structure, during the executing after I press OK, I am not able to edit anything in the screen until the loop finishes. How do I allow that? Because, I should be able to type in values in the boxes when an execution is still going on and if I press ok in the middle, I should be able to start with the new execution. 

 

 Thanks in advance,

VJ 

Download All
0 Kudos
Message 1 of 2
(2,359 Views)

What you are seeing is by design. The event structure waits until the loop completes because it's waiting for the loop to generate data on the wires coming out of the loop, and that doesn't happen until the loop ends. If you want to be able to read the Stop button while you're inside this inner while loop you have to uncheck the "Lock front panel until the event case for this event completes" option when configuring the event. Right-click on the event case and select "Edit events handled by this case...". You will see that checkbox at the bottom of the dialog.

 

That, of course, is the "quick fix". The proper fix is to not do it the way you're doing it.  You should not have a long process inside of an event structure. If you're going to do something like that, you should set up a producer-consumer architecture


Also, you may want to consider acting on the MouseUp or ValueChange event rather than the MouseDown. This allows someone to "change their mind". 

Message 2 of 2
(2,352 Views)