07-04-2013 07:16 AM - edited 07-04-2013 07:17 AM
Hi,
I use event structure for 2 events. Event #1 has an attached while loop. If I click on the button of event #2 or if I click once again on the button of event #1 Labview freezes without any respond.
I just want to run event #1 OR event #2 untill each of them stops THEN run the same event or another.
Please help,
Thanks, Gregory.
07-04-2013 08:22 AM
The general behaviour of the Event structure is it will lock the front panel when one event is executing and release it once it is done. Don't use while loop inside an event case, if you want to iterate you can use the timeout event (which automatically comes by default). Please post the code in 2011 version
07-04-2013 08:23 AM
This seems eerily similar this the problem in this thread:http://forums.ni.com/t5/LabVIEW/How-to-implement-single-and-continuous-run/m-p/2481312#M758418. You might want to go read up on that one.
07-04-2013 08:54 AM - edited 07-04-2013 09:09 AM
> Please post the code in 2011 version
Attach version for 10.0.
Thanks, Gregory.
07-04-2013 09:07 AM
Its still 2012 version
07-04-2013 09:20 AM
> if you want to iterate you can use the timeout event
What is "timeout event"? How can I use it here? Could you give an example?
> This seems eerily similar this the problem in this thread
If I understood rightly, the solution is "use loops", isn't so? 😃
I want to use event structure just to have immediate response to mouse click.
> Its still 2012 version
I used "File -> Save for previous version... -> Number". Here I tried to save in 8.6 version. Anyhow attach screenshots.
07-04-2013 11:23 AM
Hi Gregory,
The user interface is freezing because you have set the Event structure to lock the front panel until the event completes (right click on the title of the even structure, go to edit events for this case and look at the check box at the bottom). You could uncheck this - but then these clicks will be stored until the action loops stop, and then they will be run.
Alternatively, if you want to prevent the user from clicking on buttons while something else is happening, you can use property nodes to disable certain controls whilst the action loops are running.
To do this - right click on the icon of a control and "Create property node". One of the properties you can change is "Disable". Don't forget to turn them back on again.
Obviously, this would be a pain if there were lots of controls, but in this case, it should be OK.
Hope this helps,
David
07-04-2013 01:08 PM
Hey,
Check the attached vi. I'm not very sure what exactly you are trying to do but the vi i posted does whatever your vi wants to do without freezing labview. Also I have put some comments on the block diagram which may help you. I'm using the shift registers to detect the start and stop.
regards,
NitzZ
(Give Kudos to good Answers, Mark it as a Solution if your problem is Solved)