LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

confusion about Event Structure Timeout case

Solved!
Go to solution

If I wire 100 to the hourglass symbol for the Event Structure Timeout case, does it mean every 100 ms if not other events occur, what ever is in the Timeout case excecutes?

0 Kudos
Message 1 of 12
(7,026 Views)
Solution
Accepted by topic author njacacia

Yes.  If you wire a -1 to the timeout value, the timeout case will never execute.


aputman
LabVIEW 2017
LabVIEW Programming
0 Kudos
Message 2 of 12
(7,015 Views)

Yes, this is how it will behave. This means that if you need something to occur every 100 ms, do not include processing for other events in your event structure. 

 

Here is a very simple test to illustrate how it behaves.

\

Event Structure Timeout.png



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 12
(7,006 Views)

Also note that if you constantly trigger other events, the code in the timeout event might never execute, of course. 😄

 

 

 

0 Kudos
Message 4 of 12
(6,971 Views)

@altenbach wrote:

Also note that if you constantly trigger other events, the code in the timeout event might never execute, of course. 😄


I realize this is an old thread, but this is true even if timeout is 0? (That's because that events are a queue, and the timeout event is only triggered when the event queue is empty & the wired time has passed? In that way, if you are constantly triggering other events the queue may never be empty.)

0 Kudos
Message 5 of 12
(1,017 Views)

Mmmm... confusion about your post. I don't understand how the queue status is related to the timeout in an event structure.

Can you show an example of what you are doing (or want to do?).

Paolo
-------------------
LV 7.1, 2011, 2017, 2019
0 Kudos
Message 6 of 12
(996 Views)

@WavePacket wrote:

@altenbach wrote:

Also note that if you constantly trigger other events, the code in the timeout event might never execute, of course. 😄


I realize this is an old thread, but this is true even if timeout is 0? (That's because that events are a queue, and the timeout event is only triggered when the event queue is empty & the wired time has passed? In that way, if you are constantly triggering other events the queue may never be empty.)


If events are happening faster then they can be handled, then the timeout case can't execute.  However, in such a case your program is going to fail anyway, as you queue up unhandled events until running out of memory.

0 Kudos
Message 7 of 12
(992 Views)

@drjdpowell wrote:

@WavePacket wrote:

@altenbach wrote:

Also note that if you constantly trigger other events, the code in the timeout event might never execute, of course. 😄


I realize this is an old thread, but this is true even if timeout is 0? (That's because that events are a queue, and the timeout event is only triggered when the event queue is empty & the wired time has passed? In that way, if you are constantly triggering other events the queue may never be empty.)


If events are happening faster then they can be handled, then the timeout case can't execute.  However, in such a case your program is going to fail anyway, as you queue up unhandled events until running out of memory.


Yeah, I guess what I was also wondering, but failed to write was this -- timeout of 0 isn't some special high-priority event that gets queued up in the event queue. Now after I write that, it feels obvious - if it was, then the timeout case would always be firing.

0 Kudos
Message 8 of 12
(973 Views)

Note: I think WavePacket is talking about this kind of structure (here found in Messenger Library but usable anywhere).  It is a feedback node of -1 from the Timeout case, and zero from all other event cases.

 

2022-01-20 15_41_55-Control Server.lvclass_Actor.vi Block Diagram on Messenger Library Demo.lvproj_M.png

0 Kudos
Message 9 of 12
(959 Views)

@drjdpowell wrote:

It is a feedback node of -1 from the Timeout case, and zero from all other event cases.


Most of my larger programs use similar techniques, except that I use a shift register. Most events decide if a timeout is needed or not, so that output is on the right. Not all are zero.

 

One very important adjustment to avoid event buildup is to set the event queue to 1 and disable panel locking.

 

0 Kudos
Message 10 of 12
(944 Views)