LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Windows XP & Loop iteration rate problems

Hi All,

I am a bit confused with this problem and I was wondering if anyone has experienced this before or has any tips on overcoming it.

I am running a fairly simple VI, containing 2 analog inputs, a PID control with a counter output and a few subvi's which do simple calculations. My front panel contains a table, a waveform chart, and a few indicators.

My problem is that when I run the VI normally, the loop iteration rate is approx. 100ms, which is far too slow for my application. However, if I call attention to Labview, such as by right clicking on an indicator, my loop iteration rate drops to approx. 5ms!! (This is acceptable for my control system.)
I looked at the task manager and my mem usage is ~50% LV and 50% s
ystem idle process when run normally, and ~98% LV when I do the right click thing. This to me seems all backwards as the system idle process doesnt actually take any mem usage, it basically tells you that your system has ~50% free resourses.

My PC is a P4 2.4GHz with 512MB Ram, which I think is far more than adequate for this application. I am running LV7 using a PCI-6013 card.

any ideas or suggestions would be greatly appreciated.

thanks
David

p.s. None of my indicators are on synchronous display which i understand slows down loop rates. Execution is set to High priority. LV is set to High Priority also through Task Man.
0 Kudos
Message 1 of 5
(3,060 Views)
there have been issues in the past about loops and XP/2000. I do not know how skilled you are in labview and i do not want to insult your intelligence but have you tried inserting a wait function with just 1msthis will allow windows to free up some memory. If you watch the task manager, if you do not have a wait function in your system resources will go to 100% but if add the wait function then this will free up your processor. But like I said I do not want to insult you. Because i have only been using labview for a couple of months.



Joe.
"NOTHING IS EVER EASY"
0 Kudos
Message 2 of 5
(3,060 Views)
Thanks for the quick response & no insult taken since I also have been using LV for a few months.
I dont have a wait function because I would like the system to run as fast as possible.
I'll try adding a wait function to see what it does with resources. However, like i said, windows is telling me that 50% of my resources are free under normal operation but LV is slow. Only when the system thinks I am going to change something on the FP, does LV increase it's usage to ~98%.

thanks again.
0 Kudos
Message 3 of 5
(3,060 Views)
Thanks for the quick response & no insult taken since I also have been using LV for a few months.
I dont have a wait function because I would like the system to run as fast as possible.
I'll try adding a wait function to see what it does with resources. However, like i said, windows is telling me that 50% of my resources are free under normal operation but LV is slow. Only when the system thinks I am going to change something on the FP, does LV increase it's usage to ~98% (and loop rates decrease).

thanks again.
0 Kudos
Message 4 of 5
(3,060 Views)
Hello David,

It sounds to me like there are some thread issues here. I guess that by right clicking on the indicaor yo are blocking the User Interface thread, allowing all other threads to run undisturbed. The suggestion with the wait seemed like a good idea to me, have you tried using the "Wait Until Next ms Multiple" VI, with about 5 ms as a deleay? If this does not help, maybe changing the threads of different SubVIs might help. Thry going to File->VI Properties and select the category execution. Here you can change the thread and priority of each VI. Meke sure your SubVIs are nor running in the "User interface" thread, usually SubVIs have "Same as caller", try other 1 or other 2. Remember that everything that needs to be displayed takes a lot of time compare
d to calculations in the backround. It might be a good idea to consider what really needs to be displayed, especially since large arrays and conversions to strings might use up lots of available cpu. Also, make sure none of your indicators are overlapping, and consider updating your indicators only when really needed or in packages, e.g for a grapph, maybe displaying multiple updates instead of a single Value might help, this can easily be done with a case structure inside your while loop.

Other than that, try going to Tool->Advanced-> VI Profiler, this tool can help you check what vi's are using up memory and cpu time.

Hope this helps

Nick
0 Kudos
Message 5 of 5
(3,060 Views)