02-06-2015 06:38 AM
Hi,
What I want to do is to generate simultaneously 2 retriggerable finite pulse trains using my PCI 6221.
To be more clear please have a look at the attached file.
The trigger is in /dev/PFI0 for example and I want the 2 pulses in /dev/ctr0 and /dev/ctr1 simultaneously.
I can easily produce /dev/ctr0 or /dev/ctr1 but never /dev/ctr0 and /dev/ctr1 at the same time.
Does it sound doable what I would like to achive?
Thanks a lot.
Adrian
Solved! Go to Solution.
02-09-2015 07:51 AM
Hi Adrian,
Thank you for your post. I have done some preliminary research into your problem and have found some articles you may find interesting:
This relates to the generation of a pulse train using a counter output, the generation of a pulse train requires two counters here:
https://decibel.ni.com/content/docs/DOC-11729
Here is an article on the related to theory two frequency measurements in LabVIEW. In this article it can be seen that to perform higher frequency measurements, two counters are required to prevent roll over.
http://www.ni.com/tutorial/7111/en/
I hope these are useful to you.
Ingram
02-09-2015 02:01 PM
Finite (n>1) pulse train generaiton generation requires both counters on the 6221.
A couple of options:
1. Use a digital output task to output each of the two lines. Use a finite counter output (retriggerable) to generate the sample clock for the digital output task. Uses 2 counters + digital output subsystem.
2. Use ctr0 to generate a single pulse (re)triggered from PFI0. Connect the ctr0 output to a digital input line. Configure a digital input task with change detection timing using this line as the sample clock (rising and falling edges). Use the change detection event to (re)trigger the single (shorter) pulse output on ctr1. Uses 2 counteres + digital input subsystem.
3. Use different hardware (e.g. X Series cards only use one counter for finite generation and have 4 total counters).
Best Regards,
02-11-2015 11:29 AM
Thanks for your replies.
I followed John's second option and hurray, I managed to generate the signals I wanted on ctr0 and ctr1. Now, I tried to slightly delay the 2 pulses with respect to PFI0, but it does not look like a trivial task. Can anyone give me an idea how to do it?
I am attaching my (working) vi. Any suggestions highly appreciated.
Adrian
02-11-2015 11:56 AM
I couldn't open your VI as I'm using LV 2011 on this computer still.
However, you should just set the initial delay as well as the low time to whatever delay you want with respsect to PFI0 on the ctr0 task.
Some other NI DAQ products behave differently, but the 6221 uses "low time" for the initial delay for every retriggered output after the first one.
Best Regards,
02-12-2015 08:45 AM
Thanks a lot John! Apparantely it is working!
Initially I was using DaqmxCreateChannel/CounterOutput/Frequency for both CTR0/1.
Changed to DaqmxCreateChannel/CounterOutput/Time for CTR0 and I managed to get the result I want!!!
I'm attaching my vi (LV2011). It may be of use to other people;
Thanks again.