05-17-2008 06:37 PM
05-19-2008 03:35 PM
05-19-2008 03:45 PM
Hi Peter,
Welcome to the forums! I just want to make sure I understand what you are trying to do. You would like to count the rising edges of the 80 MHz clock using DAQmx in C++. In order to route the timebase to the counter, you need to use the signal name (PFI8) instead of the counter (Ctr0Source) for the counter source input. This name is found in Measurement Automation Explorer (MAX) by right-clicking on the device and choosing “Device Pinouts.” This will physically put the 80 MHz clock on the PFI8 line, so make sure you reset the device or disconnect the terminals after you are done.
That being said, may I ask what you are trying to do by reading the number of elapsed ticks? If you are trying to monitor a hardware timed pulse, it would be better to count the frequency or period of that pulse. This would provide better accuracy, because you are not relying on how fast DAQmx Read can poll the hardware. If you are simply looking for a software based timer, I would recommend taking a look at this MSDN forum post.
Using the GetTickCount function instead will free up your counter and provide comparable accuracy to counting the edges of the timebase.
I hope that helps you out, let me know if you have any further questions about this. Good luck with your project.
05-19-2008 07:39 PM
05-19-2008 07:43 PM