06-30-2012 10:54 AM
I have a timed loop that I want executed every 25ms. Upon looking at the time stamp, I get data every 16ms or 32ms. According to this article the accuracy for Windows XP should be 1ms. http://digital.ni.com/public.nsf/allkb/859DA6BB71B8A84F86256B3A0071141C What can I do to get more consistently timed reads?
Thanks!
06-30-2012 12:04 PM
06-30-2012 12:15 PM - edited 06-30-2012 12:17 PM
Works fine in Windows 7. What is your processor? Is this plain Windows XP or a virtual PC?
What do you get if you measure it the right way?
07-01-2012 09:28 AM
I'm running Windows XP Professional on a desktop PC. I have an Intel Core 2 Duo CPU. 2.2GHz with 3GB RAM.
If I write out the Period I get 25ms. But if I take a delta these are my times. I have tried it on 3 different computers all running Windows XP Professional and the results are similar.
07-01-2012 11:30 AM
Also, what is your LabVIEW version?
07-01-2012 11:45 AM
I have 8.5
07-02-2012 04:18 AM - edited 07-02-2012 04:25 AM
Two things to check:
1) Prevent memory allocation:
Change your "benchmark" to terminate after a given number of iterations (e.g. 200). Create an array for your timestamps beforehand and replace the appropriate element during the loop in order to prevent LV to allocate new memory each iteration (and copying the array around a lot).
2) Prevent CPU Core swaps:
Using the Windows Task Manager, set the process LabVIEW.exe to only run on a single core. To do this, rightclick LabVIEW.exe process in Task Manager and select "CPU Affinity". Deselect all cores except one.
I wouldn't expect test 2) to give any different numbers than those you are seeing, but give it a try....
Norbert
EDIT: Don't forget to reconfigure your LabVIEW.exe process to use both cores once finishing the test. Restart LV should also enable both cores again...
07-02-2012 04:23 AM - edited 07-02-2012 04:24 AM
07-07-2012 11:25 AM
Is there a work around for this limitation or is this something I have to live with? Thanks!
07-07-2012 11:43 AM