Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxErrorPhysicalChanDoesNotExist

I installed nidaqmxbase-2.1 with Mandriva 2006.
I have USB 9211 and USB 6009
I can read data from USB 9211. But with USB 6009 I got DAQmxErrorPhysicalChanDoesNotExist error.
Program attached

Then I uninstall, reinstall nidaqmxbase-2.1 but does not work

Is it bug in nidaqmxbase-2.1. Is there any way to work arround. Should I try NIDAQ800_Mandriva?? or other versions of nidaqmxbase.


Help is appreciated


===============

#include "NIDAQmxBase.h"
#include <stdio.h>

#define DAQmxErrChk(functionCall) { if( DAQmxFailed(error=(functionCall)) ) { goto Error; } }

int main(int argc, char *argv[])
{
    // Task parameters
    int32       error = 0;
    TaskHandle  taskHandle = 0;
    char        errBuff[2048]={'\0'};

    // Channel parameters
    char        chan[] = "Dev1/ai0";
    float64     min = -10.0;
    float64     max = 10.0;

    // Timing parameters
    uInt64      samplesPerChan = 1;

    // Data read parameters
    float64     data;
    int32       pointsToRead = 1;
    int32       pointsRead;
    float64     timeout = 10.0;


    DAQmxErrChk (DAQmxBaseCreateTask("",&taskHandle));
    // DAQmxBaseClearTask(taskHandle);
   // DAQmxBaseResetDevice ("Dev1");
    DAQmxErrChk (DAQmxBaseCreateAIVoltageChan(taskHandle,chan,"",DAQmx_Val_Cfg_Default,min,max,DAQmx_Val_Volts,NULL));
    DAQmxErrChk (DAQmxBaseStartTask(taskHandle));
    printf("pass start");
    DAQmxErrChk (DAQmxBaseReadAnalogF64(taskHandle,pointsToRead,timeout,DAQmx_Val_GroupByChannel,&data,samplesPerChan,&pointsRead,NULL));

    printf ("Acquired reading: %f\n", data);

Error:
    if( DAQmxFailed(error) )
        DAQmxBaseGetExtendedErrorInfo(errBuff,2048);
    if( taskHandle!=0 ) {
        DAQmxBaseStopTask(taskHandle);
        DAQmxBaseClearTask(taskHandle);
    }
    if( DAQmxFailed(error) )
        printf("DAQmxBase Error: %s\n",errBuff);
    return 0;
}

0 Kudos
Message 1 of 4
(3,105 Views)
Hi Nguyen -

Are you able to see the 6009 when you use lsdaq?  If not, then you may have the wrong firmware on it.  The 6009 works with both DAQmx and DAQmxBase, but you must switch the firmware on the device to correspond with the driver you want to use.  KB 3NE7GJMY explains how to switch the firmware. (Note that you must do so on a Windows machine running both DAQmx and DAQmxBase.)
David Staab, CLA
Staff Systems Engineer
National Instruments
0 Kudos
Message 2 of 4
(3,077 Views)

Hi All-

A quick clarification to David's post- the USB-6009 is supported by NI-DAQmx Base on Linux, but not NI-DAQmx.  The USB-6009 is supported and expected to function correctly with NI-DAQmx Base 2.1 for Linux.  The problem you're seeing may be related to the a needed firmware change using the procedure described in David's post.

Thanks-

Tom W
National Instruments
0 Kudos
Message 3 of 4
(3,070 Views)
Yes !! You are right
After chaning the firmware to NIDAQmxBase 2.1 my 6009 works nicely
Thanks
0 Kudos
Message 4 of 4
(3,061 Views)