03-08-2010 08:25 AM
Hi,
Using USB-6210 on openSUSE 11.0 and DAQmxBase 3.3 and working from the C examples provided and relevant documentation.
I am new to working with the NI DAQmxBase.
I am trying to similtaneously generate 2 different finite pulse trains using the 2 counters on the USB-6210.
CTR0 is being used to generate a finite pulse train train at 480Hz for 150 cycles
This is clocking a counter on a external board which is generting a anolgue voltage range which I am feeding back into the DAQ AI channels for sampling after a hardware generated trigger on the PFI0 line.
I have the above system working fine but I want to introduce another single pulse which I can use to asynchrously clear the counter on the external board when the task starts.
My problem is that I cannot get the two CTR channels working similataneously.
Individually the code used to generate the 128 cycles on CTR0 and the single pulse (after small delay) on CTR1 is working fine and I can see this on the scope.
Is what I have described possible on the USB-6210 with DAQmxBase?
Is the a better way of dealing with this problem?
Should I be using a DO line rather that the CTR line to generate the pusle?
I have tried many ways of getting this working using delays but I see the same problem consistently.
Only one task seems to be able to operate at anyone time.
Thanks,
Francis
03-19-2010 10:10 AM
Hi Francis,
What you are trying to do should work fine with DAQmx Base, have you tried using a clear task/restart after the first counter is used (as you only need it at the start to clear the task) followed by the 480Hz counter? If you just want to use this to clear the counter each time could you use a PFI line to just send a single digital pulse to the device?
Kind Regards,
03-23-2010 06:56 AM
Hi Rob,
Thanks you for your response.
I have tried various sequences of start, stop and clearing the tasks but I am still getting unexplained pulses on the lines.
The best I have seen is when the task on CTR0 (clear pulse) is started and stopped immediately, then the task on CTR1 (clock) is started along with the task to acquire the samples.
There is still an extra low pulse generated on CTR0 just before CTR1 starts, this in not too bad a result as it just re-clears the counters but that code seems to waste about 300ms slowing down my overall read rate.
If you just want to use this to clear the counter each time could you use a PFI line to just send a single digital pulse to the device?
Could you expand on the comment about using the PFI to send a single pulse.
I had been focusing on the genDigPulse example with DAQmx Base but if it is possible another way I would lie to try that.
Kind Regards,
Francis