07-14-2010 05:04 PM - edited 07-14-2010 05:07 PM
@dave6k wrote:
, I set the duration to 2 ms and the samples per channel to 2.1 ms with a 50 Hz trigger and it is OK, but not if both are 2 ms.
Samples per channel is an integer and it represent the number of samples produced by one channel. It is not a timing number. So you cannot set samples per channel to 2.1 and the units are not in ms. There are no units. So try to explain again what you are doing. Or attach a snippet of your new code.
To output a pulse on every trigger edge, set the counter for finite samples, number of samples to 1, and frequency to 1000 for a 1ms pulse or 500 for a 2ms pulse. this should procude a pulse every 20ms or 50 pulses per second.
How are the AO and the counter related. Is your AO clock source the counter output? If not, then the AO is not related to the counter at all. What is your intention?
07-14-2010 09:08 PM
I have set the AO rate to 10000 samples/sec and I have a 21 sample data array, therefore it is 2.1 ms.
AO clock source is the counter output.
Here's the new code.
07-15-2010 01:43 PM - edited 07-15-2010 01:45 PM
So your counter should produce a pulse every 20mS and your AO outputs for 2.1mS. It should work if you set the counter frequency to 1000. But you have it wired to the same as the AO which is 10000. This will produce a very short pulse, but that may be OK. Set samples per channel to 1 for the counter. You only want the counter to produce one pulse per trigger.