LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to increase the loop timer resolution ?

Solved!
Go to solution

Hello everyone,

 I am using myRIO 1900 for my Active Noise Cancellation project. I need to process the audio signal @44.1kHz sample rate and 50 samples per frame . So, I am using myRIO High Throughput personality. 

Now my problem is simple, I want to measure the each iteration time ( loop time) . I went for normal tick count ( msec). Used in a standard way [https://decibel.ni.com/content/docs/DOC-11078]. 

But my indicator value is oscillating between 1 and 2. It is supposedly 1.13msec, but how to find the exact timer value ??

I think , I cannot increase the resolution of  tick count(msec) as it is by default has 1 msec resolution and I cannot use external clock source as I am using myRIO.

 

Help me to calculate the precise loop time.

 

Thank You.

0 Kudos
Message 1 of 3
(3,206 Views)

If this were running on Windows you could use the high resolution tick count function but the only way I know of getting sub ms timing on RT is to use a timed loop and monitor the iteration duration.  You can use a 1MHz timing clock which would give you a 1us resolution.

 

You just have to be careful with this because it will change the priority so it may change how your application is running and doesn't always correlate to how fast the process will run if it is not in a timed loop.

Matt J | National Instruments | CLA
Message 2 of 3
(3,145 Views)
Solution
Accepted by topic author charansai

RT has express VIs for timers.  You can use this: http://zone.ni.com/reference/en-XX/help/371361J-01/lvexpress/tick_count/

Message 3 of 3
(3,132 Views)