Stopping labview loop when terminating teststand

Hi,
If I have a labview step which is called from teststand, which is in a loop, what property can I query (or does one exist), where I can conditionally exit my labview loop when the "terminate" button is pushed in teststand?  I see there are "termination monitor" tools in the teststand palatte in labview, but the "terminating" boolean does not go true when I initiate the terminate in teststand.  I have a simple test vi set up to test it, does not seem to function this way. 
Thanks
David J.
Solved!
Go to Solution.

David
see attached example with TS 2010 and LV 2011. It shows how to use Termination Monitor and how to use LV modules to close asynchronuously running VIs.
Norbert 
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Attachments:
TerminationMonitor.zip ‏21 KB

Similar Messages

  • 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 terminate or exit a for loop when the user clicks on stop button

    Actually my problem is to stop a loop when i click on stop button.
    example:i have two buttons 'start' and 'stop'
    in start buttom i wrote a for loop as
    dim i as integer
    For i=1 To 100000
    print i
    Next
    when i click on start buuton it prints 'i' value up tp 100000.
    my question is when i click on 'Stop' button the for loop has to terminate or Exit from the  loop and should stops the execution.
    Is it possible to termianate or Exit the 'for loop'
    PS.Shakeer Hussain
    Hyderabad

    I am unable to stop the loop and application not at all allowing to Press the Stop button.
    It seems like Hung, any advise ?
    Private Sub btnStart_Click(sender As Object, e As EventArgs) Handles btnStart.Click
            btnStop.Enabled = True
            btnSelectFile.Enabled = False
            btnStart.Enabled = False
            btnStop.Focus()
            Dim strFileName As String = txtFileName.Text.ToString
            Dim strLineText As String
            If System.IO.File.Exists(strFileName) = True Then
                Dim objReader As New System.IO.StreamReader(strFileName)
                While objReader.Peek() <> -1 And stopclick = False
                    strLineText = objReader.ReadLine()
                    MsgBox(strLineText, MsgBoxStyle.Information)
                    Application.DoEvents()
                    Thread.Sleep(My.Settings("strDelay") * 1000)
                    'System.Diagnostics.Process.Start(My.Settings("strFireFoxLocation"), strLineText)
                End While
            End If
        End Sub
        Private Sub btnStop_Click(sender As Object, e As EventArgs) Handles btnStop.Click
            stopclick = True
            btnSelectFile.Enabled = True
            btnStart.Enabled = True
            btnStop.Enabled = False
        End Sub
    Raman Katwal
    Please remember to mark the replies as answers if they help and unmark them if they provide no help

  • Stopping loop when output = 0

    Hi, I was wondering if anyone knew how to stop a loop when the final output is 0.  I'm doing battery life testing with a agilent multimeter and want to loop the reading of the voltage until the output = 0 so that the timer can stop at that point.  How would I get this done?

    to test current, you have to put the probes in one wire, not across two. 
    for instance  ---------|<left probe>|     |<right probe>|-----------
    instead of
    ---------------|<left probe>|-----------------
    ---------------|<right probe>|---------------
    basically, current measurement has to be in series, not in parallel.
    edit - the reason your phone shut off is because ammeters have very low input resistance to avoid burning any of the current being measured.  so, when you put it across your terminals, you were simply discharging your battery through the meter instead of through the phone.
    Message Edited by JeffOverton on 02-01-2008 11:29 AM
    =============
    XP SP2, LV 8.2
    CLAD

  • MASTER/SLAVE PATTERN: how to stop slave loop without stop main loop

    Hi All, I am studying the master/slave loop and saw an examples are like this (only master block shows)
    From this case, as I understand, if we click "set" button, slave loop will run. If we click this button again to mak it "Flase", the slave loop will be stopped as well as the main loop will be stopped as well.
    Now if I have a multi-function main loop, I just want to start or stop slave loop when click "set" button, how can I do it? Thank you very much! 

    bhl3302 wrote:
    From this case, as I understand, if we click "set" button, slave loop will run. If we click this button again to mak it "Flase", the slave loop will be stopped as well as the main loop will be stopped as well.
    Your understanding is completely wrong.  There is nothing in the image you show that would stop either loop.  In this situation the "set" button would normally have a latching mechanical action, meaning that when it is pushed, it will stay true until it is read once, at which point it will return to false.  Placing the control terminal inside the event case causes the terminal to be read and resets the button to false.  With a latching mechanical action, there will be only one event generated even though the boolean will change value twice (from false to true, and from true to false).  You'll never have a situation where you push the button once to set it true, and again to set it false.  However, even if the mechanical action is switching, not latching, it still won't make a difference here - the event case does the same thing whenever the value changes, regardless of whether it's true or false.

  • How do you start a loop with an event and end the loop when u release ....

    How do you start a loop with lets say an event of some sort, whether it be holding down a key or pressing the mouse click and then stopping the loop when you release that key or mouse button.?
    double c = 1.8, i = 1, max = 90, exp = 0;
    final double inc = 0.002; //speed at while it increases
    boolean f = false, g = false;
    while (true)
        while (f == false && stopMeter == false) //increasing speed going up to 90
            exp = Math.pow (c, i);
            i += inc;
            pAngle.setText (Math.round (exp) + "");
            if (exp > max)
                f = true;
                g = false;
            } //end if
        } //end while
        while (g == false && stopMeter == false)  //decreasing speed going down from 90
            exp = Math.pow (c, i);
            i -= inc;
            pAngle.setText (Math.round (exp) + "");
            if (exp < 1)
                g = true;
                f = false;
            } //end if
        } //end while
    } //end whilethis is a snippet of my increasing increments. Its for an angle meter. I can't get it to stop, when the user clicks or does something... the program just gets stuck in an infinite loop. I am still new to java and i do not know how to fix this.

    You are in the wrong forum. Try this one instead: http://forum.java.sun.com/forum.jspa?forumID=31
    /M

  • I have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    i have a for loop inside of while loop.when i press stop for while loop, i also would like to stop for loop.how can i solve this problem?thanks

    Hi fais,
    Following through with what JB suggested. The steps involved in replacing the inner for loop with a while loop are outlined below.
    You can replace the inner for loop with a while by doing the following.
    1) Right-click of the for loop and select "Repalce" then navigate to the "while loop".
    2) Make sure the tunnels you where indexing on with the for loop are still indexing.
    3) Drop an "array size" node on your diagram. Wire the array that determines the number of iterations your for loop executes into this "array size".
    4) Wire the output of the array size into the new while loop.
    5) Set the condition terminal to "stop if true".
    6)Drop an "OR" gate inside the while loop and wire its output to the while loops condition terminal.
    7) C
    reate a local of the boolean "stop" button, and wire it into one of the inputs of your OR gate. This will allow you to stop the inner loop.
    8) Drop a "less than" node inside the inner while loop.
    9) Wire your iteration count into the bottom input of the "less than".
    10) Wire the count (see step 4 above) into the top input of the less than. This will stop the inner loop when ever the inner loop has processed the last element of your array.
    Provided I have not mixed up my tops and bottoms this should accomplish the replacement.
    I will let others explain how to takle this task using the "case solution".
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • LabVIEW 6.1 If For Loop count terminal is zero then value going through the loop is not passed on to the output of the loop

    Hello, one of our customers just encountered an execution error in a vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or 6.01. I have a simple vi that has two encapsulated For Loops. Two string arrays go in, one goes out of the outer loop. Inside the outer loop the first array is indexed. The string which results from this indexing is compared with all other strings from the second string array in the inner loop. If it matches one of the strings of the second array, it is not outputted, otherwise this string goes through the inner For Loop to the output of the inner loop and from there to the output of the outer loop. The count
    terminal of the outer/inner loop is connected to the Array Size of the first/second string array. If the second array is empty, that means that the element in test from the first arry cannot match anything from the second array, so the element in test is send to the output of the inner loop and from there to the output of the outer loop. This works fine in LabVIEW 5.1 and 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never executed if the count value is zero (which is correct), but the data line running through the loop is not executed either, which is different to what LabVIEW 5.1 and 6.01 do. There, the input string is sent to the output of the inner loop correctly even if the loop counter is zero. The solution is easy - I just have to connect the output of the outer loop to the data line BEFORE it enters the inner loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is supposed to be a feature, but it brings some incompatibility in programming between the
    different LabVIEW versions.
    Best regards,
    Gabsi

    Hi,
    When a for-loop runs zero times, all outputs are 'undefined' (and should
    be).
    Besides, how would LV know what the output of a not executed routine should
    be?
    It might be handled differently in LV5 and LV6, which is unfortunate. In
    both cases, the result is undefined.
    It's not a bug. It's just something that should be avoided in any LV
    version.
    > The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    In some cases this does the trick. But if the data is changed in the inner
    loop, this will effect the results if the N is not zero.
    Technically, I think the output in this construction is also 'undefined'.
    But LV handles this as expected / desired.
    Another solution is to use a shift register. If N is zero, the input is
    directly passed through to the output.
    Regards,
    Wiebe.
    "Gabs" wrote in message
    news:[email protected]...
    > LabVIEW 6.1 If For Loop count terminal is zero then value going
    > through the loop is not passed on to the output of the loop
    >
    > Hello, one of our customers just encountered an execution error in a
    > vi running under LabVIEW 6.1, which doesn't exist under LabVIEW 5.1 or
    > 6.01. I have a simple vi that has two encapsulated For Loops. Two
    > string arrays go in, one goes out of the outer loop. Inside the outer
    > loop the first array is indexed. The string which results from this
    > indexing is compared with all other strings from the second string
    > array in the inner loop. If it matches one of the strings of the
    > second array, it is not outputted, otherwise this string goes through
    > the inner For Loop to the output of the inner loop and from there to
    > the output of the outer loop. The count terminal of the outer/inner
    > loop is connected to the Array Size of the first/second string array.
    > If the second array is empty, that means that the element in test from
    > the first arry cannot match anything from the second array, so the
    > element in test is send to the output of the inner loop and from there
    > to the output of the outer loop. This works fine in LabVIEW 5.1 and
    > 6.01, but NOT in LabVIEW 6.1. In LabVIEW 6.1 the inner loop is never
    > executed if the count value is zero (which is correct), but the data
    > line running through the loop is not executed either, which is
    > different to what LabVIEW 5.1 and 6.01 do. There, the input string is
    > sent to the output of the inner loop correctly even if the loop
    > counter is zero. The solution is easy - I just have to connect the
    > output of the outer loop to the data line BEFORE it enters the inner
    > loop. But: I don't know if this is a LabVIEW 6.1 bug or if it is
    > supposed to be a feature, but it brings some incompatibility in
    > programming between the different LabVIEW versions.
    > Best regards,
    > Gabsi

  • I am trying to have some LabVIEW code called in a New thread exit when the testStand sequence terminates

    I have a Sequence that launches a sequence in a New Thread that happens to launch some LabVIEW code.  The problem is when the LabVIEW code finishes, it will not close even when the TestStand sequence terminates. Is there a way to tell this LabVIEW code to Exit, I've tried the Quit LabVIEW function, but that causes a C++ RunTime Error.  The LabVIEW code does end though, and it is set in the VI properties to:
    Checked - Show Front Panel When Called
    Checked - Close Afterwardds if originally closed
    The sequence call that the LabVIEW code is launched from has the following options:
    - New Thread
    Unchecked - Automatically wait for the thread to complete at the end of the current sequence
    Unchecked - Initially Suspended
    Unchecked - Use single threaded apartment
    Any clues on this would be appreciated.

    Hi ADL,
    Everything should close correctly if you check the checkbox "Automatically wait for the thread to complete at the end of the current sequence" in the thread settings.
    With it unchecked, I am seeing the behavior you are. 
    Gavin Fox
    Systems Software
    National Instruments

  • Getting "setup.exe has stopped working" message when trying to install labview 2011 or 2012 on a windows 7 machine

    I am getting a "setup.exe has stopped working" message when trying to install labview 2011 or 2012 on a windows 7 machine. I already tried running setup.exe as an administrator with the same results. I have Microsoft .NET Framework 4.5.1 installed on the affected machine. Could this be the cause of this issue? Or does someone know the root cause of such error?
    Solved!
    Go to Solution.

    Hi - are you getting it at the start of installation, during or after 100% progress has finished?
    Is it just LabVIEW you're installing, or is it drivers too, in which case, what was the last large package that was installing at the time?
    This could be caused by the NVIDIA chipset driver :
    https://decibel.ni.com/content/message/46299?tstar​t=-130
    Thanks
    Sacha
    // it takes almost no time to rate an answer

  • How to stop a while loop when using tab control

    How do you use a tab contol to stop what is happening on one tab when you switch to another tab?  In the test example I attached, I have a while loop nested inside a case structure controlled by the tab control.  When I tab to page two the elapsed timer starts but when I switch to another tab it does not stop.  I can't come up with an easy way to stop or exit the while loop when I change tabs. 
    Thank you
    Danny
    Attachments:
    tab control.vi ‏24 KB

    I played with it a little more and came up with this fix.  This fixes it but is not tied to the changing tabs as I was looking for.  Is this just too many nested loops and a bad idea?
    Danny
    Attachments:
    tab control fix maybe.vi ‏26 KB

  • When using Teststand, how do I prevent the LABView splash screen from appearing?

    It comes up even if I have the "Don't show this screen" checked !

    I'm excited to see TestStand is a celbrity product.
    Typically when you run a sequence in TestStand, LabVIEW is launched by TestStand when the sequence contains steps that use the LV adapter. In this case LV is launched through its ActiveX interface and the LV splash screen is suppressed. This is in contrast to launching LabVIEW manually in which case the LV splash screen will be displayed.
    In your case I'm not sure how LV is being launched. You might want to shut down LV and then run your sequence to see if the splash screen is then suppressed.
    You may also want to read NI Knowledgebase article 28MEPUXL, "Why Does the LabVIEW Startup Screen Appear When Using the Dialog Box Function from Within My VI?". In this case LV has been opened manually and not be Test
    Stand, such that the splash screen is not suppressed.

  • Error "An exception occurred within the external code..." when stopping LabView

    I am having an error "An exception occurred within the external code called by a Call Library Node...", see the attached image, when I am trying to stop LabView. As a result of the error, the tag engine doesn't close normally.
    I am using LabView 7.1 with DSC. I read values from a LNS (LON) OPC-server.
    Is this a known issue and is there any way to repair it? I haven't noticed any direct consequences because of the error except that when I re-start LabView and the close it again without having first rebooted the computer, tag engine sometimes starts again when it should stop. This is fixed by always rebooting the computer before restarting LabView. I am getting suspicious that there might be some strange behaviour because the error says "it might have corrupted LabView's memory".
    For example, sometimes when I have made a copy of an input number field to another, they follow each other's value changes even though there is no connections between them.
    Simo Martikainen
    Message Edited by Simo Martikainen on 12-17-2008 03:11 AM
    Attachments:
    LabView stop error.JPG ‏45 KB
    TAGENGINE.JPG ‏16 KB

    Especially in earlier versions of LV these sorts of errors were common if the call wasn't made just right or the parameters were set up incorrectly.
    Where did you get the DLL from? Was it written internally or did it come from another vendor?
    Try building a DLL call into a very small, simple application. Do you see the same issue?
    Are there multiple calls to the same DLL in your code? If so, is there problems with all of them?
    Can you track it down to a specific function that you are trying to access that is causing the problem?
    Is there any indication of a memory leak?
    Finally any additional information you can provide would helpful.
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • 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

  • Stopping multiple loops

    If I have two while loops and I want the same button to stop them
    both, how do I do it? I know I can't put the button in one loop and a
    local variable to it in the other, I also can't put the button outside
    both loops. I'm using LabVIEW 7.
    Thanks,
    Jason

    Jason wrote:
    > If I have two while loops and I want the same button to stop them
    > both, how do I do it? I know I can't put the button in one loop and a
    > local variable to it in the other.
    You say you can't? Why not? Please explain.
    When you click on the button, the other loop will read the
    change and then stop the loop. I don't understand your
    hesitation.
    Thank You
    Michael Aivaliotis
    http://mmwis.com
    http://forums.lavausergroup.org
    http://niweekblog.com
    Michael Aivaliotis
    VI Shots LLC

Maybe you are looking for

  • Do I need a new license for Crystal Reports Release 2?

    Post Author: jerryk CA Forum: Upgrading and Licensing Hi, We have a license for Crystal Report XI.  However we need Crystal Reports Release 2 since we are using .Net 2.0.  I just tried installing the Crystal Reports Server on out test web server and

  • Best tool for removal of duplicate photos

    What is the best tool for removing duplicates from iPhoto?

  • Why Doesn't Photoshop's Opacity Add Up?

    I've always wondered this but now it's beginning to bug me as I'm experimenting with layer stacking to reduce/modify noise. If I have 2 layers at 50% opacity and a white layer underneath, those combined layers should equal 100% opacity and so I shoul

  • Function module for quotation configuration update

    Hi, I am trying to update the configuration data for an item in quotation. This is a new item i am trying to insert in a quotation using BAPI 'BAPI_CUSTOMERQUOTATION_CHANGE' but not able to update/change the configuration data. I am able to upload th

  • How to get mac address?

    I have used NetworkInterface.getNetworkInterfaces() for get list of interfaces but under xp I not read interface informations. Is possible that the problem is permission level of user? Thanks.