01-19-2023 07:04 PM
Problem: Our test generates a lot of data, so in Pre-UUT, after reading the SN, I create a unique test folder where all the data from each run resides. For example: c:\testData\SN1234_20230119_091211\ (SN_DATE_TIME)
All my test data is saved into this folder.
The problem is that the official Test Report is created elsewhere.
I have inserted code into POST-UUT to copy the report. Actually, I don't want the XML report, but the PDF.
However, the Report Generation is actually invoked asynchronously. So POST-UUT runs before the report (and the PDF) is generated. On some runs this can take tens of seconds, if not longer, to generate the report and the PDF. Also, once in a while something goes wrong and the file is not copied. This is not acceptable.
So the code I have in POST-UUT basically hangs the run until the report is done.
I would like to just change the report folder to my target, but it has to change AFTER we collect the SN. So setting it in the ReportOptions callback doesn't help, because any code there is invoked before PRE-UUT.
I am using a custom model, so I could use a custom report generator and move it.
01-20-2023 09:15 AM - edited 01-20-2023 09:26 AM
If you are using XML and PDF, why don't you just adjust where the report gets built so it's based on the serial number. The timestamp is not the same format, or the year doing it this way. But if you are open to change that, then this solves your issue without any modification to your sequence.
You can see the "Specifying Report File Paths by Expression" help for more information. As you can actually use FileGlobals/StationGlobals in the process model as part of the expression for report path. So if you set your FileGlobal to be the SN_DATE_TIME you could probably achieve the exact format you want with just minor modification to your process model since it's already custom.
01-20-2023 12:46 PM
Man, thank you. For some reason I assumed that since it processed the options early, that the path had to be frozen by then. But it seems that if you set by expression, it evals the expression when the file is created. Nice.
01-23-2023 01:57 PM
I am dying here.
Can someone help me insert a value determined in the MainSequence into the path of the report?!
Essentially, we have a testname that is specified only at that point. I need to insert that into the path.
I have tried to write this to Runstate.root.locals, and place that into the evaluation string, But I still get an error.
01-23-2023 02:14 PM
The Report path gets created at different times depending on what Macro's you are using. Look at the "Specifying Report File Paths by Expression" in the TestStand help. If you want to adjust the path as part of the MainSequence, you have to use a Macro so TestStand knows when to create the path. You could then just modify the expression to remove the macro. See snippet below from that section, but there is a lot more in there that is helpful.
01-23-2023 05:53 PM
Ugh, yeah... that's what's killing me.
I essentially want my path to be...
c:\reports\TestName\[UUT_SN]_[TestName]_[DATE_TIME]\[UUT_SN]_[TestName]_[DATE_TIME].xml
"TestName" is actually a variable: MainSequence.Locals.Testname (done this way because one sequence file is used to run several variants of the test in the Sequence File)
(And Date and Time are formatted to be "20230123_154526". I honestly can't believe the $(FileTime) takes its format from the windows time format. this has caused so much trouble)
So yeah... the problem is that if the path is determined before the MainSequence, it will fail to create the proper path.
But I don't want UUTStatus to be part of the path.
Is it possible to force this another way?
01-23-2023 06:37 PM
LOL, I actually was able to make this work by doing this...
\\\\$(UUTStatus)\\\\..\\\\[$UUTSerial]_
The "\\\\.." as part of the path will essentially erase the status directory in the path of the file.
However! The PDF generator then chokes on this. Grrrrr.