Dsc periodic I/O "stop while loop" usage?

I'm using LabView 8.5.1 with DSC.  I have created a working periodic I/O server VI and successfully deployed it. 
The one glitch I am running into is what happens when the Shared Variable Engine I/O process is terminated.  I normally terminate it by using "remove process" from Variable Manager.
The I/O server wizard lets me choose the while loop for termination during the build process, but any code following the while loop is not executed.  In fact, the process continues running for 10 seconds until the "abort VI timeout" is reached, at which point the VI stops.  The "stop" terminal of the main while loop is wired to a "create control" "STOP" button on the front panel.  Publishing or not publishing the "STOP" control during the I/O wizard process has no effect.
I'd like to do cleanup steps after the while loop terminates.  Unfortunately the "Heat Exchanger" example has no code after the while loop to illustrate the concept.
What am I missing? 
Thanks,
Mike

Hi Van - let me clarify my question...
I don't believe that the termination portion of the DSC "periodic I/O server wizard" actually works properly, or at least an example is needed of how to make it work.
It appears to me that the wizard functionality of "choosing the server termination method" might not work.  Within the wizard, the two options are to abort the running server VI, or to choose a "while loop" to be forcefully-terminated with a standby timeout value to force a VI abort anyway, if the while loop does not exit.
I set up a simple server VI with one main while loop that does RS-232 I/O with a "running" beep on a 1 second timer.  After the while loop is another small block of code that closes the serial port, and a different "terminating" beeper.  When I run the VI interactively, both beeps work fine.  When I use the wizard to turn it into a server and it is deployed to the SVE, the beeps begin normally.  When I stop the SVE process via "remove process" in Variable Manager, the "running" beeps continue for another 10 seconds until the abort timeout occurs, even though with the wizard I specified the only while loop in the VI to be aborted.
The heat exchanger example works fine.  Unfortunately it does not have any code following the while loop, so it doesn't shed any light on this issue.  Ideally that example would be updated a little to show how to use the "while loop termination" feature.
Basically my request comes down to this:  is there a way to actually make this work, or is it another in the list of bugs in 8.5.1?
Thanks,
Mike

