NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Plugin for programmatically printing the report

So I'm a bit of a rookie at modifying the TestStand process models.

 

I am using TS2012 with the standard sequntial process model. I would like to print the report for a given UUT at the completion of the test sequence. This would seem to fit right within the concept of the Addon process models. I have seen the follwoing example for performing this task http://www.ni.com/example/30889/en/ , however, I am not sure how to get the current report name or how to pass this into the addon process model.

 

0 Kudos
Message 1 of 6
(4,594 Views)

By "addon process model" I assume you mean that you are using the example stated in your post as a TestStand plugin. If I understand correctly you want to get the report name from the report being printed by the plugin?

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 2 of 6
(4,549 Views)

"By "addon process model" I assume you mean that you are using the example stated in your post as a TestStand plugin. If I understand correctly you want to get the report name from the report being printed by the plugin?"

 

 

Not quite from the plugin but to the plugin. For the example to work I have to provide the print report sequence with the report name, path and schema.

 

So you know where I am at.

I have created a model plugin using the instructions provided here and copied the sequnces from the "Programmatically Print"  example provided into the plugin. From here I added a sequence call to the Print Report subsequence in the "Model Plugin - Post UUT" seqeunce. This mostly worked if I hard code the report name, path and schema. I still need to determine and pass these values into the print report sequence.

 

I've attached the plugin and required librarys for the print report sequence.

 

Thanks for your help.

 

0 Kudos
Message 3 of 6
(4,541 Views)

These are the 3 parameters that we need, now we just need to figure out how to pipe these into the plugin. 

 

Parameters.ReportOptions.BaseName

Parameters.ModelPlugin.Base.RuntimeVariables.AbsolutePath

Parameters.ReportOptions.StylesheetPath 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 4 of 6
(4,514 Views)

So I believe that I have the answer!

 

As I said before

- I created a model plugin and copied the "Print Report" and "Convert XML report to HTML" sequences into the plugin

- Ensure that the ReportFilePath, StylesheetPath, ReportFormat, PrintOption, and ShowDiaglog are added as variables in the "Print Report" sequence

- I called the "Print Report" sequence from the Model Plugin - Post UUT

- In the Module -> Step Settings pane for the Print report call; I added the following variables

               ReportFilePath = RunState.Report.Location

               ReportFormat = "XML"

               StylesheetPath = RunState.Report.StyleSheetPath

               PrintOption = 1

               ShowDialog = 1

In the case of the variables they can be found in the Expression Browser->TestStand API tab

Message 5 of 6
(4,501 Views)

Thanks for taking the time to write all that out and help future customers that might run into this same problem.

 

Rob S
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(4,428 Views)