NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Unknown variable or property name 'ReportFilePath'. Error accessing item 'Runstate.Root.Locals.ReportFilePath'. in TestStand

Solved!
Go to solution

Hi all.

 

I was using Teststand 4.2 up to last week and upgraded to TS 2013. In 4.2 I was using the following to get the location of the teststand report:

 

Runstate.Root.Locals.ReportFilePath


but with TS 2013 this no longer works.. is the following error:

 

Unknown variable or property name 'ReportFilePath'.
Error accessing item 'Runstate.Root.Locals.ReportFilePath'. in TestStand - Get Property Value (String).vi->

 

I've tried the following now with no success:

 

RunState.Root.Report.Location

 

So my question is how can I get the location (path) of the report file during test programmatically please?

 

Please find enclosed a screenshot of the report config:

 

 

0 Kudos
Message 1 of 10
(9,328 Views)

Ok I've done a bit of digging and hopfully an expert will give me the final push to get this resolved...  🙂

 

 

When my Teststand script(s) start I pull in the serial number of the card being tested via SNMP. I then use this serial number to create a folder and push the testlogs to. Up to now I've been able to read/write the Runstate.Root.Locals.ReportFilePath variable just fine.. But now with TS 2013 I can't..

 

So for example when I run Teststand there is a VI that pulls in the serial number say BD1234.

 

I then want to be able to push the Teststand report to C:\tempResults\BD1234\   

 


After going through the web all morning I've found it is possible to save the report by Specify Report File Path by Expression.. please see screen shot.. but my problem is the report path is generated BEFORE I get a change to pull in the serial number of the card...

 


Is there a way to not create the report until the very end of testing?

 

Or is there a Teststand 2013 alternative to Runstate.Root.Locals.ReportFilePath ?

 

thanks in advance...

 

 

 

EDIT:

 

I saw from this post on this site  : LINKY

That there a parameter called GetReportPath.. can I use this somehow to read and change the report path on the fly?

 

 

 

 

 

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

1) If you are getting the serial number in the normal location for that in the process model, then the report file path by expression specifying the uut macro should work.

 

2) The processmodel sequence callback GetReportFilePath would allow you to get the report file path, but not modify it.

 

-Doug

Message 3 of 10
(9,302 Views)

Thanks for the reply Doug,

 

I'm getting the serial number of the UUT during the Startup section when the Teststand Seq is running and then modifying the Runstate.Root.Locals.UUT.SerialNumber variable with the actaul serial number (ie not scanning it in at the start of test).

 

Is there a way to change the path of the Teststand report either during the test or in the Cleanup section?

 

Thanks again

C Herb

 

 

0 Kudos
Message 4 of 10
(9,298 Views)
Solution
Accepted by cherb

Hi C Herb,

 

By default, the path expression is only evaluated once at the beginning of execution.  However there are 2 ways to force another evaluation at the end:

 

  1. include the <UUTStatus> macro in your report path expression.  This macro can only be evaluated after the execution status is known
  2. In the Calculate Report Path sequence of the NI_ReportGenerator.seq plug-in, set Parameters.ReportOptions.NewFileNameForEachUUTStatus to true before the first if statement is evaluated.  This will override the UUTStatus macro check and force re-evaluation.

You might also be interested in this idea exchange post related to this request:

 

http://forums.ni.com/t5/NI-TestStand-Idea-Exchange/Add-option-to-force-the-report-file-path-expressi...

 

Let me know if this works for you!

Al B.
Staff Software Engineer - TestStand
CTA/CLD
Message 5 of 10
(9,287 Views)

Good morning Al. B.

 

Thank you so much for your reply... Yes I used your first solution and it worked perfectly! The final teststand report is now saved to the correct sub folder (the UUT serial number is part of the folder name) long with all my measurement points.

 

You have saved me a lot of time!

 

Greatly appreciated,

C Herb.

 

 

0 Kudos
Message 6 of 10
(9,270 Views)

@cherb wrote:

Thanks for the reply Doug,

 

I'm getting the serial number of the UUT during the Startup section when the Teststand Seq is running and then modifying the Runstate.Root.Locals.UUT.SerialNumber variable with the actaul serial number (ie not scanning it in at the start of test).

 

Is there a way to change the path of the Teststand report either during the test or in the Cleanup section?

 

Thanks again

