From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event structure - timeout reset by user events?

Solved!
Go to solution

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
(3,440 Views)
Solution
Accepted by SuperDuperCooper

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

Message 2 of 12
(3,429 Views)

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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 12
(3,412 Views)

Rephrasing slightly for clarity.

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

---------------------------------------------
Certified LabVIEW Developer (CLD)
There are two ways to tell somebody thanks: Kudos and Marked Solutions
0 Kudos
Message 4 of 12
(3,381 Views)

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
(3,377 Views)

@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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 12
(3,370 Views)

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
(3,355 Views)

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

 

0 Kudos
Message 8 of 12
(3,349 Views)

@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
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 9 of 12
(3,341 Views)

@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
(3,244 Views)