Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Device identifier is invalid for DAQmxCfgDigEdgeStartTrig

Solved!
Go to solution

Device: USB-5133

Software: NI-DAQmx ANSI C 8.7.2f1

 

I have a program working that gets data fine from the analog input using software (immediate) triggering.  However, I get an odd error when I try to set it up to use PFI1 as an external trigger:

 

Measurements: Device identifier is invalid.

Device Specified: dev9

 

Status Code: -200220

 

 It seems to be telling me that dev9 is invalid (which would be true), expect that I specified dev2 in the function call. In researching other examples, this seems like it should be working.  Below is the relevant code I'm using.  I would appreciate any insight into what might be going on here.

 

    error = DAQmxCreateTask("", &taskHandle);
    if (DAQmxFailed(error))
    {
        DaqError("Digitizer Error (DAQmxCreateTask)");
        return false;
    }

    error = DAQmxCreateAIVoltageChan(
        taskHandle,              // Task handle
        "dev2/0",                // Physical channel name
        "",                      // Virtual channel name, if blank uses physical channel name
        DAQmx_Val_Cfg_Default,   // Input terminal configuration
        -1.0,                    // Minimum value you expect to measure
        1.0,                     // Maximum value you expect to measure
        DAQmx_Val_Volts,         // The units of the previous two parameters
        NULL);                   // Custom scale name
    if (DAQmxFailed(error))
    {
        DaqError("Digitizer Error (DAQmxCreateAIVoltageChan)");
        return false;
    }

    error = DAQmxCfgSampClkTiming(
        taskHandle,              // Task handle
        NULL,                    // Source terminal of the sample clock (use NULL for internal)
        pDoc->SampleRateHz,      // Sample rate in samples per second
        DAQmx_Val_Rising,        // Edge of the clock to acquire samples on
        DAQmx_Val_FiniteSamps,   // Sample mode
        pDoc->nCount);           // Number of samples per channel to acquire
    if (DAQmxFailed(error))
    {
        DaqError("Digitizer Error (DAQmxCfgSampClkTiming)");
        return false;
    }

    if (m_trig_type == Trig_Serial)
    {
        error = DAQmxCfgDigEdgeStartTrig(taskHandle, "/dev2/pfi1", DAQmx_Val_Rising);
        if (DAQmxFailed(error))
        {
            DaqError("Digitizer Error (DAQmxCfgDigEdgeStartTrig)");
            return false;
        }
    }
    
    error = DAQmxStartTask(taskHandle);
    if (DAQmxFailed(error))
    {
        DaqError("Digitizer Error (DAQmxStartTask)");
        return false;
    }

0 Kudos
Message 1 of 3
(3,235 Views)
Solution
Accepted by topic author Benote

Hi Benote,

Welcome to the NI Forums!  The USB-5133 is meant to be used with the NI-SCOPE driver as opposed to DAQmx.  The likely reason that the code initially functions is that NI-SCOPE is based off of our DAQmx driver.  You may be able to run some DAQmx functions, but many of the features of NI-SCOPE are implemented differently (it seems this would include triggering).  Since the 5133 is not meant to be used with the DAQmx driver, you could expect to see unusual (or incorrect) error messages such as the one you are receiving.

 

If you haven't already, I recommend that you install NI-SCOPE (from the above link or from the device drivers CD).  The NI-SCOPE examples and documentation can be found at:

Start >> All Programs >> National Instruments >> NI-SCOPE.  If you have any questions don't hesitate to ask.  Thanks and have a great day!

 

-John 

 

 

John Passiak
0 Kudos
Message 2 of 3
(3,214 Views)

John,

Thank you for the reply!  Moving to NI-Scope (and NI-modinst for device enumeration / discovery) has everything working now.

0 Kudos
Message 3 of 3
(3,182 Views)