LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Timer stops during in loop while continuous operation

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.

Download All
0 Kudos
Message 1 of 7
(2,481 Views)

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 Smiley Happy

0 Kudos
Message 2 of 7
(2,462 Views)

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.

0 Kudos
Message 3 of 7
(2,455 Views)

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.

0 Kudos
Message 4 of 7
(2,444 Views)

Thank you, Altenbach,

I'm just wondering if all the loop needs a wait statement. Is it more stable for the program?

 

Yoon.

0 Kudos
Message 5 of 7
(2,441 Views)

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.

0 Kudos
Message 6 of 7
(2,433 Views)

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.

  1. We cannot run your VI, because of missing subVIs.
  2. Do you know if any of your subVIs contain third party DLLs?
  3. Your entire code structure is designed inside-out, making very little sense.
  4. What's the story with the start button? Are you using the "continuous run" button to operate this VI??? Don't!!!
  5. What's the story with the big case structure tied to the tab structure? Since your code is inside-out, operating the tab during run makes no difference in the code. Large portions of code are inaccessible.
  6. You have extrememly confusing code the way you wire in and out of frame one at the bottom. Maybe that code at the bottom should all go inside the first frame.
  7. You error handling is no handling at all. You just display the error indicators. Shouldn't the code depends a little bit on error status?
  8. Even the UI is confusing. Labeling a stop switch with ON/OFF makes no sense. You turn STOP to OFF to stop the 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?

0 Kudos
Message 7 of 7
(2,416 Views)