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.
Attachments:
RH cycling.vi ‏394 KB
block.JPG ‏125 KB

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.
We cannot run your VI, because of missing subVIs.
Do you know if any of your subVIs contain third party DLLs?
Your entire code structure is designed inside-out, making very little sense.
What's the story with the start button? Are you using the "continuous run" button to operate this VI??? Don't!!!
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.
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.
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?
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?
LabVIEW Champion . Do more with less code and in less time .

Similar Messages

  • Operating system causes loss of data during writing to file continuously

    Within a while loop I read data from serial port (9,5KByte/sec, bluetooth dongle via serial port protocol) and writes them to a file (text-file) continuously. The operating system interrupts the while loop periodically which causes a loss of data. If I read data from serial port without saving them no data get lost.
    E.g. on my PC the OS (W2K) wakes up a second hard disk exactly once per hour which freezes the data saving process to the 'saving' hard disk (and therefore also the while loop, data reading) for about 5-6 sec. On a Laptop the OS (XP, one single hard disk) interrupts the data saving process every 10 minutes for about 1 sec. during the first hour and not any longer afterwards.
    I have al
    so tried to use the 'deny read/write' option of the 'Open File.vi' to prevent other file sweeping applications (backup, anti-virus, Fast Find) to open the file simultaneously which could temporarily deny you write access to the file - no success.
    BTW, this concerns also the compiled version of my LV7.1-program.
    Any suggestions?
    Thanks,
    Tobi

    Use two loops, one for reading the serial data and a separate one for writng to the file. The first loop reads the serial port and writes the data to a queue. The second one reads the queue and writes to the file. Put a delay in each loop, perhaps zero milliseconds in the serial loop and 10 ms in the file loop (try various values). This causes the LV scheduler to share CPU time between the two loops.
    Now the serial loop will acquire the data and store it in the queue which also serves as a buffer. If the file loop gets blocked by the OS, the data just stacks up in the queue.
    Lynn

  • How to stop a "continue if true loop" inside a "stop if true loop"?

    Hello guys, I have "continue if true loop" that I want to stop when I press the stop button of the surrounding "stop if true loop".
    Notice that I ran through all of this to keep the push button released and keep the LED lit.
    However, when I press the stop button nothing happens, so:
    1) How can I overcome that?
    2) Are the shift registers even necessary?
    (Please fix my VI)
    T. A.
    Attachments:
    prob.vi ‏7 KB

    Your code makes no sense. Why don't you study it with execution highlighting while operating the controls.
    What is the purpose of the shift registers? none! Delete them. Why did you place them?
    If you want LabVIEW to react to a button, the control terminal should be in the innermost loop. Currently, the code cannot escape from the innermost loop, because the value of the termination condition cannot change. It will spin millions of times per second doing nothing useful.
    There are many ways to keep an LED lit after a latch action switch, e.g. with an event structure. (see attached. Make sure to stop the VI with the stop button, else the LED remains lit.). Of course the code is pretty dumb, because you can never turn the LED off again while the VI is running.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    probMOD.vi ‏8 KB

  • How to stop  after first loop operation  over?

    Hi friends.
    How to stop  after first loop operation  over?
    I have a loop operation in module pool program.
    After first loop over I want to stop.
    I used the STOP keyword, but it is going to dump.
    Thanking you.
    Regards,
    Subash

    Hey,
    The statement STOP is forbidden in methods and, since release 6.10, leads to an uncatchable expection during the processing of screens called with CALL SCREEN...
    As they said above, use a EXIT statement to fix this DUMP...
    Regards,
    Diogo Carvalho

  • Stopping producer consumer loop at the same time

    In my application I am using producer consumer architecture. In the producer loop, I am acquiring data, processing and outputting the result (feedback control system). Also in the same producer loop I am inputting all the data to a queue and then in the consumer loop I am writing data to a file. I have a stop control on the front panel and error from the queue and  error from the data acquisition all wired to OR gate to stop the while loop. ( I attached the picture of the code). Whenever I press stop form the front panel program wont completely stop. I think it is because consumer loop still running. Is there way to stop  the both loops at the same time. I tried creating local variable but it slows the program. Front panel stop control mechanical action is set to switch when released.
    Attachments:
    app.PNG ‏262 KB

    In the consumer loop you should check the error after the Read Queue function.
    TOn
    Free Code Capture Tool! Version 2.1.3 with comments, web-upload, back-save and snippets!
    Nederlandse LabVIEW user groep www.lvug.nl
    My LabVIEW Ideas
    LabVIEW, programming like it should be!

  • Loop #  of times, stop at specific frame

    Hi there,
    I'm having trouble finding the answer to a simple (I hope)
    question. I made a flash banner and have successfully added an
    action that will loop it 3 times, stopping on the last frame. Here
    is the code I entered in a separate action layer:
    INSERTED A KEYFRAME IN FRAME 1:
    if (numberOfTimesToLoop<3) {
    gotoAndPlay(1);
    numberOfTimesToLoop++;
    } else {
    stop();
    INSERTED A KEYFRAME IN MY LAST FRAME OF THE TIMELINE:
    if (numberOfTimesToLoop<3) {
    gotoAndPlay(1);
    } else {
    stop();
    Works beautifully, only I need the movie to stop on frame 274
    on the last loop, where I want certain elements not to fade out (I
    have 279 frames in my movie). Can anyone help me out? I'd really
    appreciate it!

    I'm not sure I understand what code I'm supposed to put in
    frame 279 exactly.. There are two elements (on two separate layers)
    that need to stop at that frame on the 3rd loop.. I tried putting
    something like this on frame 279 of one of those layers:
    if (numberOfTimesToLoop=3) {
    stop();
    O so close.... but like with all code its either all right or all wrong.
    the 2 diffrent layers don't matter if your stoping the main timeline.
    go to frame 279 open up your ActionScript window and type in:
    if (numberOfTimesToLoop == 3) {
    stop();
    That is little guy is called a
    Comparison Operator
    http://flash-creations.com/notes/actionscript_operators.php  <==good site discribing them.
    Good luck and I hope it helps
    JT

  • How to make a button to stop and run a while loop?

    Hi all,
    I am a beginner in the Labview. I did a program that contains a while loop, its stop condition is connected to button. I selected “switch when pressed” to be the operation of this button. Our teacher asked us to make this button stops the loop if it is pressed and its name is converted to run instead of stop. And if it is pressed then again it starts the loop from the point it stopped in.
    Can anybody help me, please?

    First, please use a smaller font when composing your messages.
    You will need two while loops.  An inner loop which has its stop terminal attached to the stop button.  Put that in the False case of a case structure.  Wire a local variable of that stop button to the case selector of the case structure.  Put the case selector inside another while loop which is the one that keeps the program running no matter what the state of the original Stop button.  You will need a master stop button to stop the outer loop when you are ready to end the whole program.  Don't forget to put small millisecond waits in each of the loops so that the loops don't eat up all the CPU resources.
    For that stop button, you could rename the True title to Run, so that when it is pressed to stop the inner loop, the button will show the word Run.  Pressing it again pops it back out, allows the false case to execute and the innermost while loop to run.
    You could also change the words on the buttons by using property nodes.

  • Stop syncronization of 2 while loops

    Hello all!
    Now in my project I got a serious problem. I have 2 while loops. One (loop 1) keeps receiving UDP messages
    from an external device and send a cetain type of message to another while loop (loop 2). The cycling time of 1st loop is
    300ms (it receives a UDP message every 300ms), the cycling time of the 2nd is 30s (30s is the receiving period of the certain type
    UDP message sent by loop1, and I used a notifier to transmit this message to loop 2, so the cycling time of second loop is 30s).
    At last when the num of the certain type of UDP messages received reaches 4, I want both loops stop, so as the program. However,
    at last both loops stopped but the program no!
    I'm quite sure it's the problem of the 'stop' of 2 loops, cuz when I don't use the notifier, not to control the cycles of the loop 2,
    at last both of the loops stop and the program could stop. But with the control of cycles of loop 2 (I mean the loop passes on cycle
    when receiving the certain type of message from loop 1), the whole program doesn't stop when both loops stop.
    So in this case, 2 loops with data dependency run with different cycling time, is it possible to syncronize the stop, in order to
    stop the whole program when both loops stop. Thanks in advance!
    Chao

    Hello Mister!
    I'm not sure in which way I could show you better my code, since the main vi contains tens of subvi.
    This pic doesn't show everything. I should explain that the higher loop is loop one which is receiving UDP
    message and send a certain type of UDP message to the lower loop.
    If you have a better idea about showing my code better, please tell me. Thank you
    Attachments:
    Immaginelabview.JPG ‏225 KB

  • I have recently got a new replacement iPhone 4.  since I got this I have found that my data allowance is getting used up during the night while my phone is charging on the bedside table.  How an I find out what is causing this and stop it happening

    I have recently got a new replacement iPhone 4.  Since I got this I have found that my data allowance is getting used up during the night while my phone is charging on the bedside table.  How an I find out what is causing this and stop it happening?  Some nights the usage is 150 meg!

    You can not access the backup directly.
    Did you restore your replacement from this backup?
    If so then you already have everything in the backup on your device.
    If not, you can wipe the device and restore from this backup:
    Settings > General > Reset > Erase All Content & Settings
    What is it you are worried about losing that isn't already on your current device?

  • While watching rented movie it stops during playback, how do i fix it?

    I rented a long movie and it continues to stop during playback, how do I fix that?

    Hi dedesgirl,
    Welcome to Apple Support Communities.
    It sounds like there is an issue playing songs in iTunes. Does the playback issue only occur with specific tracks and were they purchased from the iTunes Store? Take a look at the article linked below and try the suggestions which will resolve most iTunes and QuickTime Player playback issues.
    iTunes and QuickTime for Windows: Audio does not play or plays incorrectly
    http://support.apple.com/kb/TS1362
    I hope this helps.
    -Jason

  • How do I stop an infinite loop because of a poorly placed user prompt during developmen​t without closing LabView?

    How do I stop an infinite loop because of a poorly placed user prompt during development without closing LabView?
    Thank you!
    Solved!
    Go to Solution.

    chuck72352 wrote:
    Here is an example of a VI that I can't stop.
    Epic Fail
    but seriously, as was suggested, download Darren's Abort.vi. It comes in very handy for these.
    Message Edited by Broken Arrow on 05-03-2010 01:06 PM
    Richard

  • I bought CS4 a while back, and only loaded it one time on a PC with Windows XP operating system...

    I bought CS4 a while back, and only loaded it one time on a PC with Windows XP operating system. I understand I can load it 2 times. Will it work if I load it on Windows 8?

    You won't know until you try. These older versions were never extensively tested or certified on Win 8, but it should work for the most part iuf you follow the necessary procedures liuek turning off UAC and otehr fancies that may get in the way.
    Mylenium

  • Apple Tv stops during movie several times to load. Very ANNOYING

    Why does my Apple Tv stop during movie several times to load. Very ANNOYING

    This will be due to the network.
    What is your current connection vis speedtest (needs at least 6mbps)
    Make sure DNS is set to auto (setting - general - network)
    If on wifi try ethernet

  • I have never been able to migrate my ibooks library from iTunes to ibooks. Setup stops during creating ibooks library with the following error message:iBooks quit unexpectedly while creating your library.

    i have never been able to migrate my ibooks library from iTunes to ibooks. Setup stops during creating ibooks library with the following error message:iBooks quit unexpectedly while creating your library.

    Hello cpikehfx, 
    Welcome to the forums. 
    You can try one of the two options below to work around your issue. 
    Drag and drop the files from the desired music folder to the BlackBerry Music folder using the computer.
    Open the desired music folder on the computer
    Go into Computer or My Computer and open the BlackBerry network drive
    Open the Music folder
    Drag the desired music files from the computer music folder to the BlackBerry Music folder
    Try a different Windows profile.
    Go into the Control Panel and create a new user account
    Put some music files in a folder that is accessible by all profiles or transfer them to the BlackBerry device
    Log out of the current profile and log into the new profile
    Transfer music into iTunes or Windows Media Player
    Launch BlackBerry Link and go through the setup configuring the music source of your choice
    Click on the Computer name in the bottom left corner of Link
    Select Music on the left side
    Drag and drop the desired music files from the list to the BlackBerry name in the bottom left corner of Link
    If neither of these options work for you then you will want to contact your mobile service provider and ask that this issues be escalate to BlackBerry support for investigation. 
    Hope this helps. Have a good day. 
    -SR
    Come follow your BlackBerry Technical Team on twitter! @BlackBerryHelp
    Be sure to click Kudos! for those who have helped you.Click Solution? for posts that have solved your issue(s)!

  • Is there any way to not wait for a subVI to output so that the background loop can continue (until the output exists)?

    hello everyone,
    I am in a loop but want to modify an element in that loop. This modification takes time, but i cannot have the loop stop while it is being changed or else the buffer overflows and crashes the computer.
    Is there any way to make the output null until the subVI finishes and actually gives the desired output? This way the loop could continue until the subVI's output is ready.

    Inside the subVI, you can set a condition, for example, if data is not given, set the output to some kind of value (NaN is good for numeric), if data is present, just take it out. But be sure the subVI has no loop to get data, but check data only once. If you need a loop to get data, you'll have to put it in paralell with the main loop.
    Hope this helps

Maybe you are looking for

  • Locking problem in VL02N at the time Post Goods issue

    Hi, We have implemented 2 BADIs to change qty in delivery and in subsequent documents. Once we receive an IDoc with batches, then we need to change subitems qty according to no of batches. Once IDoc has updated, then PGI will do automatically. 1. LE_

  • Trouble with Business Catalyst FORM in Muse

    I created a contact form at Business Catalyst, added it there to a published web page, copied the HTML, and inserted the HTML in Muse. I placed the HTML on its own layer, and positioned it on the contact page, then edited it for style. This is what i

  • Safari's Reading List web sites

    Safari's Reading List sync'ed with iCloud while behind a web traffic monitor, now links/web pages are not available. Bookmark file has the serverID flag though, how can I reconstruct my reading list?

  • MacBook Pro retina vs MacBook Air lifespan?

    I am an incoming college student and I'm considering either one of these laptops in the 256gb version with a ram upgrade. I was actually looking more into the air but I hear that the lifespan of the air isn't as long as it pro will last me. I'm only

  • Ps cc get stuck in pc

    1. When I used Wacom pen in PS CS6 it worked smoother than PS CC. How can I fix this issue? Please use clip attached as reference. 2. When I used brush tool, I did right click, the tool didn't changed to brush options. I have to click and move the pe