Linux Users

cancel
Showing results for 
Search instead for 
Did you mean: 

USB-6211 digital trigger

I realize that DAQmx base has limited function support as outlined in its readme file, as a result I am not sure how to implement what I need.  I want to use a USB-6211 to receive a digital trigger signal.  My software (C) should be sitting idle waiting for this trigger to occur.  When the trigger occurs the software will continue doing some other software tasks.  Can anyone recommend a set of functions I should be looking at?

0 Kudos
Message 1 of 5
(4,763 Views)

jjjcjj wrote:

I want to use a USB-6211 to receive a digital trigger signal. My software (C) should be sitting idle waiting for this trigger to occur.  When the trigger occurs the software will continue doing some other software tasks. Can anyone recommend a set of functions I should be looking at?

DAQmx Base supports digital start triggers for the USB 621x devices. Take a look at contAcquire-ExtClk-DigStart.c in /usr/local/natinst/nidaqmxbase/examples/ai/:

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

uInt32 triggerSlope    = DAQmx_Val_RisingSlope;


DAQmxBaseCfgDigEdgeStartTrig(taskHandle, triggerSource, triggerSlope);

DAQmx Base C Function Reference (ignore the version '3.x' -- the API hasn't changed)

http://digital.ni.com/manuals.nsf/websearch/C4B5B92E74F160C6862574560065F8BC

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 2 of 5
(3,663 Views)

Since I don't actually need to capture any analog samples is there anyway to bypass the analog read part, or should I just do something like set the 'pointsToRead' = 1?

0 Kudos
Message 3 of 5
(3,663 Views)

jjjcjj wrote:

Since I don't actually need to capture any analog samples is there anyway to bypass the analog read part, or should I just do something like set the 'pointsToRead' = 1?

You cannot bypass the analog read, but you can set the minimum samples to read (which I believe is 2) in DAQmxBaseCfgSampClkTiming and wait for the data to return. The call to DAQmxBaseReadAnalogF64 will block until the samples have been retrieved. This approach is the closest your application can get to the moment when the digital trigger occurred.

Joe Friedchicken
NI Configuration Based Software
Get with your fellow OS users
[ Linux ] [ macOS ]
Principal Software Engineer :: Configuration Based Software
Senior Software Engineer :: Multifunction Instruments Applications Group (until May 2018)
Software Engineer :: Measurements RLP Group (until Mar 2014)
Applications Engineer :: High Speed Product Group (until Sep 2008)
0 Kudos
Message 4 of 5
(3,663 Views)

Great, thanks.  I'll give this a shot.

0 Kudos
Message 5 of 5
(3,663 Views)