Do I need to arm a counter attached to NI DAQ USB 6341 to begin data acquisition?
7 views (last 30 days)
Show older comments
I have a USB 6341 NI DAQ that is connected to a photon counter configured to count edge counts. I am trying to trigger the counter's data acquisition using an external start-trigger (PFI line connected to a delay stage). It seems that edge counts require pause-triggers rather than start-triggers (a pause-trigger is not allowed in Matlab). I am getting the error "USB 6341 (BNC) does not support external triggers for the CounterInput subsystem)."
Is it possible to acquire data without using a trigger or does the counter need to be armed to begin data acquisition? Alternatively, is it possible to configure a pause-trigger in Matlab? Any help would be appreciated. The code to intialize the counter is below.
det = daq('ni'); %initialize USB 6341 Daq
ch = addinput(det,"Dev1", "ctr1", "EdgeCount"); %Initialize counter for edge counts
addinput(det,"Dev1","ai0","Voltage"); %Add dummy analog channel to clock counter input
ch.ActiveEdge = 'Falling'; %Count on Falling edge of edge counts
get(ch) % get information on counter channel
addtrigger(det,"Digital","StartTrigger","External","Dev1/PFI9") %Initialize trigger
det.Rate = samplerate*samplepoint; %data collection rate
0 Comments
Answers (1)
Aravind
on 13 May 2025
You do not need to "arm" the counter before starting the counting process. On the NI USB-6431, the counter input channels begin counting as soon as the session is started in MATLAB by calling start(det). There is no separate "arming" step required for the counters.
As of MATLAB R2024b, according to the documentation found here: https://www.mathworks.com/help/daq/daq.interfaces.dataacquisition.addtrigger.html, the Data Acquisition Toolbox supports only a start trigger. The NI USB-6341 does not support start triggers for the Counter Input subsystem, which is a hardware limitation for this device in combination with MATLAB/Data Acquisition Toolbox. The error message "USB 6341 (BNC) does not support external triggers for the CounterInput subsystem" arises due to this reason. Unfortunately, there is no workaround for this, and implementing pause triggers in MATLAB is not possible.
If your goal is simply to acquire data, you can proceed without any triggers. By calling start(det), you initiate the session, and both the analog input and counter input will begin reading together, with the counter starting couting immediately.
Alternatively, if you need a "trigger" condition to start reading, consider implementing a software-based trigger. This involves using a software loop to monitor a digital or analog channel for specific events, which can act as your "trigger". Once the event is detected, you can call start(det) to begin the session.
I hope this answers your question. If you provide more specific details about your use case, I can offer more targeted advice.
See Also
Categories
Find more on National Instruments Frame Grabbers in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!