NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

UUT Serial Number not used in NI report file path name

Solved!
Go to solution

Hello all,

 

I'm facing an issue with the TestStand UUT serial number together with the NI Report Generator File Path Name.

 

In the beginning i was programatically assigning the serial number in the PreUUT Callback (also according to https://www.ni.com/en/support/documentation/supplemental/17/programmatically-change-the-uut-or-batch...).

 

Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].UUT.SerialNumber = "MySerialNumber".

 

The built-in Report Generator then automatically filled the Serial Number in the report and also in the report file path name like MyReport[MySerialNumber][0][14 04 45][14.11.2024].xml.html.

 

 

But now i had to change the from the assingment in the PreUUT directly to the MainSequence, so the expression looks like this:

 

RunState.Root.Parameters.ModelData.TestSockets[RunState.TestSockets.MyIndex].UUT.SerialNumber = "MySerialNumber"

 

Here also the built in Report Generator automatically filled the Serial Number in the report, but now the report file path name looks like this:

MyReport[Emtpy_UUT_SerialNo][0][14 04 45][14.11.2024].xml.html.

 

So I can not see the expected Serial Number in the file path name.

 

What changes need to be made that in the latter case the report file path name is generated with "MySerialNumber"?

 

 

Best regards

0 Kudos
Message 1 of 6
(182 Views)

I‘m not exactly sure, I have no system available at the moment, yet I would bet the serial number in the ModelData Object is not used for report generation.

 

I would bet on 

 

RunState.Root.Locals.UUT.SerialNumber


or similar in the ProcessModel you are using

 

0 Kudos
Message 2 of 6
(157 Views)

Can you use NI's built in macros?  There is a macro for Serial Number and it will dynamically put the value in for you.

eejallen_0-1731624474279.png

 

eejallen_1-1731624765002.png

See this article for explanation of all macros.

Specify Report File Path by Expression - NI

 

0 Kudos
Message 3 of 6
(142 Views)

Thank you very much for the answers/hints.


I tried the build in macro $(UUT). Unfortunately this does also not work when assigning in the MainSequence, i still get the MyReport[Emtpy_UUT_SerialNo][0][14 04 45][14.11.2024].xml.html.

 

It seems like that the relevant information needs to be present at the PreUUT for the Report Generator.

After some debugging i found out, that the initial file is already generated at the ParallelModel.seq --> ModelPlugins - UUT Start

ulliman_0-1731670645163.png

Diving deeper into the Plugins, the generation itself is happening in the NI_ReportGenerator.seq (Determine Report File Path Expression):

ulliman_1-1731670722647.png

 

 

So that's why it now working for me because this is happening before the MainSequence already.

 

Is there maybe another possibility to generate this report path file name when assigning the serial number in the MainSequence? Or am i bound to the PreUUT?

0 Kudos
Message 4 of 6
(120 Views)
Solution
Accepted by topic author ulliman

PreUUT is the critical point in the process model where the Serial # is set.  This is how the Execution status string knows the S/N and the reports will be able to print the serial number to the header and create the filename if used in the filename.

 

However, if you want to change the serial # later in MainSequence and then have the report filename name updated; please try putting a GetReportFilePath callback into your sequencefile.  This callback will have the file path in Parameters.ReportFilePath.  You could then use a copy or move command script to copy the file into a new filename of your choice.

 

0 Kudos
Message 5 of 6
(103 Views)

Ok, thanks for the hint with the GetReportFilePath.

Maybe not the most comfortable solution with the file copying, but worth a try.

 

0 Kudos
Message 6 of 6
(78 Views)