02-11-2011 03:53 PM
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).
02-12-2011 11:56 AM
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!
02-12-2011 04:52 PM
My customer uses a command line based database reporting program that is used to collect statistics about the UUTs on a manufacturing line. They want to know when a UUT passes and fails, and in the case of a failure, to know on which step the UUT failed (just the first step failure, not all of them).
I generate a more detailed Teststand XML report for them, but also have to use a command line interface to give the high level reports for their statistical QA system. I interface with the command prompt using a LabVIEW VI.
The test involves hundreds of steps in several sub-sequences. I modified your sequence to put some steps inside a sub-sequence. Unfortunately, if the first failure is in a sub-sequence, it only reports on the name of the sub-sequence and not the lower-level step. I think that this is a good start, however.
02-12-2011 05:51 PM
Interesting....It worked for me with a subsequence. I wonder what you could be doing differently. Here's what I did.
I even changed to sequence call step type to be Pass/Fail and set the data source to False.
HMMMM.....?
06-10-2013 05:53 PM
Hi,
I wish to do something similar to this post so I replied here instead of starting a new post.
I want to find out what the first failure is, as it would be shown in the report file. So I would need a precondition on the above SequenceFilePostStepFailure to only log the failed step if the failed step calling this has Result Recording Enabled.
So is it possible to check if the previous step has result recording enabled while in the SequenceFilePostStepFailure?
Thanks,
Dave
06-10-2013 06:55 PM
It won't show up in the dynamic API but you can use Parameters.Step.RecordResult. If that is True then the step is set to record results.
Hope this helps,
06-12-2013 09:30 PM
Excellent, thanks for your help, that has worked perfectly
06-13-2013 08:26 AM
03-03-2015 04:43 PM
My problem is very similar to what is mentioned here. I have found name of the failed step but my sequence has a for loop and it only works first time.
How do I change my sequence file(attached) to display failed step during every iteration of for loop.
03-04-2015 12:26 AM
Hi,
What you can do is to create a PostStepFailure callback either for SequenceFile (it will work just for steps grouped by this file) or for ProcessModel (it will be called for each step ran from it). Such callback is triggered every time a test step fails.
Best Regards,