ni.com is currently experiencing issues.

Support teams are actively working on the resolution.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Best way to handle several events that may occur simultaneosly

Hi all,

 

I have an application vi in which I need to take care of several user generated events like menu bar selections, mouse clicks on controls (both single & double clicks) and many more.Also, all these events can occur simultaneously.Which would be the best method or architecture to handle all these events with ease?..All suggestions are welcome.

 

Can I use dynamic event handling for this?..If so,how can I implement it? (I went through several documents & examples for dynamic handling but none of them explained properly in this context).

0 Kudos
Message 1 of 6
(2,543 Views)

Using producer consumer with event structure in producer loop. Event has a built-in queue and user will not miss any events.

0 Kudos
Message 2 of 6
(2,542 Views)

@mnx wrote:
[..] several user generated events like menu bar selections, mouse clicks on controls (both single & double clicks) and many more.Also, all these events can occur simultaneously.[...]

Hm, can you enlighten us how a user will create these events simultaneously?

Or maybe i am a bad user as i always use either mouse OR keyboard to control an application, most often not both the same time (starting different "events" concurrently).

 

Beside of this discussion, Producer/Consumer is a very good starting point to address this kind of requirement, as already stated above.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 6
(2,538 Views)

Hi Norbert_B,

 

There are events in my application which can get triggered automatically due to the application state while in run and in addition to this there are several user events like mouse clicks etc. (simultaneous: "user generated"+"on the fly by application state"). Now the thing is suppose if the user has generated an event and while processing the same if any other event occurs, I should not miss any of those events. Also the processing has to be smooth and the vi should be able to accept any new events while processing the previous events without any hassles.

0 Kudos
Message 4 of 6
(2,530 Views)

Ok, i understand your point of concurrent events.

Nevertheless, you should limit the number of possible events by disabling controls for the user. Simple reason: When using programmatic events, you are most likely working of some kind of "sequencer". Once an automatic sequence runs, only certain controls are still relevant for the user (e.g. Break/Stop/Quit buttons), but most controls (e.g. configuration controls) SHALL not change their values once the sequence runs....

 

Still, look into producer/consumer.

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 6
(2,525 Views)

Can you please post a simple architecture vi which handles both types of events together using a producer-consumer loop and can be used in this context? 

0 Kudos
Message 6 of 6
(2,519 Views)