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 Report File Location variable

Solved!
Go to solution

Hi,

 

In TestStand 2010 SP1, I have the "report file path" as one of the column into the database using the RunState.Report.Location.  This has been working until I upgraded to TestStand 2012.  The RunState.Report.Location is always empty.  I also tried to use the RunState.Root.Locals.ReportFilePath but I get an error that this is an unknow variable when logging to the database.  Even when removing the <UUTStatus> from the file path expression below, there is no difference.  

 

I am using the following report file path expression:

"C:\\TSReports\\<UUTStatus>\\<ClientFileName>_Report[<FileDate>][<FileTime>][UUT]_<UUTStatus>.<FileExtension>"

 

Which variable contains the report file path in TestStand 2012.  

0 Kudos
Message 1 of 8
(5,584 Views)
Solution
Accepted by topic author Dexter.2Rays

I haven't tried it, but RunState.Report.Location might work if you set the New Thread option on the Report and Database to False (assuming the report is first in the list) so you can be sure that the Report has been generated before you check that value.

 

You have to set the Configure>>Result Processing>>Show More Options to see the New Thread options.

 

This should give you access to the path of the Displayed report (the one with the checkmark in the Display column). However, in TS 2012, you can have any number of reports.

 

There is a new callback, GetReportFilePath, you can add to your sequences to obtain the report paths as they are determined. You could store the paths in a station global or runtime variable for later use if needed.

 

 

Message 2 of 8
(5,581 Views)

Thanks James_Grey!  The New Thread options set to NO resulted what I was looking for.  

0 Kudos
Message 3 of 8
(5,562 Views)

Is there a way to programmatically set new thread option to No?

0 Kudos
Message 4 of 8
(5,294 Views)

You can override the ModelPluginOptions callback sequence and set Parameters.ModelPlugin.Base.NewThread = False

0 Kudos
Message 5 of 8
(5,290 Views)

Hi James,

thanks a lot,... this is exactly what I would need... unfortunately the RunState.Report.Location varaible is empty (seen in the watch window during execution of the main sequence). New Thread option is set to false. The GetReportFilePath callback seem to be called at the end of the  sequence. Then it is too late to use it, or?!? :). So I also tried another one (SequenceFilePreStep) to get the Report location:

StationGlobals.resultDir = RunState.Report.Location; But this variable is still empty. This one:

StationGlobals.resultDir = Parameters.ReportOptions.Directory is not running. There are many Parameters / Variables / settings but none of them is working,... this is a bit frustrating 🙂 

Can you help how to get the directory of the report as a variable during the main sequence run?

Thanks a lot

Matthias

0 Kudos
Message 6 of 8
(3,476 Views)

Hello Matthias,

 

This thread hasn't been posted to in a while, so I doubt that James is still watching it. You are always welcome to create a new thread for your questions. 

 

I found a help document that may be helpful to get started, but I would recommend creating a new thread for this if this does not help.

http://zone.ni.com/reference/en-XX/help/370052H-01/tsref/infotopics/specifyreportfilepath_byexpressi...

Maggie M.
Application Engineer
National Instruments.
http://www.ni.com/support
0 Kudos
Message 7 of 8
(3,457 Views)

To add to this, the RunState.Report.Location will only be non-empty, if the "Display" checkbox is ticked on one of the active reports. (TS 2014)

Wanted to leave this here, in case, anyone else has the New Thread option set to "No", but are still having issues.

0 Kudos
Message 8 of 8
(2,199 Views)