Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Using PCI 6010 and USB-6009

Hello
I have developed a small program that uses the NI-USB 6009 device to measure voltage levels.
This works very well, but since Im in need of measuring 14 voltage levels I bought the PCI 6010 device.
I can make measurements with the PCI 6010 device when using Measuremt and Automation explorer.
But when I try to use my program I will get the same result as when the USB device is not connected.
In my program I use :

for (i = 0; i<8; i++) {
    measurementArray[i] = 0.0;

    sprintf(devicepath, "Dev1/ai%d", i);
    //printf("device: %s\n", devicepath);
    DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
    DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,devicepath,"",DAQmx_Val_RSE,0.0,6.0,DAQmx_Val_Volts, NULL));

    DAQmxErrChk (DAQmxStartTask(taskHandle));

    //printf("Readback value before reading from DAQ device: %e\n", readback);
    DAQmxErrChk (DAQmxReadAnalogScalarF64   (taskHandle, timeout, &readback, NULL));
    measurementArray[i] = readback;
    //printf("Readback value after reading from DAQ device %s: %e\n", devicepath, readback);

    if( DAQmxFailed(error) )
      DAQmxGetExtendedErrorInfo(errBuff,2048);
    if( taskHandle!=0 )  {
      DAQmxStopTask(taskHandle);
      DAQmxClearTask(taskHandle);
    }
    if( DAQmxFailed(error) )
      printf("DAQmx Error: %s\n",errBuff);


is the function:
DAQmxCreateAIVoltageChan
not available when using PCI 6010 ??

I have changed the Dev1 to Dev2 when trying to use my program.
Where do I set this names?
I changed them in Measuremt & automatation manager and it looked like that worked, at least for the USB device that I changed to Dev3.

How can I do to read data with my program from the PCI 6010??

Best regards
MegaDavve


0 Kudos
Message 1 of 2
(3,166 Views)
Problem solved
The PCI 6010 can only measure in the range -5 to 5
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,devicepath,"",DAQmx_Val_RSE,0.0,6.0,DAQmx_Val_Volts, NULL));
Change it to
DAQmxErrChk (DAQmxCreateAIVoltageChan(taskHandle,devicepath,"",DAQmx_Val_RSE,0.0,5.0,DAQmx_Val_Volts, NULL));

and it worked.

Go back to sleep....

Best regards
MegaDavve
0 Kudos
Message 2 of 2
(3,163 Views)