LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Unregister timeout event

Solved!
Go to solution

I'm trying to find a way of dynamically unregistering a timeout event from an event structure. In order to dynamically unregister an event I need to first dynamically register it and this is where I'm having problems.

 

I first create an application refnum, then I wire this as an input to the Register Events function. When I right click or drop-down on the event source input to the Register Events function 'timeout' appears in the list but is greyed out and not selectable.

 

Does anyone know why this is so?  

0 Kudos
Message 1 of 7
(2,801 Views)

You can't dynamically register or unregister a timeout event. However, you can very easily control the timeout value you wire to the event timeout terminal. If this value is -1, the timeout case will never be processed.

Jarrod S.
National Instruments
Message 2 of 7
(2,797 Views)

@Spruce wrote:

 'timeout' appears in the list but is greyed out and not selectable.

 

Does anyone know why this is so?  


As Jarrod explained their are much better ways (setting the TMO value with a SR is a lot more scaleable and flexable)

Having it greyed out prevents users from chosing a less scalable approach.  Why its there in the first place is beyond me. 


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 7
(2,783 Views)

Thanks to both for your replies. Setting the timeout value was the approach I had been using but I was beginning to feel a bit uncomfortable that there might be unintended consequences.

 

Could you clear up one more point for me:

 

Assuming I have a timeout interval of, say, 10ms but my timeout event handler takes 50ms to execute, is there any possibility that one or more timeout events will already be waiting in the event queue and will trigger another unwanted call of my timeout event handler even though I write -1 to the timeout terminal before re-entering the event structure? I notice, for instance, that user events seem to stack up if generated faster than the event handler can process them.

0 Kudos
Message 4 of 7
(2,765 Views)
Solution
Accepted by topic author Spruce

No. I believe the timeout countdown only starts when the event structure starts executing.

Jarrod S.
National Instruments
0 Kudos
Message 5 of 7
(2,758 Views)

Great, thanks.

0 Kudos
Message 6 of 7
(2,755 Views)

@jarrod S. wrote:

No. I believe the timeout countdown only starts when the event structure starts executing.


More specifically, the timeout starts after all queued up events have completed.

0 Kudos
Message 7 of 7
(2,750 Views)