Showing results for 
Search instead for 
Did you mean: 

Some MessagePopup() blocking async timers?

In LabWindows 2017, we have a program that uses background async timers to poll some hardware. We used to use UI timers, but if you grabbed the window to move/resize it, those timers halt, and the hardware would timeout and shut down. Async timers solved that issue.


Now, there is one MessagePopup() that will cause the boards to stop being polled and time out. It is in a function, but we use MessagePopup() in many other places (callbacks) and they do not cause the polling to stop.


Anyone know the rule to this? Thanks for any tips.

0 Kudos
Message 1 of 6


Popups don't cause async timers to pause. They don't even pause normal UIR timers. So there's something else going on in your code. Async timers are in a different threads, so even if you call while(1); or pause(); they won't stop being called.

As far as I know the only way to block async timers is with SuspendAsyncTimerCallbacks() or with some real low level stuff like interruption masking...

Or it's being called but your code is somehow ignoring it...

0 Kudos
Message 2 of 6

Interesting and useful. Yeah, we never turn off any timers down except when the program shuts down. Time to do some digging... 

0 Kudos
Message 3 of 6

Or possibly you do some thread manipulation, like blocking other threads...

0 Kudos
Message 4 of 6

Once I knew Popup did not halt anything, I did some stack call tracing and found the code ultimately was called from a timer callback. PostDeferred Call to the rescue once more!


PostDeferredCall ((DeferredCallbackPtr)MyFunction, NULL);


This allows the call to run after the timer code is done, from the main UI thread.


Solved. Thanks!

0 Kudos
Message 5 of 6

MessagePopup is a synchronous function: it means that code execution stops until the popup is dismissed.

As an alternative, you can use PostDeferredCall to call a function that is executed in the main thread to display messages: this does not interfere with timer execution.

Proud to use LW/CVI from 3.1 on.

My contributions to the Developer Community
If I have helped you, why not giving me a kudos?
0 Kudos
Message 6 of 6