I am developing a CVI 6.0 -based system with devices: FP-1600, FP-TB-10 and FP-DI-DC. (under windows 98)
A asynchronous timer (rate : 10ms) is created for data acquisition, a UI timer (rate: 100ms) pass data from a thread-Safe queue and plot points to chart.
The problem is: While hit the a button to do other things (we have another chart with scroll bar and other axis adjustment feature) or drag the windows, the real time wave form was distorted during that moment. I suspect the FP server hold the obsolete data. Have any solution?
Attached the asynchronous timer function. I don?t think that using ?FP_Advise? is useful.
int CVICALLBACK ReadTimerCallback (int reserved, int theTimerId, int event, void *call
backData, int eventData1, int eventData2)
{ float val[2];
float *value;
IAStatus result;
SYSTEMTIME dummy,dummy2,dummy3;
if (event == EVENT_TIMER_TICK){
//read data from 2 FP module
result = FP_Read (FP_handle, IOhandle_V_rou, current_V_rou, 20, &dummy);
result = FP_Read (FP_handle, IOhandle_V_fin, current_V_fin, 20, &dummy2);
.... .......
//send data to queue
CmtWriteTSQData (g_dataQueueHd2, val, 2, 0,NULL);
......
}
}