NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can the Report-Entry(UUT-Result) of a sequence be set to "Terminated"?

Hello,

I'm using a sequence which calls other sequencies with the methods of the TestStand API. The sequence reads an INI-File and every found sequence is executed and there is even a Report generated for each entry. There is a Report (one entry for each called sequence) generated for the mother sequence too.
The problem is that the user should be able to stop this execution between the Execution of two sequencies. I created a sequence to modify a Station Global, this sequence could be executed by clicking on the generated entry of Tools menue.
The mother sequence is observing this station global before the call of the next sequence is
executed.
If the station Global was mod
ified to break the excution, i want to put the string "Terminated by user" at UUT-Result Entry to the Report of the mother sequence.

Has anyone an idea how this could be realized?

Thanks,
Sunny
0 Kudos
Message 1 of 2
(2,947 Views)
Sunny,

The value "Terminated" is added to the report by the step Add UUT Result in the AddReportHeader sequence of either reportgen_html.seq or reportgen_txt.seq. This step is just a statement step that reports the value of Locals.Status which is set in the first step of the sequence, GetStatus.

There are several solution to your request. I will give you one and hopefully from you understanding of it you can derive a solution that will best meet your needs.

I am attaching 2 files - a sequence which you will manuall terminate and a replacement for the reportgen_txt.seq file.

Place reportgen_txt.seq in \Components\Use\Model director. Select Configure>>Report Options in the sequence editor and change the Report Format to ASCII Text File.

Open TerminateByUser.seq. Notice that there is a statement step in the Cleanup stepgroup. It adds the text " by user" when the sequence is terminated. This text is added to the property RunState.Caller.Step.Result.ReportText, which is a property of the step in the process model sequence that calls your MainSequence. This step will only be executed when Locals.TerminatedByUser is True and when the sequence is called using a process model entry point.

The AddReportHeader sequence of reportgen_txt.seq has been modified. The second step is new. It sets the value of Locals.ReportText if the MainSequence was terminated and if your sequence changed the ReportText to " by user". The expression in the Add UUT Result step of this sequence has also been modified to include the value of Locals.ReportText in the report.

In TerminateByUser.seq place a breakpoint on the Terminate step in the Main step group of the MainSequence. Select Execute>>SinglePass. When the execution reaches the breakpoint select Debug>>Terminate. In the report you shoud see that the UUT was "Terminated by user". Change the value of Locals.TerminatedByUser to False and execute the sequence in the same manner. The report will only shown that the UUT was "Terminated".

You can use other factors to determine when and how to change the report.

You might also want to set the value of the ReportText from within the process model. You could use the Post Expression of the MainSequence Callback step within your process model sequence to set the value of the report text. For example, you could make the post expression
SationGlobals.TerminatedByUser==True &&
Step.Result.Status == "Terminated"?
Step.Result.ReportText = " by User":""

This conditional satement means that if SationGlobals.TerminatedByUser is true and you MainSequence was terminated, then the step's report text property would be updated.

There are many options. Good luck.
Download All
Message 2 of 2
(2,947 Views)