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