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: 

Can't figure out syntax to properly set Parameters.ReportOptions.ReportFileSequentialModelExpression

Solved!
Go to solution

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:

 

Capture.PNG

 

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:

 

Capture2.PNG

Capture1.PNG

 

(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:

 

Capture4.PNG

 

But when I look at the same variables, I see that they're already evaluated with the StationGlobals values:

 

Capture5.PNG

Capture6.PNG

 

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

0 Kudos
Message 1 of 3
(2,165 Views)
Solution
Accepted by topic author croohcifer

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 \

 

0 Kudos
Message 2 of 3
(2,131 Views)

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.

0 Kudos
Message 3 of 3
(2,125 Views)