I usually use this method to monitor a timer callback:
int CVICALLBACK timerCallback (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
double tn;
if (event != EVENT_TIMER_TICK) return 0;
tn = *(double *)eventData2; // Time from last execution of interrupt
// I use a secondary panel to display monitoring values. monH is the handle to that panel
if (monH) {
SetCtrlVal (monH, mon_life, *(double *)eventData1); // Total time of execution of the program
SetCtrlVal (monH, mon_scan, tn * 1000.0); // Display time from last execution (msecs)
}
//
// Here I put the function code to monitor...
//
// Here I display the time of execution of the function
if (monH) {
SetCtrlVal (monH, mon_timer, (Timer() - *(double *)eventDat
a1) * 1000.0);
}
return 0;
}
To speed up the time of execution of timer interrupts I usually put all panels updates and/or file I/O in external functions called by PostDeferredCall. This permit me to monitor error conditions and display messageboxes to inform the operator without disturbing the interrupt flow ans scanning.
Hope this helps
Roberto