C Herb

 

 


You might want to consider setting the serial number in a PreUUT callback instead since that would follow the expected usage of the process models more closely and be less likely to cause unintended problems in the future.

 

-Doug

Message 7 of 10
(9,257 Views)

Hi Al B.

 

This was a great response and useful to me as well. But I have a futher question. I want to add more stuff to my report name than just the UUT name. The TS help says the following in the help topic called Specifying Report File Paths By Expression:

 

 

"For example, to store an XML report file in the C:\Temp\Reports directory with the filename stored in a variable FileGlobals.ReportFileName in the current process model, use the expression "C:\\Temp\\Reports\\" + FileGlobals.ReportFileName + ".xml"."

 

What I've done so far. 

  1. I tried what you said in step 2, I set the parameter NewFileNameForEachUUTStatus to true before the if statement is evaluated. See here:Screen Shot 2015-02-25 at 5.27.47 PM.png
  2. Then I set up this expression: RunState.Caller.RunState.Root.Locals.UUT.SerialNumber=Locals.SerialNo (Locals.SerialNo contains the serial number that I read in when my test sequence runs)
  3. Then I went into configure>report options>Report File Pathname and I selected specify report file path by expression. And I set my expression to "C:\\TesterOutput\\$(UUT).xml" and it worked great.  

But now:

  1. I set the report filepath expression to: "C:\\TesterOutput\\" + FileGlobals.ReportFileName + ".xml" so that I can configure the name further.
  2. I created a FileGlobal in the SequentialModel.seq called ReportFIleName
  3. I try to write to the new FileGlobal from my regular test sequence with an expression: FileGlobal.ReportFileName = Locals.SerialNo.  But when I do this I get an error that says

 

Screen Shot 2015-02-25 at 5.25.14 PM.png

 

I hit ok and then I see the first run time error in the process model.

 

 Screen Shot 2015-02-25 at 5.24.56 PM.png

 

 

Any help is appreciated.

 

Thanks,

 

Marco

0 Kudos
Message 8 of 10
(8,062 Views)

Hi,

 

You are using "C:\\Temp\\Reports\\" + FileGlobals.ReportFileName + ".xml" expression to specify the Report File Path.

 

When evaluating the expression, TestStand looks for FileGlobals.ReportFileName in <TestStandComponents>\Models\ModelPlugins\NI_ReportGenerator.seq file. Hence, create and use the FileGlobal in NI_ReportGenerator.seq to make the above expression valid.

 

If you need to use the FileGlobal variable created in your process model, use the following expression to specify Report File Path:

 

"C:\\Temp\\Reports\\" + RunState.GetPropertyObject("Execution", 0).AsExecution.GetFileGlobals(RunState.Execution.GetModelSequenceFile()).ReportFileName + ".xml"

 

- Shashidhar

 

 

Message 9 of 10
(8,040 Views)

Shashidhar,

 

Thanks for your help! With your tips, I finally got it to work. For anyone else trying to modify report names based on user input after the sequential process model sets the file name path I will re tell what I did:

 

  1. Edit the Ni_RerportGenerator.seq plugin found in C:\Program Files (x86)\National Instruments\TestStand 2014\Components\Models\ModelPlugins\
    • You go into this file and add the step higlighted in Blue at that same location. Please see the expression I typed in the expression box. Setting Parameters.ReportOptions.NewFileNameForEachUUTStatus to true forces re-evaluation of the report name at the end of the sequentialmodel.seq.Screen Shot 2015-02-26 at 2.51.02 PM.png
  2. Then you add a FileGlobal in the sequenatialmodel.seq. I called my FileGlobal ReportFileName
    • Screen Shot 2015-02-26 at 2.54.40 PM.png
  3. Then I added an expression in my test sequence that modified the the new FileGlobal I created:
    • Screen Shot 2015-02-26 at 2.57.24 PM.png

Finally I updated the report options (Go to Cofigure>Report Options > Report File Pathname and under File/Directory Options select "Specify Report File Path by Expression" and I entered my expression. It appears that you can disregard the evaluated report file path error (box below) because your pathname won't be generated until run-time.

Screen Shot 2015-02-26 at 3.01.02 PM.png

 

This worked well for me hopefully it will for others. 

 

Thanks,

 

Marco

 

Message 10 of 10
(8,032 Views)