LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure - timeout reset by user events?

Solved!
Go to solution
Highlighted

Hi

 

Am I right in thinking that the Event Structure timeout is reset every time a user event is handled by the event structure?

 

I assume so but wanted to check ...

 

Thanks

 

LV2015

0 Kudos
Message 1 of 12
(482 Views)
Highlighted
Solution
Accepted by topic author SuperDuperCooper

Yes.  A timeout is the event that occurs if no other event has happened during the timeout period.

Message 2 of 12
(471 Views)
Highlighted

Rephrasing slightly was RavensFan already stated:

 

The timeout event case is what is ran if there are no events in the event queue after the timeout counter has reached the desired timeout period.  The timeout counter starts when the Event Structure is reached in the code.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
Message 3 of 12
(454 Views)
Highlighted

Rephrasing slightly for clarity.

Yes. You are correct in that "the Event Structure timeout is reset every time a user event is handled".

0 Kudos
Message 4 of 12
(423 Views)
Highlighted

In older versions of LabVIEW (I want to say 2011 and earlier) there was an interesting behavior. If you registered for an event, but didn't handle it (no corresponding event in the event structure), firing the event would still reset the timeout counter. Now it has changed, so only the handled events reset the timeout counter.

0 Kudos
Message 5 of 12
(419 Views)
Highlighted

@Gregory wrote:

In older versions of LabVIEW (I want to say 2011 and earlier) there was an interesting behavior.


It was 2014 or 2015 where the events got a massive overhaul that fixed that behavior.  I'm fairly certain it was 2014, but I am unable to find the NI Week presentation to prove it.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 6 of 12
(412 Views)
Highlighted

I found it was LV 2013 when the change occurred. Oddly, I found this in the LV 2014 upgrade notes 

 

Capture.PNG

0 Kudos
Message 7 of 12
(397 Views)
Highlighted

If you want semi-regular timeout events happening, you can appropriately shorten the timeout whenever a non-timeout event occurs. ultimately, the timeout will be zero and it fires immediately if nothing else is queued up.

 

For a simple example, have a look at my post from 2005 (time files! :D).

 

(I would probably refresh that old code a little bit by placing most of the timeout regulation in an inlined subVI and also placing the ticker before the case structure, etc.)

 

EDIT: OK, here's an update version. Just a quick draft for now, but it could be turned into example code in the future (after review).

 

altenbach_0-1582145633110.png

 


LabVIEW Champion. It all comes together in GCentral GCentral
What does "Engineering Redefined" mean??
0 Kudos
Message 8 of 12
(391 Views)
Highlighted

@Gregory wrote:

I found it was LV 2013 when the change occurred. Oddly, I found this in the LV 2014 upgrade notes


Yep, I found the presentation I was thinking of.  It was during NI Week 2013.  Jack Dunaway was giving a presentation of nuances of events and someone from NI R&D asked "Are you running 2012?  That should be fixed in 2013."  When digging through, I was thinking it was the year after he did that presentation that another presentation was one on events.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 9 of 12
(383 Views)
Highlighted

@Gregory wrote:

In older versions of LabVIEW (I want to say 2011 and earlier) there was an interesting behavior. If you registered for an event, but didn't handle it (no corresponding event in the event structure), firing the event would still reset the timeout counter. Now it has changed, so only the handled events reset the timeout counter.


It fixed it by unregistering the events in the Event Registration Refnum which are not handled. An unexpected side effect of this is that some of my existing code broke. I used event structures in series to piece-by-piece handle a large set of events, passing the Event Registration Refnum between them. This obviously does not work if all event queues for events not handled in the first event structure are discarded.

 

I suppose you could call it a "fix" but YMMV.

0 Kudos
Message 10 of 12
(286 Views)