I'm using a USB-6211 to count pulses that can vary in frequency from zero to about 5k. I've tried using HighFreq1Ctr (using the 80 MHz time base) and feeding my pulses into the Gate of Counter 1. This works fine as long as pulses are being generated but it gets timeouts when the frequency goes to zero. If I set timeout value to -1 (infinite) it simply hangs, waiting for a pulse. I'd like to have a way to simply report a frequency of zero and have it start measuring again, since the frequency will be changing continually.
I think this means I need to change to using the two counter method so I've changed to HighFreq2Ctr now feeding my pulses into the Source of Counter 1 and generating a pulse of known duration with Counter 0 for the Gate. Hopefully this will measure the number of pulses within the "gate time".
I am using these function calls to generate the pulses (which will be externally routed to the gate :
AGniDAQmx_CreateTask(instrHandle,"MotorSpeedFromSensors_,Task_Handle8)
AGniDAQmx_CreateCOPulseChanFreq(instrHandle, Task_Handle8,"Dev1/ctr0",DAQmx_Val_Hz,DAQmx_Val_Low,0,8.333,0.5)
AGniDAQmx_ClearTask(instrHandle,Task_Handle8)
However, no pulses are being generated. I think it's because I don't have a ARM trigger to start the pulses. How do I do this? I'd like the counting/pulses to be continuous so the I just need a way to get them started.
Any help?
Thanks,
-CBJohnson