Multifunction DAQ

Showing results for 
Search instead for 
Did you mean: 

nidaqmx usb bnc 2110 trigger speed

Go to solution



you can find my python code below. I'm currently trying to trigger a ni usb bnc 2110 daq card to acquire some data. The only code I could come up with is shown below. When testing it in this configuration it is working fine. However reading out the elapsed time gives me roughly 10 ms until the trigger is armed again because I restart the whole task. I the desired application I expect a trigger of 5 kHz. Does anybody has an idea if this works with the card and if it works how to accelerate the program. I thought so far about using a stream or using the trigger of 5 kHz as external clock to acquire data untriggered but according to the external clock. I have no idea if this external clock idea is possible neither how to implement it or how to implement the stream. If someone could help me with an example or an additional idea I would be very greatful.







import nidaqmx as n
import time
from nidaqmx.constants import (
s_freq = 100000
num_samples = 1

task = n.Task()


startt = time.time()


task.timing.cfg_samp_clk_timing(s_freq, sample_mode=n.constants.AcquisitionType.CONTINUOUS, samps_per_chan=num_samples)
task.triggers.start_trigger.trig_type = TriggerType.DIGITAL_EDGE


for i in range(5):
       starttt = time.time()
       print(time.time() - starttt)
       data =

print(time.time() - startt)

0 Kudos
Message 1 of 3
Accepted by topic author fabi21

The BNC-2110 is just a terminal block with a cable to connect it to a desktop or PXI data acq board.  It's the data acq board that determines the functionality.  That said, odds are rather high that the data acq board at the other end is capable of supporting what you want.  It's probably some variety of multifunction board, and AFAIK, they'd all be capable.


I don't know the Python API, but I *can* tell you that it's important to realize that DAQmx makes a clear distinction between a start trigger (which is a one-time event) and a sample clock (which is used to capture measurements from the A/D converter).  The fact that you're configuring to capture 1 sample per task run suggests to me that you want your external signal at PFI0 to be used as a sample clock instead of a trigger.


You'll probably need to modify your call to "cfg_samp_clk_timing()" to include a parameter that designates PFI0 as your sample clock source and also configures a decent estimate of the sample clock rate (5 kHz?).  You'd be changing your "num_samples" parameter too.



-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW?

(Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).

Message 2 of 3

Hi Kevin,


thanks a lot for your answer. Indeed you are completely correct I somehow didn't recognize it within the function. In the cfg_samp_clk_timing() there is a source instance which allows you to take a external signal as sample clock.




0 Kudos
Message 3 of 3