11-26-2007 08:20 AM
11-26-2007 11:03 AM - edited 11-26-2007 11:04 AM
Hi Dave,
This is actually a HW limitation - M-Series devices (like the USB-6221) have two counter timers. In this case, the finite pulse train generation takes up two (one to generate the pulses and a "paired" counter to gate it) and the position measurement takes another - so that is the HW resource conflict you're running into. Luckily there are usually ways around this, depending on the application.
You mentioned using AO and DO - are you using the retriggerable finite pulse train as a clock for those? If so, you have another option, though it will take up additional resources: Single pulse generation only takes one counter. You can have a retriggerable single pulse train running, and use that to gate your AO sample clock - this will provide similar behavior, but since the AO sample clock is free running and not necessarily in sync with your trigger signal you could have a jitter of +/- a sample for each retrigger occurrence as well as some time jitter.
Another option would be to use the retriggerable single pulse as the sample clock for an AI task. Since AI acquisitions on M-Series boards are multiplexed, they use a sample clock and a convert clock (for Multichannel acquisitions). You can use the single retriggerable pulse as the sample clock, and then use the convert clock as the actual retriggerable pulses - which can be routed to the AO and DO sample clocks. This is assuming you aren't already using you AI for something else and unfortunately would limit the number of pulses to the number of AI channels on the device.
There may be other options based on why you need the retriggerable pulse train - what is is going to be used for? Also, please post back if you need more details on how to implement any of the options detailed above.
Cheers,
Andrew S
02-08-2008 04:07 PM
02-13-2008 12:32 PM
02-13-2008 02:29 PM
02-15-2008 02:34 AM
Hi again Dave,
Aittached is the VI saved for 8.0. I know you’re working in C++, but maybe it will give you some ideas. I believe it does require an external signal to gate the counter as you mentioned.
I am taking a look at your new idea to see if it will work. Are you not able to get a pulse train from Ctr0InternalOut or is it that you are unable to route it to the source input of Ctr1? I’ll see if I can make something similar work on my machine.
02-18-2008 09:25 AM
It turns out that I needed to call this function:
int32 DAQmxExportSignal (<taskHandle>, DAQmx_Val_CounterOutputEvent, <terminal name> );
to route the counter output event to the correct output terminal. According to Counter Parts in NI-DAQmx in the C reference help, that route is made automatically for counter output applications, but not for counter input applications. However, I still only get one pulse each time the counter reaches terminal count, rather than a pulse at each change of the counter value. So for the time being, I am still using the A (or B) encoder input directly as the source for the second counter.02-19-2008 10:59 PM
02-20-2008 09:59 AM
02-21-2008 06:56 AM