11-10-2010 08:59 AM - edited 11-10-2010 09:04 AM
Hi there!
We are trying to count a modulated 2MHz TTL pulse with an NI USB-6009 and LabVIEW 8.5. It's my understanding that the USB-6009 is capable of this since the specifications say that the maximum counter input frequency is 5MHz.
I am experiencing a rather odd problem with the attached VI. The VI is intended to display the value of the counter, then reset the counter when a digital line goes high by stopping the counter DAQ Assistant task. The problem occurs once the counter has performed one successful count-up operation and has just been stopped (reset). The loop then starts again to begin counting, however the counter appears to remain at 0. I removed the loop delay and noticed that in this state the counter increments briefly then resets back to zero, despite the digital line for resetting remaining low.
Can anybody help me reset the counter to a state where it will function without reverting to 0 continuously?
Thanks,
Urveen
11-15-2010 08:02 AM
Hi Urveen,
I've had a play around with the code you posted. I have witnessed the same behaviour as you. I unfortunately have no time left with a USB-6009 device that I was using but may be able to acquire another device at some point to try and continue this. I do have a couple of suggestions:
Regards,
Chris
11-15-2010 09:23 AM
Hi Chris,
I followed your advice and had a play around with the DAQmx example "Count Digital Event.vi" and came up with a VI incorporating a reset function simply by using a compound OR gate and an additional boolean control to stop the inner while loop. I've attached the solution for anyone's future reference, however I can't guarantee the quality of my work as I am quite a beginner with LabVIEW.
Now I will make a subvi for use in my main program.
Thanks for your help, and any feedback on this modification of the example DAQmx vi is greatly appreciated.
Urveen
11-15-2010 09:41 AM
Hey Urveen,
The code looks good! If it is doing what you want it to do then I'd stick with it.
Best Regards,
Chris