Similar Messages

  • How to stop while loop for particular time

                    public void test()
                   new Thread(new Runnable()
                        public void run()
                             //Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
                             System.out.println("test");
                             //System.out.println("test ..."+i);
                             try
                                  Thread.sleep(3000);
                             catch (InterruptedException e)
                   }).start();
            public void startTest()
                    while(i < marquee_Str1.length)
                   marLbl1.setValue(marquee_Str1); //set value to textbox for perticular id
                   marLbl2.setValue(marquee_Str2[i]);
                   marLbl3.setValue(marquee_Str3[i]);
                   test(); // call thread function
                   i++;
    in this code while loop don't stop
    plz help me to stop while loop for certain period by using thread or other technique                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

    Yes.. the original problem would be your test() method put the sleep in an entirely separate thread of execution. So the thread is created then the method just keeps waiting. The while loop should directly call Thread.sleep... which you have apparently figured out!

  • How to stop while loop

    I can't figure out how to stop a while loop in my labview program. 
    When the user presses the Run arrow in the toolbar I want my program to begin reading the serial port for GPS messages.  These messages should be displayed on the front panel.  Currently I have this read/display in a while loop.  The program is also waiting for an extrenal trigger.  When that trigger arrives, I want to grab the current string from the serial port and save it and continue reading and displaying the serial/gps string.  This trigger starts the other parts of the program- signal generation, recording, and saving data which need to run concurrently with the serial/gps reading/displaying.  Once the AO and AI have finished and the data have been written to disk, I want the program to stop.  The serial/gps messages should be updating this whole time.  Only when the data are written to disk should the whole program end.  This whole sequence of events should only be done once when the user preses the Run arrow. 
    So far I'm unable to pluck the serial string when the trigger comes in if I'm watching the serial port all the time.  The program also doesn't stop when it finishes writing to disk because the read serial while loop is still running.  I don't want to use a front panel stop button.  The program should stop itself when the data havebeen written. 
    I'm really stumped on this one but I'm new to LabVIEW so I'm sure there's an easy solution to this. 
    Thanks for any and all help. 
    Attachments:
    SPoleLakeChirp.vi ‏199 KB

    Dennis and altenbach-  Thank you both for your patience. 
    I was trying to do just what Dennis suggested-"As I said, setting a local variable is one way." even before posting to this forum, but I couldn't get my local variables to reflect changes made elsewhere in the program and I wasn't able to wire from them because they were writes.  The critical part I was missing was how to change a local variable from a write to a read.  It was staring me in the face the whole time- just right click.  When I finally found it, my problems were solved. 
    altenbach- thank's for putting the figures together.  I do understand the logic and wiring there, but I was really trying to avoid stop buttons.  The program should be smart enough to figure out when to stop.  And using local variables turns out to be one way of solving this.  I still have some clean up to do, but I've included my current working version just so you can see how I implimented your suggestions.  There's still a lot of clean up to be done, but I'm delighted to be able to watch the serial/gps messages until I'm done reading in data.  At first I had this stop variable set in the final sequence frame.  That didn't work because I wasn't getting to the final frame because the loop wasn't finishing.  Once I placed the stop variable in the same frame as the while loop it began stopping when it should. 
    If you have other comments/critiques about the wiring diagram I'm earger to hear them.  I'm considering the structure finished, however.  It still needs cleaning up and commenting, but I'm satisfied with the functionality. 
    Thanks,
    Peter
    Attachments:
    SPoleLakeChirp.vi ‏210 KB

  • How to stop While Loop in Event Structure with same button?

    Hello,
    I have a problem. I want to use one control to activate an event in a event structure, and the same control to terminate a while loop in that event.
    It is possible to use 2 controls to do this, but I need it to be only one.
    Thank you  
    Message Edited by Heinen on 02-19-2009 06:16 AM
    Message Edited by Heinen on 02-19-2009 06:20 AM
    The Enrichment Center is required to remind you that you will be baked, and then there will be cake.
    Solved!
    Go to Solution.

    Hello,
    I have a bit different problem.
    I have a tab control, with several buttons on different pages.
    In the current situation, we can talk about two pages, where one page ("Settings") in the Image, has a START and EXIT button, while second page ("Wait") has an EXIT button.
    In a while loop, I have event structure, which handles events of the START and EXIT buttons of the Settings page. This is fine. But I also want to control the Exit button of the Wait page.
    The control works like this:
    When I click on Start in the Settings page, the front panel shows Wait page and attempts to connect to a datasocket server on the remote computer. If the user wants to stop this process, he can click on Exit on Wait page too. But, this doesn't give any immediate effect. On the even of Start button, the front panel is not locked, so the user can actually click the Exit button on the next page when it's visible. But it's of no immediate effect. Means, what the LabVIEW does is, finishes the execution of event in Start button's click, and while this executes, it doesn't consider the Exit button's refreshed value (shown in Red circle in the block diagram).
    Simple question: Is there any way to check the updated (latest/live) value of a control during some event's execution? Or if I write an Event "Value Changed" for the Exit button and pass it to some variable. Is it the only solution?
    Thanks ahead.
    Vaibhav
    Attachments:
    terminate event_diagram.jpg ‏200 KB
    terminate event_front_1.jpg ‏63 KB
    terminate event_front_2.jpg ‏63 KB

  • How to stop while loop from looping

    Hi, need a little help in the respect to while loops. Basically i have a while loop within an while loop within another while. So what i want to do is run the program within the outer while loop. The problem is that when i start the program it runs once, which is ok, but its the runs again and again and again. I need it to only run once untill i press the inner while loop bolean to set it going and to stop and to restart, but i can not manage to keep the inner loop from initerating. I just wonder if its a problem with the field point? because i know it works, but using a different example. Any help greatly appreciated.
    Thanks Stuart
    Attachments:
    examplealib.llb ‏199 KB

    Use case structures around your middle and inner loops tied to the booleans you want to control the loops. Inside each loop, use a local variable of the boolean tied to the continue terminal of the loop.
    You need to use local variables because an input to a loop (wired from outside the loop) is read only on the first loop iteration. Any subsequent change to a control terminal outside of the loop is not seen by the loop.
    To create a local variable, on the diagram, right click on the terminal of interest, then select Create >> Local Variable. Then right click on the local variable and select Change to Read.
    P.S. You know your stop button is wired to an empty case and doesn't do anything.

  • Start stop while loop with tab control

    I want to be able to start and stop a while loop by entering and leaving a tab.  I am using an event structure to do so but it doesn't seem elegant or the right way to do this.  The only way I was able to get it to kind of work is by unchecking the lock front panel box in the event structure.  I have attached a sample vi of what I have so far.
    Solved!
    Go to Solution.
    Attachments:
    Loop test.vi ‏16 KB

    The problem is that you can't even stop the program by hitting the stop button until you leave the tab, which is not a friendly user interface.
    Event structures should just handle basic user events.  Any given event case should not take a long time to run.  While you are in the diagnostics tab, your code is stuck in that while loop.  Although fixing the lock front panel allows you to do other things, the LabVIEW is just queuing up all of those other UI events (like Stop button value change) and can't handle them until the inner while loop stops and allows the outer while loop to iterate again.
    You should have a parallel while loop to handle the waveform graph.  You can use notifiers or queues or an action engine FGV (see Ben's Action Engine Nugget) to pass the starting or stopping of the waveform graph update to the parallel while loop.

  • Stop While loop

    Hi
    I have a while loop with a cycle time of 100 sec, when I stop it I have to wait 100 sec untill the while loop stops.
    There is any manner to stop it immediatly?
    Thanks

    Why are you using a property node for a control that is not accessed within the loop?  And the conditional terminal is set to run if True. 
    Your while loop doesn't make sense.. Can you post the entire code (attach your vi) and explain what you are trying to do?
    R

  • Stopping while loop after last element of 2d array is passed through

    I posted something similar to this before, but what I got didn't work.  So this time I'll try to be more clear with what I am trying to do.  What I have done is combine two 1d arrays into a 2d array, and am using it to run an experiment.  I split the 2d array into a 1d array by column, and am trying to get the while loop that the array is in to stop after  the last element of the array is indexed.  I need to use a while loop because the array is constantly updating because the number of elements can be changed while the program is running.  What I am having trouble with is getting the while loop to stop after the last element has run, because the last element is subject to change.  Any ideas?
    Thanks 

    I am trying to run a measurement using labview to control different instruments.  The program is suppossed tp work in that it runs a measurement for each current setpoint inputed, for 1 magnetic field setpoint.  So for example, if the magnetic field setpoint is 8000 gauss, and the two current setpoints are .00001 amp, and .0001 amp, it will run the meauserement twice for the 2 current setpoints for each magnetic field setpoint.  What I am trying to do is that sometimes, I might have to edit the magnetic field setpoints while the program is running.  I am having trouble with refreshing the magnetic field setpoints, which allows the user to input a new magnetic field setpoint while it is running.

  • How to stop while loop when a specified function is terminated?

    I want to make a program which has 2 thread, one of which is to control some devices, and the other is to measure outputs of the devices.
    To do that, I should make a 2 independent loops, but there comes a problem here.
    I want to terminate 2 loops at the same time, but it's difficult for me to do that, because when I try to notify upper sequence's termination to lower loop by some value change, they have some dependency.
    That's why I need your help. I want to know how to stop lower loop when the upper sequence's termination keeping their independency.
    Please let me know. Thank you.
    Attachments:
    help.JPG ‏200 KB

    Is the upper loop commanding the lower loop at all?  I would think you would have some type of communication between the loops.  Just use that communication to send a stop command.  Or the next best way is to just simply use a notifier.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to stop a period counter in a while loop without using abort execution%3F

    I am using a NI x series 6343 andcounting pulses, but when i try to stop the counter with a boolean operator nothing happens, ihave to go and use abort execution, 
    Help

     the stop sign does not do anything, it just stops after the timeout.
    Which is exactly what you're asking it to do.
    The STOP button is not a magic ABORT function.  It's a simple TRUE/FALSE variable.
    The way you have it set up is:
    repeat
       Get some data (Timeout = 10 sec)
       Process the data
    until STOPped
    It's going to check that STOP value (is it pressed or not) ONCE, sometime during the loop.  Maybe before your GET DATA, maybe during, maybe after - you don't know.
     Whenever the GET DATA thing returns (after 10 sec, or after getting some data), then it willl use that value and decide to loop again, or to stop.
    If you want to abort the GET DATA operation, you have to find another way.
    One way is to use a shorter timeout.  Do you have to track it down to 1 pulse every 10 sec?  If not shorten your timeout and go from there.
    Another way is to find a way to abort the operation.
    Again, I'm not familiar with the EXPRESS stuff you're using, so I don't know the details.  In all my 26 years of LabVIEW programming, I've never once used EXPRESS stuff.
    Using the regular NIDAQ stuff, you would
    INIT a task
    START a task (Task ID)
    repeat
       READ a task (TaskID, timeout = 0.1 sec, or something)
       if TIMED OUT
           do nothing
       else if ERROR
           announce error
       else
           Process data
       end if
    until STOPPed or ERROR
    CLEAR task(Task ID)
    It's more complicated, but you have more control. 

  • Cannot stop while loop

    Hello,
    I want to count how many times the Boolean state has changed. But somehow the stop button cannot abort the statement.
    Solved!
    Go to Solution.
    Attachments:
    counter test.vi ‏8 KB

    Your code is way too constipated. Here's one simple solution.
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    counter test_MODCA.vi ‏9 KB
    CountTransitions.png ‏4 KB

  • How can I reset the value of an indicator in a while loop, from another synchronous while loop?

    I am running 2 synchronous while loops, one which is keep track of time, and the other is measuring periods. In the while loop that is measuring periods, I have a boolean indicator displaying whether the signal is on or off. My problem is that when the signal is off, the VI I use to measure the periods is waiting for the next signal, and displays the boolean value from the previous period measurement. While this VI is waiting, I want the indicator to display false and not the value from the last iteration of the loop.
    I am using LV 5.1 for MAC.

    Two things you can try:
    In preface to the first, the most common (perhaps ONLY) use of local variables should be in transferring data between parallel loops. This is a matter of discipline, and creates programs that are easier to understand, take less time and memory, and are just plain cleaner. Having said that, to transfer data between loops, use a local variable.
    Second solution: Instead of setting the value to false, just hide the indicator in question by using control references (property nodes for prev. version of LabVIEW). Control references are a great way to control items on a dialog or HMI screen.

  • How to create a time control for while loop?

    Hello all,
    I would like to control my while loop's execution time. In other words I want to stop while loop's execution after time (in ms) which is set by user. For example user sets 5 seconds to front panel control and a while loop runs and stops after 5 seconds.
    I am not sure is it possible with the while loop. I succeed with the timed loop but it suits badly to my application. Is there any other loops for timed control if it is not possible with while loop? There is also a simple while loop with Random Number (0-1).vi as attachment.
    Best Regards,
    Jick
    Solved!
    Go to Solution.
    Attachments:
    execution time loop.vi ‏6 KB

    hi,
    see this, may be it will help.
    Best luck
    Gaurav k
    Gaurav k
    CLD Certified !!!!!
    Do not forget to Mark solution and to give Kudo if problem is solved.
    Attachments:
    execution time loop.vi ‏9 KB

  • Multiple while loops

    I have two while loops in my application which run seperately. The program looks as follows
    :   while loop 1           :       :  while loop2        :
    I want to stop while loop 2 as soon as while loop 1 stops. I tried to connect the stop condition of while loop1 to the stop of while loop2, but the loop stops immediately after one iteration. How to go about it.
    Regards,
    Giridhar Rajan
    Automation Engineer
    Cruiser Controls
    Mumbai, India

    The big concept in LV is dataflow - a piece of code will execute when all its inputs are available. When you connected the two loops you caused a data dependency - the data in the wire coming out of loop one will only be available when the loop ends. So what happens is that you run loop 1 and when you stop it, the T value goes over to the second loop, which only starts running now. Since it gets T, it stops after one iteration. You can see this if you turn on Highlight Execution (the light bulb button). There are several ways to go around this - the simplest is a local variable - right click the stop button and select Create>>Local Variable. You can change this to be read and put it in the second loop. You will need to change the mechanical action of the button and make sure you set it back to false. A more advanced method is the event structure.
    These are the basics in LV. To learn more, I suggest you read the LabVIEW user manual. Also, try searching this site and google for LabVIEW tutorials. Here and here are a couple you can start with. You can also contact your local NI office and join one of their courses.
    In addition, I suggest you read the LabVIEW style guide.
    Try to take over the world!

  • How to stop a while loop with long delay

    Hi everyone,
    I am building a simple program for turning on and off a single Bit.  The task is to turn ON the Bit for a period length T1, and OFF the Bit for a period length T2. T1 is normally different from T2, and can be controlled  by users. 
    Since T1 and T2 can be variable, they sometimes can be very long.
    If I use a Wait function inside a While loop, it needs long delay to be able to Stop the Main program.
    The same situation happens when I use Timed loop.
    Can anyone suggest me how to do this task?
    Thanks a lot. 
    Message Edited by tatuan on 04-12-2010 12:56 AM

    Here's another possibility using OpenG Wait ms:
    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!

Maybe you are looking for

  • View the Text in JTextPane when we r inserting another text

    Hi, I have created GUI in swing where i have taken JTextPane.I am seaching some keyword which r given by the client if i found so i am creating the pdf file for that data and in JTextPane i am showing the pdf file name .....if i am getting that keywo

  • Links problem in PDF (opened in web browser)

    Hi, I have a problem with the way Adobe reader works when it is embedded in Internet Explorer 7. The PDF is well opened but inside this PDF i have links to others PDF, this links doesn't work inside IE but when the PDF is opened inside Reader it work

  • FREE: OHJ Glossary tab

    If anyone wants to try it/use it, I've got a working Glossary tab for OHJ. You'll need OHJ 4.2.1 to use it. It's designed to read and display simple text glossary entries from an XML file (coincidentally, this is the same glossary XML output format g

  • Coding mask - SAP adding 0 and spaces

    Hi Experts, We are using coding mask in our configuration. It was initially set up as C.XX.XXX.X.0000.X.XXX.X We changed it to C.XX.XXX.X.XXXX.X.XXX.X and we found that all our project definition codes which were C.XX.XXX were updated to C.XX.XXX.   

  • Where on the box is the serial number?  How many digits?

    Trying to install Photoshop Elements 12 and need serial number.  Three numbers on back of box, none identified as serial number.  None are valid.  Where is the required number?  The help info is useless.