03-15-2019 04:31 PM
Hello!
I'm using the sequential model in TS 2017. In MainSequence, one of my modules creates a directory for logs and other output files from my DUT. I want to put the TestStand report in this same directory. The folder is going to be located at "StationGlobals.ReportDirectory", and the file name needs to contain the identifier "TestID". I will update both of these from MainSequence for every DUT. This all works when I configure from the Report Options window:
However, I want to do this programmatically in the ReportOptions sequence since this reporting strategy is specific to this one sequence. I have created the override, but I cannot for the life of me figure out how to get the expression right. When I use the config window above and then set a breakpoint, I notice that the two ReportOptions that relate to that expression are:
(It's important that the two variables are variables because I'm going to set them in the sequence. Using the $(UUTStatus) macro allows the expression to be evaluated and the report created after MainSequence, which is exactly what I need.) So, the above is what I want to achieve. But when I try to set these expressions myself in ReportOptions, I do this:
But when I look at the same variables, I see that they're already evaluated with the StationGlobals values:
Basically, I can't seem to figure out the syntax to get the variables to appear as literals in the variables above, and I think that that's the key to actually getting this to work. I'm convinced I'm missing something simple, but after half a day of playing with this and poking around in the help, I can't figure it out.
Thanks,
David
Solved! Go to Solution.
03-18-2019 05:09 AM
Hello David,
When you set the expressions in the ReportOptions callback, you must surround your station globals variables with quotes, else they are evaluate when the ReportOptions callback is executing
For example, the following statement should set the variable with the value you are expecting
Parameters.ReportOptions.ReportFileSequentialModelExpression = "StationGlobals.ReportDirectory + \"\\\\Report$(UUTStatus)_\" + StationGlobals.TestID + \".$(FileExtension)\""
\" put a quote in your statement, \\ put a \
03-18-2019 08:39 AM
Thank you! I tried so many variations of where to put the quotes, and it always ended up literally including the text "StationGlobals.VariableName" in the created path.