pause trigger with data aquisition toolbox for creation of pulse trains
Show older comments
Hi,
I want to create pulse trains by using the counter outputs of my NI 6052E card (Matlab 2021b). For this I want to generate a fast (1MHz) TTL signal to puls a laser ('Ctr0 out') and use another counter (Ctr1 out) to trigger the first counter (e.g. 100kHz). When Ctr1 is high then Ctr0 should generate pulses and if Ctr1 is low then Ctr0 should stop.
For the very old 32bit version one could use loadlibrary for the original 32bit DLL pauseTrig functions (so I know the hardware definitely can do what I want it to do), but that is limited to Matlab 2012. I can' t find anything in the Data Aquisition Toolbox except a StartTrigger function. But then the pulsegeneration just starts, but doesn't pause again.
My code is at the moment around:
d = daq("ni");
ch1 = addoutput(d,"Dev1", "Ctr0" ,"PulseGeneration");
ch2 = addoutput(d,"Dev1", "Ctr1" ,"PulseGeneration");
ch1.Frequency = 1000000;
ch2.Frequency = 100000;
trig = addtrigger(d,"Digital","StartTrigger","External","Dev1/Ctr0Gate");
start(d, 'Duration', seconds(10));
I also tried to connect the output Ctr1out via cable to Ctr0Gate. But that doesn't work neither.
Is that feature even possible with DAQ?
Best regards,
Michael S
Accepted Answer
More Answers (0)
Categories
Find more on Data Acquisition Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!