Terminate Pass/Fail Sequence Step

Hi everyone, I have a step in my main sequence that runs an interactive dialog box to the operator.  It checks whether or not it receives communication from the slave device.  If for some reason the operator wants to "TERMINATE (ABORT" the dialog box I have an "ABORT" button on the front panel to allow them to do so.
I want this sequence step to behave as follows:
1. If COMMUNCATION = RECEIVED and ABORT BUTTON = NOT PUSHED, then the step status should = Passed
2. If COMMUNCATION = NOT RECEIVED and ABORT BUTTON = NOT PUSHED, then the step status should = Failed
3. If ABORT BUTTON = PUSHED while in the midde of running the step, then the step status should = Terminated
Right now I have the step set up as a Pass/Fail step which uses a boolean output from the VI.  My issues is I am having trouble with Item 3 above.  I am right now putting in the Post Expression for the step the following to handle Item 3:
Locals.VIAborted == True ? RunState.Engine.TerminateAll() && Step.Result.Status == "Terminated": ""
Sometimes, I do not see Terminated when the Abort Button = Pushed.
Am I handling this correctly or is there a better way to do this?
Thanks so much!
Solved!
Go to Solution.

Did you think about  race conditions ?  My first idea,when seeing the statement was: Could it be, that the Sequence is terminated  before setting Step.Result Status ? 

