06-12-2009 02:21 PM
Hi, all
I have a sequence loop in while loop that is controlled by a "elasped time function". After several hours of program operation, the timer stops and causes cycle to freeze. This always happens (about 1-10 hours after run start) despite the length of cycle steps. I cannot determine the cause of this problem and any insight is appreciated. I use Labview 8.2v and have attached the vi and screen capture of the function loop.
06-12-2009 04:30 PM
You must have a 50 inch monitor !
Do you keep somewhere data in memory? Maybe those data grow to big.
You should not draw so big vis. Use subvis.
It is hard for someone to read your code. For me impossible
06-12-2009 05:10 PM
It's impossible to tell from a casual glance at the code.
Still your small loop in the lower left consumes all CPU it can get, spinning as fast as it can, millions of times per second. It needs a small wait statement.
06-12-2009 06:44 PM
Thank you. Pnt.
We save the data from mass flow controller and milliohm-meter into the labview file.
Could you explain in details about " Use subvis" in your reply?
Thank you.
06-12-2009 06:49 PM
Thank you, Altenbach,
I'm just wondering if all the loop needs a wait statement. Is it more stable for the program?
Yoon.
06-13-2009 03:05 AM
Subvis are used to group a piece of your code and make it a subvi. This way in your main vi you will only see a small icon, instead of that piece of your code. It makes the code more easy to be read and it will help you write bigger programs. Another problem you have is you leave a lot of white space. Try not to.
Can you show us where that data are guthered and saved ?
Try deleting it and let your program run for a few hours. If it runs ok, then the problem will be in that piece of the code.
06-13-2009 11:54 AM
swsyoon wrote:I'm just wondering if all the loop needs a wait statement. Is it more stable for the program?
Wy wait comment was just generi. Most likely it is not the caouse of your problem. Any while loop should only spin as often as needed. For example, to update a timer, the loop rate should depend on how many decimal digits of the time you need to show. SInce your code runs for a long time, maybe once/second is entirely sufficient.
Still, this is certainly not the cause of your problems but it is impossible to debug your VI.
Can you check for memory leaks? Run the VI for extended periods and see if the memory use increases over time.
Check all your subVIs. Who wrote them? All your subVIs deal with instruments and visa resources. Do you properly close all references before creating new ones? Can you attach a few of your subVIs? You constantly open Labjacks (last frame)... do you ever close them??
All indications point to a serious resource leak somewhere.
It would really be beneficial to tear down most of the code a rewrite it from scratch using a more reasonable design template. The outermost structure needs to be a while loop. What good is a tab structure if the code in the other tabs cannot run?