04-23-2014 04:17 AM
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:
Solved! Go to Solution.
04-23-2014 06:13 AM - edited 04-23-2014 06:15 AM
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?
04-23-2014 10:34 AM
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
04-23-2014 10:46 AM
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
04-23-2014 03:00 PM - edited 04-23-2014 03:00 PM
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:
You might also be interested in this idea exchange post related to this request:
Let me know if this works for you!
04-24-2014 04:34 AM
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.
04-24-2014 10:25 AM
@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
02-25-2015 07:33 PM
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.
But now:
I hit ok and then I see the first run time error in the process model.
Any help is appreciated.
Thanks,
Marco
02-26-2015 12:35 PM
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
02-26-2015 05:02 PM
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:
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.
This worked well for me hopefully it will for others.
Thanks,
Marco