Retriggerable pulse generation in NiDAQ
Show older comments
Hi,
i am having trouble figuring out how to set retriggerable pulse generation.
I can generate continuous pulse from a counter but I have to specify a frequency. But if the specified frequency is not exactly what is being triggered then I have a phase delay
For example I allocate an external trigger to PFI0
addtrigger(d,'starttrigger','external',Dev1/PFI0') & addclock(d,'Scanclock',external,Dev1/PFI0);
Next I add a counter
ch=addcounter(d,'cntr0',Dev1/PFI4,'PulseGeneration')
Then I have to specify
ch.Frequency = something close enough to clock and trigger frequency
and
ch.DutyCycle =0.5
When I output the trigger and the counter output on the scope, I see that the two slowly shift the edges w.r.t each other. I am assuming that is because my external clock may not be exactly matched to the specified frequency or perhaps it is using 'internal clock' to generate this pulse.
I don’t want to do that. Instead I want retriggerable pulses.
I Googled and found this mentioned here which is exactly what I need.
However, I am not sure how to set this up in matlab. Is there a parameter 'retriggerable'? What is source here? I am guessing it is my external clock.
https://www.ni.com/docs/en-US/bundle/crio-904x-feature/page/retrig-pulse-train-gen.html.
Thanks
Answers (0)
Categories
Find more on Counter and Timer Input and Output 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!