03-22-2013 06:44 AM
i need a help in my program,i am just biginner with labview and i don't know how user event work exactly so i want to make a simple program with event to understand how its working :
about my program i remark that just one event it working but two other event like stop not. so can someone look it in and tell me where is i am wrong.
my overall program is in " VI user event" but you need the other event so download all.
thaanks
03-22-2013 08:59 AM
Hi fzzohra,
The best way to deal with events is to use a queued message handler. This is basically where you catch all user events in an event structure, and pass it to another loop that does the processing. I have attached a simple example template to help you get going.
Queues are generally better than using notifyers as if you have data coming in too quickly you can miss events with a notifyer, whereas they will just be added to the end of a queue and done when the system has finished procesing the previous events.
Hope this helps
03-22-2013 09:22 AM
hiiii,
thank you so much for your answer... but i have little problem with your VI, can you resend with version 11
03-22-2013 09:27 AM
Sorry!
That should now work with version 11
03-22-2013 02:35 PM
thaannnnnkss a loooot
03-23-2013 08:21 PM
hiii,
I try to use your method and i do this test but i remark that just one event it's work but other no, when i run my vi i can give order to one event work and that's all when i try to change my order nothing change...and i don't know why.
can you look it please and tell me where i make the mistake.
thanks
03-23-2013 09:28 PM - edited 03-23-2013 09:45 PM
Several of your events have a True boolean wired up to end the producer/event loop as soon as they execute. I bet you only want to have the Quit Event to have a True boolean to end that loop.
One other thing, there is no need to register for LED APPEL value change and LED Command value change. They are indicators, so there is no way for a user to use them and have a value change event occur, and you aren't using any Value(Signalling) property nodes to programmatically fire the event.
It also looks like you have the potential for race conditions by the way you are using local variables to transfer data to the consumer loop.
03-24-2013 06:48 AM
hello,
thank you so much for your answer,i didn't remark that i make true for my loop in event struct for "appel" and "commande" so when i changed to false its workiiing now, also i remove like you said my register value change for "led appel" and "led commande".
and now all its workiing