NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Get report file path at runtime

Hi All,

I am generating teststand report file in a new folder for every run using the specify path by expression option in the result processing window. I used this expression "\\$(ClientFileName)_Report[$(FileTime)][$(FileDate)]"+"\\$(ClientFileName)_Report[$(FileTime)][$(FileDate)].$(FileExtension)" to set the path.

I was trying to get this report file location during runtime so that i could save some other files in this folder.

I checked RunState.Report.Location, Parameters.ReportOptions.Directory but are empty while run time.

 

GetReportFilePath call back gives the correct  path but it is executed at the end of sequence execution.

 

How can i get this path in the main sequence?

 

 

0 Kudos
Message 1 of 10
(2,207 Views)

Have you tried RunState.Root.Locals.ModelPluginConfiguration.Plugins[0].PluginSpecific.RuntimeVariables.UUTReportFilePath?

Where Plugins[0] refers to the  appropriate result processing plugin

 

The value is written here

 

Oli_Wachno_0-1662472782315.png

 

0 Kudos
Message 2 of 10
(2,174 Views)
Hi Oli_Wachno,
Thanks for the reply.
Yes I've checked this. Its showing empty in teststand 2019.
 
 
0 Kudos
Message 3 of 10
(2,169 Views)

I think Oli was close, try:
RunState.Root.Locals.ModelPluginConfiguration.Plugins[0].PluginSpecific.RuntimeVariables.PerSocket[0].Path

This should be filled at the beginning of the MainSequence.

I'm assuming if you have multiple TestSockets, ...PerSocket[Runstate.TestSockets.MyIndex].Path should be used?

 

Stefan

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

Hi kghzvi,

 

This did not work.

 

The persocket[0] section is always empty.

 

I tried writing this value o a local using a statement but it gives unknown variable error.

0 Kudos
Message 5 of 10
(2,123 Views)

Are you using an unmodified NI process modell with an unmodifier report generation plugin?
Are the reports actually created during your tests (so report generation correctly enabled, etc...)?

For debugging, the best way would be to set a breakpoint in the beginning of your MainSequence, and then opening up the variable tree and going down the path I described.

It should look like this:

kghzvi_0-1662704464809.png

 

Stefan

0 Kudos
Message 6 of 10
(2,114 Views)

Hi kghzvi,

 

Yes, I am using an unmodified NI process model with an unmodified report generation plugin

 

I followed the same way to check this on the variable window but I could not see this in NI TestStand 2019.

 

Are you using 2020 version?

0 Kudos
Message 7 of 10
(2,087 Views)

Yes I am using TestStand 2020.

Unfortunately I do not have TS 2019 available.


Stefan

0 Kudos
Message 8 of 10
(2,077 Views)

I can confirm that in 2019, the variable seems to be empty.

Couldn't find the time today to check why that is.

 

Re-Edit: in TestStand 2019, the report file path is calculated in the UUT Done part of the Report Plugin, so it is undefined during client sequence execution 😯

 

Oli_Wachno_0-1663076787701.png

 

0 Kudos
Message 9 of 10
(2,041 Views)

This is interesting because after double checking, the report path variable is filled in the UUT Start part of the report plugin in TestStand 2020 (so prior to the MainSequence call).

 

kghzvi_0-1664171481180.png


Stefan

 

0 Kudos
Message 10 of 10
(1,974 Views)