Hi all. I have developed an application that uses a standard timer to perform periodic controls over an equipment connected to the computer via RS232. The timer fires every 500 msecs and total timer execution is below 200 msecs every time, so that this task does not interfere with interaction on the user interface, which is very reduced on the system: this application controls endurance tests that lasts several days with less or no operator actions during tests.
Now, this application works well in several installations, but a customer of mine is claiming that after less than a day working the interaction with the user interface is reduced to the point that you see the pointer moving several seconds after a mouse move!
In my application I have a monitoring panel that shows some details on program and timer execution, namely seconds from program start, time from last timer execution and timer callback lenght, taken from eventData1 and eventData2 in the timer callback this way:
int CVICALLBACK timCbk (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
// Controllo impianto
{
int i;
double tini;
if (event != EVENT_TIMER_TICK) return 0;
if (monH) { // The monitoring panel is loaded
tini = Timer (); // Time when the callback started
SetCtrlVal (monH, mon_life, *(double *)eventData1); // Time from program start
SetCtrlVal (monH, mon_scan, *(double *)eventData2 * 1000.0); // Time from last execution of the timer
}
// Controlling the attached device
// ...
if (monH) {
SetCtrlVal (monH, mon_timer, (Timer() - tini) * 1000.0); // Time the callback lasted
CVIDynamicMemoryInfo ("Memoria dinamica", NULL, &i, // Dynamic memory size
DYNAMIC_MEMORY_SHOW_ALLOCATED_MEMORY_SUMMARY);
SetCtrlVal (monH, mon_mem, i);
}
return 0;
}
Now, when this customer displays the monitoring panel, it shows that the callback is firing every 210 msecs instead of 500! This explains the reduced reaction to user interface operations, but why it has happened?
Moreover, sometimes strange values are shown for timer pacing and for program life: I personally saw values of 4 millions appearing some times in "time from last timer" field, replaced with normal 500 msecs at the next timer execution, my castomes told me that program life showed 15 billions while it should show normal 86000 secs for a day work...
In my opinion this behaviour is machine-dependent, based on the fact the I never saw this behaviour on all other computers on which the application is running.
Has any of you noticed somethins similar to this, or has some information regarding timer behaviour?
Before moving all the application to async timer I'll try to change the machine on which it is running, but I would like to understand what's happening...
The application is developed in CVI6, executing under WinXP on a PIII machine.
Message Edited by Roberto Bozzolo on 12-08-2005 08:35 PM