NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to add process model results to the sequence file results?

After my sequence file runs, I would like to add some additional results using the process model. I need to log my equipment list which is obtained by the process model. Alternatively, I could add a sub-sequence to the end of each of my sequence files for doing this, but that would create maintenance problems if I ever needed to change the way equipment is logged. Does anyone know a way to (1) append process model results to the sequence file results or (2) force each client sequence file to call a sub-sequence before returning to the process model.
0 Kudos
Message 1 of 4
(3,663 Views)
Mark -
The report and database process model routines expect a single subsequence step result that invoked MainSequence. This result contains the results from the sequence call.

In TestStand after the process model root sequence call to MainSequence is performed, the property Locals.ResultList[0] is the MainSequence result. The subproperty Locals.ResultList[0].TS.SequenceCall.ResultList contains the results from the steps in MainSequence.

One option is to create a subsequence call in the process model that logs the equipment info in the results for its steps. The call to the subsequence should not be checked to record results.

This subsequence would have a parameter called ResultList. The Result type does not exist in the Insert menu, so you can only create the parameter by copying the empty Locals.ResultList and pasting it in the parameters. Then change its type from By Value to By Reference.

In the setup of the subsequence, add the following steps which do not record results. These steps rename the Locals.ResultList parameter to ResultListOrig, and then create a new Locals.ResultList alias property that really references Parameters.ResultList. This way any additions to the Locals.ResultList really append to the Parameter.ResultList.

Setup
---------------------------------------
Step: "Rename Locals.ResultList"
StepType, Adapter: Action, Active-X
Description:
Action, Set PropertyObject.Name = "ResultListORIG"

Record Results: False

Step: "Create Alias in Locals"
StepType, Adapter: Actioin, Active-X
Description:
Action, Call PropertyObject.SetPropertyObject ("ResultList",
0x201 ' Not Owning and Create, Parameters.ResultList)
Record Results: False

In the Main steps, you add your equipment info steps which record results.


In the Cleanup steps you undo the steps performed in Setup.

Cleanup
---------------------------------------
Step: "Delete Alias in Locals"
StepType, Adapter: Action, Active-X
Description:
Action, Call PropertyObject.DeleteSubProperty ("ResultList",
0x400 ' Refer to Alias)
Record Results: False

Step: "Rename Locals.ResultListORIG"
StepType, Adapter: Action, Active-X
Description:
Action, Set PropertyObject.Name = "ResultList"
Record Results: False



I have attached a TS 2.0 version of SequentialModel.Seq that has a AppendResults subsequence in it and this is invoked after MainSequence in Single Pass entry point.

Hope this helps...

Scott Richardson (NI)
Scott Richardson
https://testeract.com
0 Kudos
Message 2 of 4
(3,663 Views)
Mark -
I thought about this some more and another solution which is very easy is the following:

In single pass the process model calls MainSequence. The call to MainSequence does not have to be done in the root callstack level. You could add another layer where the current call to MainSequence instead calls a worker sequence. The worker sequence inturn calls MainSequence and the additional steps or sequences to create the equipement info results. This way you can add results before or after the call to MainSequence. The downside is that all executions have an extra layer of reporting done and your client sequence does not show up until level 2 of your call stack instead of level 1 in the report or in the database you log results to.

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

Thanks for this Scott. The attached example worked brilliantly and saved me tons of work trying to figure it out.

Spoiler
 

 

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