LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

test user event

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

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

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

 

 

Download All
0 Kudos
Message 2 of 8
(2,823 Views)

hiiii,

 

thank you so much for your answer... but i have little problem with your VI, can you resend with version 11

0 Kudos
Message 3 of 8
(2,810 Views)

Sorry!

 

That should now work with version 11

Download All
0 Kudos
Message 4 of 8
(2,805 Views)

thaannnnnkss a loooot Smiley Wink

 

0 Kudos
Message 5 of 8
(2,781 Views)

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 

Download All
0 Kudos
Message 6 of 8
(2,751 Views)

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.

0 Kudos
Message 7 of 8
(2,746 Views)

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 Smiley Wink

0 Kudos
Message 8 of 8
(2,721 Views)