LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Does GetUserEvent work on timer controls?

I need to use some sort of timer in my application, which has a customised message loop.

Using the Timer Control seems a whole lot easier than the Asynchronous Timer, so I decided to use the Timer Control. Now I find that my callback is never used as long as I use GetUserEvent (which I must use for the rest of the application). In a test program, RunUserInterface and ProcessUserEvents, do call the callback function, but GetUserEvent never receives the event.

Is this normal behaviour for the combination of a Timer Control and GetUserEvent? If so, is there a workaround other than using Asynchronous Timer(s)?

Any help would be greatly appreciated.
0 Kudos
Message 1 of 3
(3,003 Views)
The TIMER_TICK event (the only event the timer-control is able to generate) is no user event, and therefore you would have to use ProcessSystemEvents(), so that the accoring callback is executed, but this is not recomendable. Better is to use RunUSerInterface and let CVI care for the processing of events. If your application is already built with manual events processing, I would recommend to use a asynchroneous timer.
0 Kudos
Message 2 of 3
(2,972 Views)
I am now using the Asynchronous Timer but I'm not sure how to process it's events... For various reasons, I have a message loop which checks the current message, calls GetUserEvent and if this does not process the message, it is processed as a normal windows message. This seems to work (mostly :S) but I haven't been able to process Asynchronous Timer events... should I do so in the LabWindows or in the Windows part of my message loop, and what does the message look like (what are the eventCtrl and event, or the message number, wParam and lParam)?
0 Kudos
Message 3 of 3
(2,950 Views)