NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How To Trigger Test Stand To Assign Step = Error

Solved!
Go to solution

Hi everyone, I have a LabVIEW VI step in my sequence and I have an abort button the user can select to abort the user interface VI.  I want the "abort button" boolean to pass back to test stand that abort button = TRUE and I want the sequence step to be set to an "ERROR."  Is there a command to send to the Test Stand Engine to flag this step as an error?

 

Thanks so much!

0 Kudos
Message 1 of 9
(5,683 Views)
Solution
Accepted by topic author testdesign

Hi

 

You can use the following APIs to set the result of your steps.

 

runstate.PreviousStep.Result.Status = "Error" - this will set the status for the previous step.

You can use a "None Adapter" step (comes with TestStand), to set the result of the previous step by using the above expression. You can set a pre condition for this step to execute only if Abort button = True.

 

 or

 

runstate.step.Result.Status = "Error" - this will set the status for the current step.

 

There are also other values that you can pass such as "Passed", "Failed" and "Skipped"

 

Hope this helps!

Deepak

Message 2 of 9
(5,674 Views)

Thanks Deepak.  That is some good information.  I was able to have my Abort Variable pulled in and in my post expression of that same step check if Abort = True and if it does set Runstate.Step.Result.Status = "Error."  Thanks for you help!

0 Kudos
Message 3 of 9
(5,652 Views)

Deepak or whomever else that may be able to answer this question:

 

I can now set my step to "Error" but how do I report to the operator or user that the reason for the Error was because the Abort button was pressed?

 

Thanks so much!

0 Kudos
Message 4 of 9
(5,644 Views)

Hi

 

You can use this expression which will be added to the report.

 

RunState.Step.Result.ReportText = "<Error Text>"

 

or

 

RunState.Step.Result.Error.Msg = "<Error Text>", but this usually contains the error information from the step. (if there is any other error already occurring, you will be over writing it.)

 

So, I would prefer the first.

 

Hope this helps!

 

Deepak

 

Message 5 of 9
(5,642 Views)

Thanks Deepak.  This is some real good information.  One other question I have is I am able to make the step Runstate.Step.Result.Status = "Error" but the sequence does not terminate.  I would like to set the step status equal to a value that would simulate hitting the Terminate Execution button in Test Stand so that the sequence terminates completely and does run any other steps.

 

Can this be done?

0 Kudos
Message 6 of 9
(5,640 Views)

Hi

 

Glad It was helpful.

 

There are two ways in which you could achive this..

 

1. Use this expression: RunState.Engine.TerminateAll()

 

But be wary, this will terminate all the current excutions and the report indicates the status as "terminated"

 

or

 

2. Use this expression: RunState.Execution.Terminate()

 

or

 

3. You can add a Goto step (comes with teststand. You can find it under Flow Control section of the insertion palette) and select Cleanup as the destination step.

 

This way you can run some clean up steps before closing the execution. (eg, Shutting down any hardware, etc.,)

 

 

Deepak

Message 7 of 9
(5,637 Views)

Last but not least, if I do use the GoTo step method you mentioned I still would like the UUT status = TERMINATED.  How do I set the UUT status = TERMINATED so that the report shows TERMINATED?

 

Thanks!

0 Kudos
Message 8 of 9
(5,630 Views)

Hi

 

Terminating the execution by using the expressions also executes all the steps from Clean Up group.

 

Where as Goto step can be used:

 

#1 if you want to execute any other steps other than clean up or only the steps you want to execute from clean up group as well (basically any step in the sequence file.)

#2 if you do not want the sequence files status to be terminated.

 

Hope this helps!

 

Deepak

0 Kudos
Message 9 of 9
(5,622 Views)