08-22-2011 08:20 AM
Using NI-DAQmx to write a series of voltages and to read two response series simultaneously using a PCI-6024E DAQ.
My code is:
DAQmxCreateTask("",&taskHandle1);
DAQmxCreateTask("",&taskHandle2);
strcpy(list,c1);
strcat(list,",");
strcat(list,c3);
DAQmxCreateAIVoltageChan (taskHandle1,list,"",DAQmx_Val_Cfg_Default,-vrange[vindex],vrange[vindex],DAQmx_Val_Volts, "");
DAQmxCreateAOVoltageChan(taskHandle2,c2,"",-10,10,DAQmx_Val_Volts,"");
DAQmxCfgSampClkTiming (taskHandle1, NULL, readrate*1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, 2*(ik+2));
DAQmxCfgSampClkTiming (taskHandle2, NULL, readrate*1000, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, ik+2);
DAQmxCfgDigEdgeStartTrig (taskHandle2, "/Dev2/ai/StartTrigger", DAQmx_Val_Rising);
DAQmxWriteAnalogF64 (taskHandle2, ik+1, 0, 0.1, DAQmx_Val_GroupByChannel, OutVector, &numWritten, NULL);
DAQmxStartTask(taskHandle2);
DAQmxStartTask(taskHandle1);
DAQmxReadAnalogF64 (taskHandle1, numWritten+1, 0.1, DAQmx_Val_GroupByScanNumber , val, 2*(ik+2), &numRead, 0);
DAQmxStopTask(taskHandle1);
DAQmxClearTask(taskHandle1);
DAQmxStopTask(taskHandle2);
DAQmxClearTask(taskHandle2);
Every time I get to the line with DAQmxWriteAnalogF64 function I get the following response:
NON-FATAL RUN-TIME ERROR: "MCBJ3.c", line 372, col 5, thread id 0x00000804: Function DAQmxWriteAnalogF64: (return value == -89130 [0xfffea3d6]). Device not available for routing. It is possible that the device needs to be reset or that the device is being reset. If you are resetting the device, wait for the reset to complete. For example, if you have used the device through Traditional NI-DAQ, you must reset the device before the requested route can be made. For SCXI devices, you must reset the communicator DAQ device. Call the Traditional NI-DAQ Device Reset VI or the Init_DA_Brds function. To reset all devices in Traditional NI-DAQ, right-click the Traditional NI-DAQ Devices folder in MAX and select Reset Driver for Traditional NI-DAQ. Task Name: _unnamedTask<1> Status Code: -89130
What can be done? Previously similar code worked without any problems using a different DAQ card.
Thank You
08-24-2011 09:33 AM
Good morning,
Thanks for the question, and in return, I have a few questions for you:
1. What was the previous DAQ card you were using?
2. Have you tried using the previous code with the PCI-6024E, or have you tried using the previous card with this code? What are the results?
3. Can this card successfully write simple analog otuputs? Try with a shipping example for continuous analog output or even in Measurement & Automation Explorer.
Regards,
Lisa