03-26-2010 04:51 AM
Hey,
First the event structure should be in a while loop. If you're not too familiar with event structures, I recommended doing a bit of research on the knowledge base on the structure. They're not as simple to use as the other structures.
If you want to test your code, remember to make that timeout time a little longer, say 5000ms, otherwise you'll consistantly get that dialog box telling you there's timeout.
Hope this helps
Jevon
03-26-2010 05:03 AM
Your while loop will never display a message to the user, as Coq mentioned since the check is always false (You've just written an advanced False-constant).
The event structure has a 100ms timeout meaning it'll loop once after 100ms and never again (unless you manage to press the button before that), so chances of it handing your button press is slim, or you'll have to be very fast.
/Y
03-26-2010 05:58 AM - edited 03-26-2010 06:02 AM
Yes, Jevon, it helps (while loop), thanks.
Yamaeda, thanks!
Is there any way to restore standard handler for event when leaving Event Case Structure?
And why labview vm deletes all event handlers for all objects thus we replace only one of them after leaving the structure?
03-26-2010 06:48 AM
03-26-2010 07:12 AM
Hi,
I was just checking your code, as due to empty array the search array always return -1 your code always execute the false case.
The problem of hanging arises after you press the button is due to event structure. when you generate an event which is registered( in your case in event sturcture), Labview locks the front panel to generate any further events. thats the reason why your application looks like hanged. Right click on event structure and click on edit events handled by event structure. you will see lock front panel on the bottom of the window, uncheck it. and run your program again you will not see the hanging issue. but the events are buffered in the labview memory, since your program will never go to true case with loop iteration "0"
Regards
....
03-26-2010 07:38 AM