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: 

TestStand 2012 Batch Model: Create Report Filename based on Parameters obtained in PreBatch

I am trying to generate the ReportFilePathName by Expression.  A couple of the parameters are not known until the PreBatch Serial Numbers have been entered.  The Example below, doesn't work because in ReportOptions the Parameters are not available (Parameters are strings).

 

Parameters.ReportOptions.ReportFileBatchModelExpression = "\"<ClientFileDir>\\\\TestReport\\\\" + Parameters.UUT.ModuleType + "_MSN[<UUT>]-ESS_PN[" + Parameters.UUT.PartNumber + "][<FileTime>][<FileDate>]<Unique>.<FileExtension>\""

 

I created a statement in NI_ReportGenerator.seq to do the same thing, in Model Plugin - UUT Start, then called DetermineReportFilePathNameExprEx but it says you cannot change the Path during RunTime.  It apparently is also called in Model Plugin - Batch Start.

 

How can I accomplish setting the FileName at Run Time, without it being in the Client Sequence File?

0 Kudos
Message 1 of 9
(3,919 Views)

In Configure Result Processing you can configure the Report File Pathname to create a new UUT report file for each UUT which will include UUT data (part number and model type). Considering you are unable to change the variable at Run Time I would consider the configuration options instead.

Ian M.
National Instruments
0 Kudos
Message 2 of 9
(3,902 Views)

"The Example below, doesn't work because in ReportOptions the Parameters are not available (Parameters are strings)."

 

Could you store the data you need some where that is sure to be accessible? How about:

 

     RunState.Root.Locals.SetValString("MyPartNumber", PropOption_InsertIfMissing, "1234")

 

 

Then refer to Runstate.Root.Locals.MyPartNumber in your custom path expression.  I haven't tried it, but I think it might work as long as you set your value(s) before the report path expression is first evaluated for the UUT.

 

 

 

 

 

0 Kudos
Message 3 of 9
(3,898 Views)

I found a way to get it to work, not sure it is the best way.  Added a statement in NI_ReportGenertor.seq in "Model Plugin - Begin", "Model Plugin - Batch Start", and "Model Plugin - UUT Start".

 

The Begin Plugin needed to use Local Variable for instead of Paramters.UUT. 

Parameters.ModelPlugin.PluginSpecific.Options.ReportFileBatchModelExpression ="\"<ClientFileDir>\\\\"+ Locals.UUT.ModuleType +(Locals.UUT.ModuleType ==""?"TestReport\\\\":"\\\\TestReport\\\\")+ Locals.UUT.ModuleType +" _MSN[<UUT>]-TR2_ESS_PN["+ Locals.UUT.PartNumber +"][<FileTime>][<FileDate>]<Unique>.<FileExtension>\""

 

Parameters.ModelPlugin.PluginSpecific.Options.ReportFileBatchModelExpression ="\"<ClientFileDir>\\\\"+ Parameters.UUT.ModuleType +(Parameters.UUT.ModuleType ==""?"TestReport\\\\":"\\\\TestReport\\\\")+ Parameters.UUT.ModuleType +" _MSN[<UUT>]-TR2_ESS_PN["+ Parameters.UUT.PartNumber +"][<FileTime>][<FileDate>]<Unique>.<FileExtension>\""

 

0 Kudos
Message 4 of 9
(3,885 Views)

Tell me , please, did it work?

I also want to build a new name for every test report, deriving it from a local variable, which will be set during the test execution. Untill now I haven't found a way to do it: even if I include in the test report file name the name of logged in user and manipulate it during the test execution, replacing it by a variable, which I want to see in the test report name, it doesn't work - the replaced name is active for the NEXT call of the test sequience.

I would prefer not to edit any TestStand sequencied which are contained in the  Test Stand delivery package, because I shoud do it on every machine where I use TestStand.

Does anybody know how to outsmart  the TestStand "legally" :-)?

0 Kudos
Message 5 of 9
(3,851 Views)

The issue is setting the variables before the report path expression is evaluated.  The Report Filename is generated in the sequences: "Model Plugin - Begin", "Model Plugin - Batch Start", and "Model Plugin - UUT Start" which are called before the Main Sequence in the Client File is called.  The solution I posted is in the NI_ReportGenerator.seq.

0 Kudos
Message 6 of 9
(3,842 Views)

Thank you for your answer. Whehe can I find the NI_ReportGeneration.seq? I searched for it in TestStand directory and haven't found. According to the name it shall be something, what NI deliveres, isn't it?

0 Kudos
Message 7 of 9
(3,837 Views)

I'm using Windows 7, C:\Program Files (x86)\National Instruments\TestStand 2012\Components\Models\ModelPlugins\NI_ReportGenerator.seq

0 Kudos
Message 8 of 9
(3,835 Views)

Thank you, I'll ry it

0 Kudos
Message 9 of 9
(3,830 Views)