NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get a step's calling sequence?

Hello all.
 
I'm attempting to modify the TestStand report generation sequence (reportgen_html.seq), and would like to record, per step, the name of the sequence (and sequence file) that called the step.  I expected this to be obvious, but I can't find a way of doing it.  It's not an element of the Parameters.Result... container that's passed to the reportgen_html file.
 
I've been trying to use the ActiveX API to find out this information - I was trying to get a reference to the step, then find out the name of the sequence and sequence file from there.  I've got the steps to do all this, I'm just not able to find a way of getting a reference to the step in the sequence file that is currently executing.  I can easily get a reference to the sequence within reportgen_html.seq (where my step is located) - the problem is that I need to get a reference to the step within the user's sequence.
 
Hopefully I'm missing something really obvious, and someone will reply to tell me it's RunState.Here.It.Is or something Smiley Happy
 
I found a way of getting a reference to the top-level sequence, but this stays the same, regardless of whether the step is within a sub-sequence.
 
I don't think I'm trying to do anything too weird!
 
Thanks in advance to someone who knows the inner workings of TestStand...
0 Kudos
Message 1 of 4
(4,045 Views)
Me again.
 
Having thought about this a bit more, I'm thinking that perhaps, by the time the report generation is running the executed step has completed, so it's probably not possible to get a reference to it, even if I could find a way to express what this variable is.  Hopefully someone who knows more than I do can say whether this is right.
 
I'm now trying a different method (but I've still not got it working).  I'm thinking of adding strings named "Sequence" and "SequenceFile" to the Step.Result.Common container.  I have tried this, and it does propogate the change through all the sequence files.  This data is then available to the report generation sequence.  However, I can't find a way of telling TestStand what data these two variables should be populated with.  If I put an expression into it and tick the "Apply value to All Loaded Instances of the Type", then the instance of it within each sequence file is just populated literally with my statement, not the evaluation of the statement.
 
All I need is a way of recording the sequence that called each step.  Someone please tell me the easy way to do this!
 
Thanks
-Sean.
0 Kudos
Message 2 of 4
(4,035 Views)

All done now - works great with either cached or on-the-fly reporting.  Got there in the end, after stepping through and working out the convoluted way in which the standard reporting functions put the subsequence names into the report.  I'm still recovering.

I assume from the lack of reply that nobody else has done this.

Message Edited by Sean on 07-08-2005 08:28 AM

0 Kudos
Message 3 of 4
(4,010 Views)

Sean -
I do not recommend adding to the CommonResults to achieve this. There are two types of logging as you mention: post UUT and On-the-fly.  For processing results post UUT, you typically recurse through the results by process the parent result before you process its child results.  The parent result is a sequence call step result and it has the knowledge of which sequence and file generated the child result. For processing On-the-fly, the PostStepResultCallback has a context.  The step for the result calls this sequence.  So from this context you can access the calling sequence with NameOf(RunState.Caller.RunState.Sequence) and file with NameOf(RunState.Caller.RunState.SequenceFile).

 

Scott Richardson
https://testeract.com
0 Kudos
Message 4 of 4
(3,983 Views)