10-19-2012 07:14 AM
I am using DAQmxReadCounterScalarF64 function I have my timeout set to 0.002 sec. I am running this function and collecting data at 100Hz. While looking at the collected data I seen inconsistency in the Frequency. I used NI I/O Trace to find out what was going on. The following is what I found.
DAQmxReadCounterScalarF64 (0x6DED5130, 0.002, 0, NULL) Call Duration 00:00:00.076 Status: -200474 (0xFFFCF0E6)
As you can see the call lasted 0.076 sec. This is a longer time than the 0.01 sec that my code runs.
My question is why does this function not timeout in the specified time?
My system running the .exe is Win7, DAQmx Device Driver 9.5.5, PCI 6036E. Code was compiled with CVI 2010 v10.0.1
Solved! Go to Solution.
10-22-2012 05:14 PM
Hello MikeD,
The timing of the 6036E is completely controlled by software. This means Windows is controlling the timing of your data aquisition. To increase your data acquisition timing, reduce the amount of processes in your acquisition loop and ensure you are starting your task before you start reading data.
10-23-2012 05:56 AM
All of my required task are started at the begining of my program. If I run the program with a simulated DAQ card the total process time of the loop is 0.002 sec.
I have attached my NI Trace results to show that at times the funtion DAQmxReadCounterScalarF64 reads in the proper amount of time while at other times the function hangs up.
10-24-2012 05:53 PM
MikeD,
Could you please post your code so that i can recreate this on my end?
Thanks!
10-25-2012 05:50 AM
You should be able to recreate it with the example called Pulse Width located at the following folder: C:\Users\Public\Documents\National Instruments\NI-DAQ\Examples\DAQmx ANSI C\Counter\Measure Period or Pulse Width
10-25-2012 04:53 PM
Alright, it isn't your code. I do believe running at 2 ms is too fast for a software-timed device. Try increasing the timeout to say .05 seconds, and see if you still see a value around .076 ms.
Also, what API are you using?
Thanks!
10-26-2012 05:50 AM
API NI4882 I am new in this area of my company and coding. I have been trying to update all of our test stands to Win7. With that upgrade I also had to change the code that was being used. Most of our test stands was not using DAQmx. The stand that I am currently working on was on of those not using DAQmx. Prior to the upgrade in code it worked just fine. Unfortunally, there is no one left with the company that woked with the original code to help me understand the difference.
10-29-2012 11:14 AM
Hello Mike,
Before upgrading to Windows 7, what operating system were these test stands running? The only way I could think to get that kind of accuracy is by using NI Real Time operating system.
For some more information, please see the following links:
http://forums.ni.com/t5/Counter-Timer/counter-timeout-6211/td-p/1953287
http://forums.ni.com/t5/Multifunction-DAQ/Counter-in-PCI-6229-to-count-edges/td-p/765209
Hope this helps!
10-29-2012 11:30 AM
Previously XP with traditional DAQ.
10-30-2012 06:37 PM
Miked,
Perhaps it would help if I knew a bit more about your application. What are you trying to accomplish with this function, and this program in general?
Also, did you try different values for the timeout and seeing if this problem remained? If so, what was the result of that test?