NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Build a "path" string of the caller names within Sequence File Post Step Failure

I need to log the failing step, which I have been doing by running the following code in SequenceFilePostStepFailure:

 

RunState.Root.Locals.UUT.additionalData.failure_parameter = Parameters.Step.Name

 

This was working for a while, but the problem is that we call the same sub-sequence several times within the code.

 

"Vss" is no longer good enough since there are 5 Vss measurements; I need to report something like:

 

MainSequence -> SequenceA -> SequenceB -> Vss

 

Or better yet:  SequenceA.SequenceB.Vss


I am not adept at accessing and figuring out the call stack, and when I run this and try to use the Watch View with a breakpoint, I don't see the actual step names in the parameters (even though they work), but the names of the model steps, so it's been difficult to 

0 Kudos
Message 1 of 3
(758 Views)

Hi Jed,

 

  I recommend you to modify your step name from Vss to MSeq.SeqA.SeqB.Vss, so you can pretty stragforward to see where to have error. There is nothing existing parameters you want, means you need to write the code to combine different parameters.

Like Parameters.Step.Name, RunState.Main.Step.TS.SData.SeqName. Based on this condition, I will choose first one as solution.

 

Ricky

0 Kudos
Message 2 of 3
(727 Views)

Hi, 

 

I think you can use Thread.GetSequenceContext to get the sequenceContext for each callstackIndex and from the sequenceContext get the Step->Name for each caller. Using the step name you can build your custom name that you want to want. 

 

Hope this helps, 

Regards

Anand Jain

NI

Thread.GetSequenceContext - NI

0 Kudos
Message 3 of 3
(704 Views)