From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Set different report directory for each sub-sequence

Solved!
Go to solution

Hi,

My test sequence contains a number of sub-sequences, representing different tests, that can be executed separately.

When any of the subsequences (tests) is selected to be executed by the operator (as 'Run Selected Tests' and not as a part of 'Test UUT')  I have to save the test report in its specific sub-directory in the reports directory. For this purpose I created a variable in StationGlobals, that contains the name of the sub-directory and is changed in the setup section of each sub-sequence (test) according to the test's name.

I'm trying to use the following expression as a Report File Path in Report Options:

StationGlobals.ReportsDirectory+"\\SN_<UUT>\\"+StationGlobals.TestSubDirectory+"\\SN_<UUT>[<FileDate>][<FileTime>]<Unique>.<FileExtension>"

The problem is that the report path expression is read before the selected step's execution begins (and the StationGlobals.TestSubDirectory is changed), therefore the report is always saved in the subdirectory of the previously executed test. Any change in StationGlobals.TestSubDirectory made by the currently executing sub-sequence will be "seen" only in the next execution of any of the sub-sequences.

I tried also to change the report directory using the ReportOptions Callabck, but the same problem exits there as well (is is executed before the selected sub-sequence, that changes the StationGlobals,TestSubDirectory to the its test-specific value).

How can I get the name of the sub-sequence selected for execution in order to build a custom report path/directory for that sub-sequence?

Any other ways will be appreciated as well.

Roman

0 Kudos
Message 1 of 10
(5,034 Views)

Hi roman_beacon,

 

Thanks for posting in the NI Discussion Forums!

 

Which version of TestStand are you using? If you're using version 2010 SP1 or earlier, please take a look at this KnowledgeBase document on dynamically changing report file paths.

 

If you're using version 2012 or 2012 SP1, you might be able to modify the Report Model Plugin you're using to use the correct path. 

0 Kudos
Message 2 of 10
(4,991 Views)

Hello Frank,

Thank you, I've already read this document. Is is not very helpful for my problem, because it describes how to modify the report path for the entire sequence file. I need to modify the report path for each sub-sequence from my sequence file separately, when the operator chooses to execute only a sigle sub-sequence (a single test from the entire test procedure).

I'm using TestStand 2012.

As far as I understood from the sequential model, the report path is configured before the main sequence (or any of selected steps) is executed. I have a station global variable that contains the path of the report for each sub-sequence (when executed as slected step). This variable is changed by the subsequence itself during its execution, but it is too late, because the report path in already configured when the main sequence (or any part of it) actually executes. So, the change of the global variable will be "seen" only in the next execution, and that is not relevant, because the next execution can be of any other test (and its report has to be saved in other subdirectory).

Is there a way to modify the report directory as part of main sequence's execution or in the Post UUT stage?

Roman

0 Kudos
Message 3 of 10
(4,980 Views)
Solution
Accepted by topic author roman_beacon

I solved the problem using my customized LabVIEW user interface :

When the report is displayed in the Report View window, I send it to a PDF printer. At this stage I read the value of the Station Global variable (from TS), that contains the name of the sub-directory in which the report has to be saved (that variable has been already changed by the executed sub-sequence). Then I change the file path for the PDF printer, according to the value of the Station Global variable, so that the PDF report file is placed in the correct sub-directory.

0 Kudos
Message 4 of 10
(4,959 Views)

That's great news, Roman! Thanks for posting your explanation for us.

0 Kudos
Message 5 of 10
(4,942 Views)

The question is if there is a way to do it in TestStand. I tested my solution, and it worked well. However, this is a "patch", that is made in LabVIEW. I'd prefer to do it in TestStand, but I can't find a way to programmatically get the name of the sub-sequence chosen for execution as selected step using Single Pass.

0 Kudos
Message 6 of 10
(4,939 Views)

HI,

 

Just an additional question,

when you what it to create the sub-reports ?

At the end of your UUT or when the subsequence has been finished?

 

Regards

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 7 of 10
(4,921 Views)

My main sequence contains subsequences, each of them represents different group of tests.

Usually, the test operator doesn't perform a full UUT test, but selects only a single group of tests and executes them using "Run Selected Steps As Single Pass". It this case I want to modify the directory in which the report is saved, when the selected subsequence is finished, i.e. the test report has to be placed in the directory dedicated to the its tests' group. I don't want to create different reports for each subsequence.

0 Kudos
Message 8 of 10
(4,916 Views)

HI,

 

I would do it in this way:

1.) Override SequenceFilePostStep,

2.) Check if Step is from Type SequenceCall AND Step is apart of MainSequence

3.) Prepare the ResultObject

4.) Call the TestReport Callback from your model

5.) Store the Report somewhere

6.) Optional Launch the Viewer.

 

... And also take a look at this thread.

http://forums.ni.com/t5/NI-TestStand/Repeating-a-Failed-Sequence-once-more/td-p/1042268/highlight/tr...

Just replace SequenceFilePostStepFailure with SequenceFilePostStep

and you have a solution that stores (i am sorry 😉 )  every Subsequence of Main...

 

Hope that helps

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
Message 9 of 10
(4,909 Views)

We do something somewhat similar in that there is a "Main" that calls all of the test sequences for a product.

  This Main has a "SequenceFilePostStep" that is run after each step.

 

In the SequenceFilePostStep there is a Sequence Call step where the precondition is:

   RunState.Caller.RunState.StepGroup == "Main" && StationGlobals.sReportFileName <> ""

 

This calls a library file (written in Labview, C#, VB, etc.) that renames the file.

In our case, the file is renamed to indicate:

  Number of Errors

  Model Tested

  Build Number

 

For example report file: 

   lib_Test5.html

would be renamed to

   0-ModelX Bld=78 lib_Test5.html

 

You can tell at a glance if the tests were successul or not.

 

This same model can be used to change the path that the final test output is stored in by passing in the subdirectory by using the arguments to rename, or in your case, move the report files to another directory.

 

Mike

 

Message 10 of 10
(4,901 Views)