Quantcast
Channel: Counter/Timer topics
Viewing all articles
Browse latest Browse all 1271

Triggering Counter Data Acquisition on USB 6341 through Matlab

$
0
0

I have a DAQ USB 6341 with a detector (photon counter) connected to PFI3 and a trigger connected to PFI9. The system is controlled through Matlab. The trigger is a delay stage. When the delay stage starts moving, it emits a pulse that is a trigger signal that should begin data acquisition on the detector; when it stops moving, it emits a pulse that acts as a trigger signal that should stop data acquisition. This works for analog detectors. In this case, the detector is a photon counter that is technically continuously taking data. I use a Counter Input Channel that counts edge counts. I only need to collect the data that is received when the delay stage is moving, hence the need for a trigger.

 

However, counter input channels do not seem to support trigger signals. Why is this? Is there another way I can trigger just the data collection of the Counter during the periods I want to collect?  

 

Below are relevant parts of my code: 
instrreset;
det = daq('ni');
ch = addinput(det,"Dev1", "ctr1", "EdgeCount");
addinput(det,"Dev1","ai0","Voltage"); %dummy analog input to provide external clock for counter 
ch.ActiveEdge = 'Falling';
addtrigger(det,"Digital","StartTrigger","External","Dev1/PFI9")
det.Timeout = 20; 
det.Rate = samplerate*samplepoint;
 
For n= 0:5000 
% code that starts moving delay stage 
data_raw = read(det,seconds(sampletime))
% code that stops moving delay stage

Viewing all articles
Browse latest Browse all 1271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>