NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to globally modify the contents of ResultList.TS

Hi, I am trying to customize TestStand to include every step comment in the ResultList, to later include it in the report. I don't want to modify to create custom step types, or even modify the standard step types to include comment in Step.Result. During execution, the contents of Step.Result get appended to Locals.ResultList, but Locals.ResultList[step #] also contains TS, which contains TS.StartTime, TS.StepName, TS.StepType, etc. I want to add a StepComment Property to the TS container so that it's a global change. I can't find where to change the definition of ResultList.TS and what to change to populate that new property with the string value of the step comment.
 
How would I go about doing this?
0 Kudos
Message 1 of 12
(5,929 Views)

Hi,

Not sure why you are trying to do this when every step already has a text parameter in the results call reporttext and this you can fill at the same time you write the result.

Is this some information thats not available when the step is being invoked?

Regards

Ray Farmer

 

Regards
Ray Farmer
0 Kudos
Message 2 of 12
(5,923 Views)
Ray,
The step comment I am trying to include in the ResultList is available, since it was entered in the step dialog box by the sequence developer. I'd like to leave ReportText available for the user instead of automatically overwriting it (or get overwritten) with whatever approach i use to give the property a value. what do i need to do to write the value of the step comment to a result property whether it is a built-in like ReportText, or a custom property that I added to the step, without having to add an expression to the step for every step in every sequence being developed for the system and without having to add an extra step to the sequence.
 
F
 
0 Kudos
Message 3 of 12
(5,920 Views)

Hi Freak,

Let me first clarify my eventual answer by saying if you had a step property that shows up in the step context, this process is much easier.  It can be done with the Execution.AddExtraResult method which automatically adds a property to the result list for all steps in which the property exists.  However, the comment does not show up in the step context and so the process becomes a little different, but still equally possible.  You can use an engine callback, either SequenceFilePreStep or SequenceFilePostStep, to add a property to the result list for every property.  I added the SequenceFilePreStep and with the first step, I created a Result.Comment with the value of CommentOf(Parameters.Step) which returns the comment of the particular step using a SetValString with the options of InsertIfMissing.  The second step sets the flags of Result.Comment to IncludeInReport so it is automatically put in the report instead of forcing you to change the report generation sequence manually.  Please see the attached sequence for this solution.

If you want to make this process occur for all sequence files using a particular process model.  Copy the steps from SequenceFilePreStep to a ProcessModelPreStep in your process model.  This will run the steps prior to every step in the client sequences running that process model, but not before the steps in the process model itself.

Let me know if you have any other questions.

0 Kudos
Message 4 of 12
(5,899 Views)
Lets try again to attach the file.
Message 5 of 12
(5,898 Views)
Here is the same solution, slightly modified to use the PostResultListEntry callback.
 
By using a PostResultListEntry callback, you are only called for steps that generate a result. In addition, the Result.TS sub-property is available and fully populated.
 
Also, this example modifies the result list entry directly instead of modifying the step result which is later copied to the result list entry. This is potentially more efficient if you attach a large amount of data to the result.
 
 
 
 
 
Message 6 of 12
(5,893 Views)

Good call James.  So many callbacks to choose from and I forgot about this one.  Thanks for helping out.

0 Kudos
Message 7 of 12
(5,890 Views)
James, Adam,
 
Thanks for the solution and the examples.
 
F
0 Kudos
Message 8 of 12
(5,868 Views)

Hi All

 

I was asked about this question. I just entered "Result.TS" in the search field here in this board.

And I exactlay found the what i need!

Good work and time to spend some kudos on an "old" thread

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 9 of 12
(4,988 Views)

I would be really interested by your solution, since I've exactly the same problem, but I'm working on Teststand 3.0, and I cannot open your sequence file in attachment..

Could you convert it to Teststand 3.0 ?

0 Kudos
Message 10 of 12
(4,506 Views)