06-13-2007 06:46 AM
06-13-2007 08:40 AM
Hi!
It is no magic. Timer starts immediately after you set the enable attribute. You can see that the callback function is called if you put a breakpoint.
But, the initial value of the numeric control (0.0) and the value that you write in it in the first timer callback (timer_value, which is 0.0 initally) are the same.
You may change the callback code to
SetCtrlVal (PANEL, PANEL_ASYNC_TIMER, ++timer_value);
or you can change the initial value of the variable: timer_value = 1.0.
Hope this helps ![]()
06-13-2007 09:58 AM
06-13-2007 10:48 AM
Gauthier, do you *really* need two separate timers for your application? If times are those you are depicting (several seconds per scan) you could maybe accomplish all your tasks with a single timer that scans one per second: something like this pseudocode that runs the timers every 10 seconds (timer 2 routine shifted 3 secs from timer 1 routine)
count++
if count == 3 execute routine for timer 2
if count == 10 {
execute routine for timer 1
count = 0
}
06-14-2007 01:30 AM
06-14-2007 02:25 AM
06-14-2007 02:34 AM
06-14-2007 04:16 AM
06-14-2007 04:42 AM
06-14-2007 05:52 PM