キャンセル
次の結果を表示 
次の代わりに検索 
もしかして: 

timed loop - timing not consistent

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!

 

 

 

timed loop.JPG

0 件の賞賛
メッセージ1/15
4,797件の閲覧回数

This thread might help you.

 

Ben64

0 件の賞賛
メッセージ2/15
4,790件の閲覧回数

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?

 

 

すべてをダウンロード
メッセージ3/15
4,787件の閲覧回数

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.

delta.JPG

 

0 件の賞賛
メッセージ4/15
4,754件の閲覧回数

Also, what is your LabVIEW version?

0 件の賞賛
メッセージ5/15
4,747件の閲覧回数

I have 8.5

0 件の賞賛
メッセージ6/15
4,739件の閲覧回数

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...   

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 件の賞賛
メッセージ7/15
4,709件の閲覧回数

Hi,

 

in WinXP the resolution of that timing function is limited to 15.6ms. So your results will always show differences of (multiples of) 15.6ms...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
メッセージ8/15
4,707件の閲覧回数

Is there a work around for this limitation or is this something I have to live with?  Thanks!

0 件の賞賛
メッセージ9/15
4,664件の閲覧回数

Hi akelei,

 

see for yourself:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 件の賞賛
メッセージ10/15
4,653件の閲覧回数