Win XP, CVI 7.1
I have a NI USB-6009 DAQ that I am trying to use to make a very simple voltage measurement with one differential channel every time a command button is pressed. My app works fine until between 4 to 6 reads (presses of the CMD button) then seems to lock up inside the DAQmxBaseReadAnalogF64 function. I tried stepping through to see if I could read the Status returned from the function, but it never gets that far. Any idea what is happening?
Here is my simplified trial code:
int CVICALLBACK READ (int panel, int control, int event,
void *callbackData, int eventData1, int eventData2)
{
switch (event)
{
case EVENT_COMMIT:
Status = DAQmxBaseCreateTask ("TASK1OUTPUT", &task1Handle);
Status = DAQmxBaseCreateAIVoltageChan (task1Handle, "Dev1/ai0", "Output", DAQmx_Val_Diff, -10.0, 10.0,
DAQmx_Val_Volts, NULL);
Status = DAQmxBaseStartTask (task1Handle);
Status = DAQmxBaseReadAnalogF64 (task1Handle, 1, 5, DAQmx_Val_GroupByChannel, &task1data, 1,
&pointsRead, NULL);
SetCtrlVal (panelHandle, PANEL_CUR_VAL, task1data);
Status = DAQmxBaseClearTask (task1Handle);
break;
}
return 0;
}
Thanks,
Jim