LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

NI USB-6009 DAQ locks up after 4-6 reads

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
0 Kudos
Message 1 of 2
(2,880 Views)

Hi Jim-

Please check the responses posted in this thread.

Good luck with the rest of your app-

Tom W
National Instruments
0 Kudos
Message 2 of 2
(2,864 Views)