Similar Messages

  • Sequence call with Pass/Fail Test always returns Passed result

    In TestStand 2.0, I use Sequence Adapter with Pass/Fail Test step to call a subsequence, I always receive a Passed result, even as I force fail a step in the subsequence and enabled the Step Failure Causes Sequence Failure option.
    Attachments:
    Example1.seq ‏17 KB

    Tan -
    The status expression for the Pass/Fail step type does not look to see if the status has been previously set by the code module in this case the sequence call.
    Step.DataSource != "Step.Result.PassFail" ?
    Step.Result.PassFail = Evaluate(Step.DataSource) :
    False, Step.Result.PassFail ? "Passed" : "Failed"
    It just set it to Passed or Failed even if the status is already "Failed".
    You could either,
    1) Change the Pass/Fail expression to the following for the step,
    Step.Result.Status == "Done"? Step.Result.PassFail : False
    or
    2) Use two steps, a Sequence Call and a Pass/Fail that uses the None Adapter. The Pass/Fail could operate on the previous step if necessary.
    Scott Richardson - NI"
    Scott Richardson
    National Instruments

  • How do i configure a FOR loop to have the behavior of the step Loop Type: Pass/Fail count?

    Hello,
    I'm using the Pass/Fail count set to one Pass to capture an event generated by my DUT.  I originally used a numerical compare step with the Looping type of Pass/Fail count to accomplish this.  Unfortunately the implementation changed and now I need to execute a few steps that can not be combined within one code module as before. Nor can these steps be put into a subroutine.  One of the steps executes a .NET asembly and I haven't figured out how to pass the reference to the subroutine.  When the subroutine is intered the reference is lost and the methode does not execute correctly.
    I have an evaluation function the exits the loop when the expected conditions are met. Everything works except for the Overall Pass/Fail result of the For loop.  If the loop exits due to the first numerical compare test passing, I want the loop overall execution to report as "Passed".  If the loop reaches it's predetermined number of iterations, the overall result needs to report as "Failed".  It would also be nice to have the radio button functionality of "Record Result of Each iteration".  Some conditions require a wait over a minute for the event to occur and I don't want to generate needless data for the report.
    Currently I get the pass/fail status for each For loop iteration, but only "Done" for each loop iteration.  I don't want the initial few failures to cause the test to fail.
    Does anyone know how to do this? Suggestions?
    Thanks,

    I have 2 steps in the loop that can not be combined into one step. This forces me to implement the behavior in some form of loop.  A While Loop could be an option.  I would need to pass the Step.Result.Status from the Multiple Numerical compaire step to the condition of the While Loop.  I tried to use the Step.TS.ID without success.  Some form of reference to the numerical compare step would be needed. I'm using a For Loop as I do want to limit the number of iterations of the loop.  In the case where the loop iterations are reached, the event I am trying to detect did not occur at the correct time and a failure needs to be reported.
    I came up with something based on my comments in the second post:
    1) To start with I configured a Locals.ForLoop_5 variable.  This is used to set the limit on the loop iterations and for comparison after the loop has finished executing. More on that later.
    2) The first step inside the loop invokes a method within a .NET assembly that has been packed in a DLL This method gets the required data from the DUT and stores it to a text file.
    3) The next step is the Multiple Numeric Limit step.  This step invokes a VI that extracts the data from the text file.  This step has been customized in several ways.
      i)  In Run Options, the Results Recording Option was disabled.  This prevents recording of "Failed" while the loop executes when waiting for the event to happen.
      ii) In Run Options, the Step Failure Causes Sequence Failure is unchecked.  Same reasoning as i)  These steps are not true failures.
      iii) A Post Action is configured to go to the nexxt step after the For Loop End step On Condition True with the logic of Step.Result.Status == "Passed".  This causes the loop to exit when the first "Passed" is encountered which corrolates with the event I'm trying to detect. On Conditon Fail remains set to default.
    4)  The step after the For Loop End is an expression step with everythin set to default except for the Status Expression logic set to: Locals.Loopindex < Locals.ForLoop_5 ? (Step.Result.Status = "Passed") : (Step.Result.Status = "Failed"). This step performs the overall Pass/Fail reporting for the For Loop.  If the number of loop iterations is less than the maximum it could have only gotten there by the previous logic triggered by the numerical compare passing, therefore "Passed".  If the loop index has reached the limit, then the event was not detected, therefore Failed.
    I have tested this work around with success, it just a pain to now have to implement this on my 40 some odd For Loops.
    If there is a better way, I'd still like to hear it.

  • Can the sequence pass/fail status be controlled in Test Stand?

    I have a sequence that contains a DoWhile loop. Within the loop are 5 or 6 steps that are executed. If the result of those steps is a fail the loop runs again until it passes or meets its allowable number of iterations. My problem is that if an iteration fails and then passes the result for the sequence is failed. Can the pass/fail status be controlled via an expression etc? I know I can create a subsequence and loop in it with the properties. I am just curious to know if there is a way it can be done like I have explained.
    Thanks in advance for any help,
    Troy

    Troy,
    You might be able to use the RunState.ThisContext.SequenceFailed property.  Set this equal to False after your loop runs, and the sequence should report as if it passed.
    John B.
    Applications Engineer
    National Instruments

  • In LV, using TS API, how do I specify the VI module for a Pass/Fail step?

    I am writing a LabView VI which will let a user write a TestStand sequence. Each step in the seq is the same type, a Pass/Fail test. I need to specify for each step the LabView VI module location, and an input buffer. I am having difficulty finding out how to specify the module for the step using the TestStand API in LabView. How to do this????

    Hi Drew,
    I think Dennis might have come at this from the wrong angle.
    Have a look at the example that ships with TestStand under
    \Examples\SequenceBuilderTool\LabVIEW
    This might give some clues, but I'd suggest posting this question over to the TestStand discussion Forum as suggested by Dennis.
    There'll be a few more people there who can help a bit more in-depth
    My personal suggestion is to create a custom step type that calls the .vi's and then you can create the steps in a new sequence file using your tool easily. This could be cumbersome for you if you already have a lot of steps setup.
    Better then to create a resource to get the steps out of to clone them by creating a sequence file which is full of your steps. When you have a handl
    e to a cloned step, you can change properties about it in memory, before putting it into the sequence (i.e. change it's name and stuff)
    Otherwise you need to get the type and create a new step of this type.
    If all you're stugling with is the module to call, then for the step you have a handle to, change the
    you can either change the "Step.TS.SData.ViPath" as a string (TestStand set property value String with a reference to the sequence_context) or if you wanted to bring up the specify module dialog, if you have a handle to the step itself, call the method SpecifyModule.
    Hope that helps
    Sacha.
    // it takes almost no time to rate an answer

  • Pass/fail status (UUT Result) of my main sequence

    I would like to have my last step in my test sequence to be a DLL passing to my SQL database a part number, a serial number from “RunState.Caller.Locals.UUT.SerialNumber” and Pass/Fail status of my Test Sequence.
    Can I pass pass/fail status of my test sequence to my DLL before execution is completed?
    Thank you,
    Henry
    Solved!
    Go to Solution.

    Access Pass/Fail status by using RunState.SequenceFailed.  It will be True if the test failed.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • Passing failed step name to a VI

    How can I pass the name of the first failed test from Teststand to a LabVIEW VI?  I only want to pass the name of the specific test that failed, even if that test is in a sub-sequence (I do not want to pass the name of the failed sequence, just the failed test).

    Apparently it can be done because somehow they do it in the failure chain on the report.  So it'd be doable but probably won't be trivial.
    What exactly is the purpose for this?  There may be a better way to accomplish what you want.  i.e. using the SequenceFilePostStepFailure engine callback might be the better way to go.
    A couple things to think about:
    At what point do you need to access it?  Because the default settings in TestStand allow the first step that fails to automagically jump to the Cleanup.  This will be tricky if you need to access it before that.  Or if you change the default setting dynamically to not do this then you will have to create an algorithm to traverse through the ResultList to find the first failed step.  That could get really messy because you won't know the depth of sequence calls. 
    Your best bet is to set a flag in the SequenceFilePostStepFailure on the first step that fails.  Then on every other step just ignore setting that variable.  I've attached a simple example in TS 4.1.1.  You will see the FileGlobals.FirstFailedStep as a string which gets set in the callback.  This can then be passed to the VI.
    I don't guarantee my algorithm for the FirstFailFlag.  I didn't prove it out.
    Hopefully this helps!
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~
    Attachments:
    FirstStepFailureFlag.seq ‏8 KB

  • Sequence pass/fail variable for csv report

    I need to write a small CSV file with my sequence test results. The way I am considering doing this is to
    save the information I need as the test progresses in local, file, or station global variables
    make a report string using the values stored in these variables, and
    write the string to a file via a LabVIEW VI.
    Is this a reasonable way to do it? In which variable does the overall UUT pass/fail result get stored?
    StephenB

    I recommend against doing it this way.  What you want to do defeats the entire purpose of using TestStand in the first place.
    If you are using a newer version of TestStand (2012 or newer) I would create a custom plugin to do exactly what you are doing.
    There is a ton of information out there on plugins.
    Here is an example on probably what you are trying to do:
    http://zone.ni.com/reference/en-XX/help/370052N-01/tsexamples/infotopics/modelplugin/
    Here are some more links that are important:
    http://zone.ni.com/reference/en-XX/help/370052K-01/tsfundamentals/infotopics/pmpcreatingplugins/
    http://zone.ni.com/reference/en-XX/help/370052M-01/tsfundamentals/infotopics/process_model_plugin_ar...
    The advantage of using a plugin is that now all tests can utilize it as opposed to the report generation being specific to a single test.
    Hope this helps,
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How to get sequence name and pass/fail status?

    HI,
    I need your assistance in order to achieve the following goal:
    I have about 10 sub-sequence steps in the main sequence.
    For those steps only, I'd like to print out in a window the name of the sequence and the resutl.
    I meet dificulties since i have the sub-seq result, only after it ends.  It means that i can print its status only in the following step.
    is there a way around it?
    I wish to be able to write all this information in the clean up of the sub-seq step.
    Thanks
    Rafi

    Hi Rafi,
    You will not be able to print the result of a subsequence call in the same step as the subsequence call, because both post-step substeps and post-expressions are run before the status is evaluated.  As you mentioned, you can do this in the following step, or you can use the SequenceFilePostStep callback to specify some customized behavior to follow your sequence call steps.  This callback will run after every step, so you would have to put some extra logic into this callback if you are using multiple step types.
    So, are you trying to print the result of each subsequence call separately?  How do you intend to display the status?  Let me know if you have any other questions about how to implement this.
    Regards,
    Marty H.
    National Instruments

  • Termination does not appear as fail sequence

    Hi,
    I have I a subsequence than include some Action type step.  The step set a local variable.  Based on that variable I decide whether to continue or to terminate.
    In the event of termination, the process is indeed terminated, but when I look at the report generated by TestStand, the subsequence have a Pass mark.
    Is this normal?  I would have expected to see Fail or Termination....  How do I fixe this problem to show a fail sequence?
    Thanks
    Rafi

    Hi, Ray
    Thanks for your tests. I have also tried with PostAction now. But the result is still the same.
    How have you done this ?
    By the way as Dug said in TS 4.0.1 it is fixed.
    What do you think about updating to the newest version ?
    I am concernd when i received a letter from NI about latest DAQmx problem
    (infocode rda4a4) and this affects TS 4.0.1 and CVI 8.5
    Greetings
    Juergen
    =s=i=g=n=a=t=u=r=e= Click on the Star and see what happens :-) =s=i=g=n=a=t=u=r=e=
    Attachments:
    test2.seq ‏7 KB

  • Dynamically specify TestStand pass/fail string

    I am performing tests utilizing multiple instruments. Each instrumemt may independently be in 'live' or 'simulated' mode. If any one instrument is in 'sim' mode, the test is considered in 'sim' mode. When in 'sim' mode the tests pass.
    My goal is to be able to look at the test report and determine if a specific test ran in 'sim' mode or live mode. My solution is to append the suffix '-sim' to the test status produced by TestStand. Thus the 'passed', 'failed' strings would become 'passed-sim', 'failed-sim' in 'sim' mode. These strings would have to be given to TestStand at the same time as the measurement value but before the test exited.
    Any thoughts or ideas on how I might accomplish the dynamic setting of the pass/fail string? I don't want this to be a permanent change, I want TestStand to revert back to the original pass/fail strings for the next sequential step.
    Hurst C.

    Hi Believer,
    What you seem to be trying to do is modify the results or a property of the results from the previous step. But unfortunately modify this property will only be affective if you were to re-run that step again eg step back one step. What you need to be modifying is the property that is in the Locals.ResultList. i.e Locals.ResultList[0].ReportText for the first step to be recorded in the sequence, Locals.ResultList[nth].ReportText for the nth step in the sequence to be recorded.
    By modifying 'RunState.Sequence.Main["Clock test (4.0V)"].Result.ReportText="FLAG"' you are actually modifying the runtime version of the step before its executed. Therefore, providing you do not over write the contents of ReportText within you step, this initial value will be seen in the result.
    You can check this by stepping into you step and checking the value of ReportText within the step.
    Hope this clarifies things
    Regards
    Ray Farmer
    Regards
    Ray Farmer

  • Trouble with the pass/fail test

    I started having this trouble just recently and I can't figure out the problem. Just all of a sudden (without me changing anything anywhere apparently), whenever I call a pass/fail test and if the test fails, the sequence execution immediately goes to the <End Group> step. I want the execution to proceed with the next step regardless of a pass or a fail. I have rechecked the run options repeatedly and there's nothing in there that might be causing this. Also, if a pass/fail step fails and I am running on single pass, even the report does not get generated.
    I know it can be really hard for someone out there to tell me what the problem is. I am posting this message here just to see if people have any general comments/suggestions on what might be going on (perhaps this is a common problem which someone has run into before). The comments/suggestions might help me debug the problem.
    Thanks
    Anuj

    Hi Anuj,
    Do you have other step type in the same sequence or just Pass/Fail type?
    What adapter type are you using, LabVIEW, CVI, etc...
    Does it happen in the just one sequence or any sequence?
    What versions are you using?
    Posting an example would help.
    Regard
    Ray Farmer
    Regards
    Ray Farmer

  • Show LabVIEW VI Front Panel When Sequence Step Called

    Hello,
    By clicking on the “Show VI Front Panel When Called” checkbox in the Step Settings pane displays the LabVIEW VI Front Panel for approximately 100 milliseconds. Is there a configuration way to display the VI front panel for a longer period of time, during that step execution, and allow the user to control the duration of the front panel exposure by clicking to resume execution of the sequence file at their will?
    Thank you.
    Solved!
    Go to Solution.

    Hi,
    You will need to have some sort of structure in your VI for handling front panel response, otherwise you front panel is only going to be visible for as long as it takes to execute an return back to teststand.
    But remember, once you hold your step within that VI which is waiting on the operator to eventual close it, your Sequence will be held as well and if you are expecting steps to continue running after your VI then you will have to consider running it in parallel to your main test sequence.
    You may also need to consider what happens if you want to terminate your Test Sequence, how do you close your VI.
    Check out 'Strategies for Terminating or Breaking Sequences' in the following.
    hope this is of help
    Regards
    Ray Farmer

  • Sending a return value without pass/fail message

    Hi,
    I'm using the COM adapter to talk TestComplete application.
    I have a string value test step to evaluate a return value and determine if it's pass or fail (e.g. return 0 = pass, return 1 = fail).  This works perfectly.
    However, I have added another return value (e.g. return 2), the code executed fine, but it keeps displaying that step as "Failed", which is annoying.  Is there a way to suppress this failed message?
    Basically, here's what I need to do, return 0= display pass, return 1 = display fail, return 2 = display no message or just display done.
    Thanks so much!
    Solved!
    Go to Solution.

    The String Value Test step type only evaluates to Passed or Failed.  It does not do a tristate.  In fact any of the step types in the Tests (Pass/Fail Test, Numeric Limit Test, Multiple Numeric Limit Test, String Value Test) will always be pass or fail.  They never evaluate to just done.
    The Status Expression is what makes a step Pass or Fail.  Unfortunately with the default steps you cannot change the Status Expression.  You have to create a custom step type to do that.
    What are you setting your Step.Result.String to?  Or did you change the Data Source?
    Here are 3 options:
    1- Create a custom step based on the String Value Limit test and change the Status Expression such that you get your desired behavior
    2- Use and Action step and change the Status Expression such that you get your desired behavior.
    3- Continue using the step you are using but in the Post-Expression place some logic which turns off the Step.StepFailCausesSequenceFail if you are in return 2 state
    http://zone.ni.com/devzone/cda/tut/p/id/4302
    Hope this helps
    jigg
    CTA, CLA
    teststandhelp.com
    ~Will work for kudos and/or BBQ~

  • How can assign a PASS/FAIL test to each element of a cluster?

    I would like to pass a cluster from Labview 8.6  to TestStand 4.1.1 and apply a pass/fail test to each boolean element of the cluster.  For elements of the cluster that are string values, I would like to apply a string value test.  For elements of the cluster that are numeric values, I would like to apply numeric value or limit tests.  How can I do this? 

    Hi epsilon-delta,
    The best way to do this would be to create a custom data type from that cluster and store the output of your vi to a local variable. You can then add Pass/Fail Test, Numeric Limit Test and String Value Test steps (using the None adapter) after the Action step to test each element of the cluster.
    Eric B.
    National Instruments

Maybe you are looking for