LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
altenbach

Option to discard stale entries in the event queue

Status: Completed
Implemented in LV 2013

Currently problems occur with "analog" type events (value changed of a slide, cursor move, etc.) because too many intermediary events will be queued up. If the event case takes any finite amount of time to execute, we get a huge buildup of events.

 

A very illustrative example and a possible workaround can be found here. While the workaround works well for unique cases, it gets complicated quickly if event cases are shared by several controls (e.g. "graph cursor move" or "slide value changed" in the same event case).

 

What we need is an option to set the queue size of the event queue for each unique event. For example if a value change event occurs on the slide, and the same event with a slighly older value already exists in the event queue, the new event should overwrite the old event, keeping the queue at size=1 for that particular event. It should not touch queued up events of other controls, etc. of course.

 

Most likely we only need two choices: (1) infinite queue (current behavior), (2) single element queues (only the newest event of each configured event is kept in the queue). It could be implemented with a checkbox on the event configuration dialog e.g. : "[x] Discard stale events".

 

Of course if should be configurable for each unique event, not just for each event case.

 

(This idea is along the lines of Marc's idea here  and would also potentially provide a solution for Shane's xcontrol problem). 

21 Comments
JackDunaway
Trusted Enthusiast
FYI, a lossy queue (think notifier) is actually what I wanted. But I love the idea of also reading in the entire queue!
JackDunaway
Trusted Enthusiast

JackDunaway wrote:

I would particularly be appreciative if we got at least a teaser from R&D if this idea is feasible, useful, and/or on the radar.



Aristos Queue wrote:

...remind me again if I don't post back within a couple weeks.


Ping. Really missing this feature today.

altenbach
Knight of NI

For completeness, I have posted an updated example in the original thread.

 

It now also incorporates the second (timeout) technique mentioned above.

AristosQueue (NI)
NI Employee (retired)

Aristos Queue wrote:

...remind me again if I don't post back within a couple weeks.


I never did get back to this thread. The short summary is that this feature seems feasible but very hard. It seems likely to muddy the event configuration dialog, already cited as one of LabVIEW harder-to-use dialogs, the rewrite it got in LV 2009 notwithstanding. The "bang for buck" would be hard to justify without a lot more users citing it as an issue. 

JackDunaway
Trusted Enthusiast

Aristos Queue wrote:
The "bang for buck" would be hard to justify without a lot more users citing it as an issue.

Bummer.... but, a perfectly acceptable alternative would be allowing Queues to be registered as Dynamic Events. Could you ping back a feasability teaser on that? Perhaps responding on the other thread would be more appropriate.

altenbach
Knight of NI

> The short summary is that this feature seems feasible but very hard

 

How about an event terminal that outputs the size of the event queue for the current event?

JackDunaway
Trusted Enthusiast

@altenbach wrote:

How about an event terminal that outputs the size of the event queue for the current event?


Not being able to control the event queue is a bummer, but this would be a great step in the right direction. Inside the Event Structure, a case structure that only operates "IF Items Remaining = 0" would be a great way to discard stale events. This would be more elegant and might even operate faster than current methods involving PN's.

 

I would vote for this as a new Idea, as I think it's different enough to warrant a new post. Presumably, it would be easier to implement, so it's got a better chance of making the cut.

altenbach
Knight of NI

I was worried that if the original suggestion is so difficult, this modification might not be that easy either. :o:D

 

I cooked up a new idea, we'll see what happens...

ouadji
Trusted Enthusiast

kudos.

 

I needed today a function to flush my events queue.

 

SR.png

JordanG
NI Employee (retired)
Status changed to: Completed
Implemented in LV 2013