Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

How to optimize the performance of a RT Loop in order to prevent late finishing

In order to prevent late finishing of my RT-Loop I want to optimize his performance. I didn`t understand the meaning of the sleep time in this context...Especially using the RT-Loop, wich is controlling the application at the same time with the Host Loop for Analysis reasons results in late finishing of the RT-Loop. How can I optimize the performance? 
0 Kudos
Message 1 of 5
(4,607 Views)
You should use a timed loop to control timing and priorities in your realtime application.
I wiuld recommend you to check this online-presentation first:
http://www.ni.com/swf/presentation/us/labview/timeloop/

After that have a look at these resources:
http://zone.ni.com/devzone/devzone.nsf/webcategories/B8D8F00D8FB6FE8B86256B5D00798F76

If you have any questions after that feel free to come back to this thread and post your questions.

Hope this helps!
0 Kudos
Message 2 of 5
(4,593 Views)
Thanks for the links...They helped a lot. Still I have a question about the sleep time. I still don´t know how it works...As the work which my RT-Loop has to do each time executing the loop is limited I don`t really understand why the CPU usage of my RT-Target is lower, when I increase the sleep time, as the CPU has to do the same work with and without sleeptime. Is it because the RT-Loop is not trying to acquire data during the reading process from my analog card and is sleeping during the acquiring process?  
0 Kudos
Message 3 of 5
(4,453 Views)

Hello

I have a problem with finishing late in an RT project, using PXI 8186 as target connected to CPU as host through an ethernet connection.

 I had used the creat project wizard in LabView 8.0 in creating the project, I had recognized that there is single timed loop and double loop based selection.

My main target is to be as fast as possible (higher possible sampling rate), I had used only one shared variable to stop the program from the hast.

The question now is, which is faster single timed loop or double loop? What can I do to be faster and prevent finishing late?

 

Thanks

Waleed

 

0 Kudos
Message 4 of 5
(3,892 Views)
Hi Waleed,

First, this post is a little old, thus the people who worked on it before are probably not monitoring it.  Next time I would open a new thread.

I understand that you want you target to be as fast as possible, but there is no one answer.  If you are doing data acquistion from a DAQ card, then processing at the same time, a producer/consumer architecture is best.  If all you are doing is generating a random number and adding 1 to it, then a single loop is best, as there is overhead in the switching between loops.

Also I would like to say that making real-time go VERY FAST is acheivable, but not really the purpose of real-time.  Real-Time gives you more control over the priorities of your application, as well as a more rugged control operating system.  Speed is typically NOT why you use real-time.  If you want speed, then look more to the hardware being the latest and greatest.

Maybe if you explain your application we can offer up a possible architecture.
"If you want to succeed... Architect" - The Specialist
0 Kudos
Message 5 of 5
(3,846 Views)