LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

filter dynamic user event?

Solved!
Go to solution

Hi all,

When editing an event - a value change event - we can set a limit "max number of instances of this event in the event queue".

Is there a way to limit the number instances of a dynamic user event in the event queue? It seems we don't have this possibility...

 

I'm trying to find a way to do this in LabVIEW 2014, any idea?

 

Thanks in advance


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 1 of 7
(3,136 Views)

I think the closest you'll get is to check the time stamp and discard 'spam'.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 7
(3,126 Views)

Hmmm... I was fearing I would have to go down that way.

 

Anyone knows if in LV2015-16-17 exposes the possibility to limit the number of instances of a dynamic event in the event queue?


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 3 of 7
(3,117 Views)

You can flush the (user) events using the "Flush Event Queue" function. Don't be fooled by it's inputs, it's polymorphic. You'll need the help to see what you can wire to it.

Message 4 of 7
(3,113 Views)

That looks great, I had never really paid attention to this VI, it looks like the perfect solution, I'll try that!


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 5 of 7
(3,102 Views)
Solution
Accepted by topic author TiTou

The nr. of filtered events output is a bit tricky. It will accumulate if you put it in a loop inside the event structure. For example, you can put it in a loop and flush until there are no more events. But if there was an event the first time, it will not return 0 the second time. So you need to check if the output is still changing to know that there are no more events being added to the queue.

 

As an advise: if you do time consuming stuff inside the event, force the flush after it. That way, you 'll also flush the events that where added while doing the work. Might be obvious, but can make a huge difference. 

 

And set the nr of events to keep to 1 (not 0). When set to 0, I think you'll lose the most recent event. This is different from the build in function for normal events. If you put that to 0, you'll still always get the latest event.

 

And the flush works on the event structure stack (just like the build in limit). So you'll still get the events in all another event structure that registered.

Message 6 of 7
(3,095 Views)

Thanks for the advice!

I'll be careful when implementing the flush.


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

0 Kudos
Message 7 of 7
(3,076 Views)