Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

usb-6008 ni-daq base mx triggers

Hello

I'am using ni-daq mx base on linux from C.
So far it worked great, but now i'm trying to start sampling data activated by trigger.
I've tryed both examples acquireNScans-AnlgStart and acquireNScans-DigRef.

If i comment out part which initialises trigger
(analog)
    DAQmxErrChk (DAQmxBaseCfgAnlgEdgeStartTrig(taskHandle,triggerSource,triggerSlope,triggerLevel));
(digital)
    DAQmxErrChk (DAQmxBaseCfgDigEdgeRefTrig(taskHandle,triggerSource,triggerSlope,triggerSamples));

it samples data as it should ( without trigger ofcourse ).

I've tryed multiple cobinations reagrding triggerSource (triggerSource[] = "/Dev1/PFI0";) , with Dev1, without it, with/without leading slashes etc
Any other things i should try ?
Does ni-daq mx base has some limitations regarding triggers ?

0 Kudos
Message 1 of 3
(3,406 Views)

Hi,

It seems like you are using the correct functions and proper syntax. One question I have is; are you receiving any errors? Or does it just never trigger and then timeout? If you are not receiving errors are you certain that your trigger signal is actually being sent, or in the case of the analog trigger that your signal is reaching the specified level?

As an example of proper syntax I have included a snippet from the example contAcquire-ExtClk-DigStart.c

    // Triggering parameters

    char        triggerSource[] = "/Dev1/PFI0";

    uInt32      triggerSlope = DAQmx_Val_RisingSlope;

    uInt32      triggerSamples = 100;

DAQmxErrChk (DAQmxBaseCfgDigEdgeStartTrig(taskHandle,triggerSource,triggerSlope));

I do notice that triggerSamples is missing from the example program’s function call I would try removing this from your call and allowing the program to use the default value to see if this changes the behavior any. I hope this helps!!

JaceD
Signal Sources Product Support Engineer
National Instruments
0 Kudos
Message 2 of 3
(3,376 Views)
Hello

Removing triggerSamples from function call solved the problem.

Tnx 🙂
0 Kudos
Message 3 of 3
(3,358 Views)