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: 

Changing the report name at run time

TS 2013:  My goal is to change the report name with a value read my UUT. I've read several posts about doing this but don't understand. I've added the <UUT> macro in the report options dialog but am stuck at how to write to that value at run time. I use the Single Pass execution (Sequential mode).

 

"Determine Report File Path" is mentioned often (which I have not been able to locate) and a ReportOptions callback but I'm not familar with callbacks.

 

So could someone give a newb a hand and list a sequence of clicks and right clicks to get me going?  🙂  Thanks!

0 Kudos
Message 1 of 14
(7,244 Views)

Pat,

 

I'm having a similar problem, posted here. Maybe someone can jump in and help us both out.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 2 of 14
(7,232 Views)

Hi Pat

 

You can modify the Report Options Callback in order to change its base name. To do this first go to the Sequence Pane, right click on it and select Sequence File Callbacks.

 

From the list that is displayed select Report Options, and then click on Add and Ok.

 

If you expand the Parameters in the Variables Pane, you can look for a parameter called Base Name. You can add a step to change that name with the UUT variable.

 

The call the Report Options as a subsequence in your main sequence.

 

Regards

Chris S.
0 Kudos
Message 3 of 14
(7,207 Views)

Store the UUT info you need where you can get it later:

1) Open your sequence file. Select View>>Sequence File>>Variables

2) Right click on FileGlobals in the Variables pane. Select Insert File Global>>String. Type MyUUTInfo as the variable name.

3) Go to your MainSequence (or whereever). After the point where you determine the piece of data from your UUT that you want in the report name, insert a statement step. Set the statement to:

FileGlobal.MyUUTInfo = Locals.WhereeverMyUUTInfoIs

 

1) Select Edit >> Sequence File Callbacks...

2) Select GetReportFilePath in the list. Click Add. Click Edit.

3) Insert a statement step or call a code module to insert the value of FileGlobals.MyUUTInfo into the value of Parameters.ReportFilePath

0 Kudos
Message 4 of 14
(7,195 Views)

James,

 

For what it's worth it appears that in the GetReportFilePath callback that setting the name or report filepath doesn't have any effect. Looks like the Report File path has already been opened / determined by the process model.

 

Chris,

 

I'm pretty sure that ReportOptions is called before the Main Sequence, so having to change the name of the report or the path of the report changed from something in the Main Sequence wouldn't work either.

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 5 of 14
(7,150 Views)

Aaron,

 

My mistake. I should have read the help for that instead of assuming.  Would be nice if that worked.... I'll submit a suggestion for that functionality.

 

- James

0 Kudos
Message 6 of 14
(7,145 Views)

So...basically, I'm out of luck unless I want to customize the process model?

Aaron W.
National Instruments
CLA, CTA and CPI
0 Kudos
Message 7 of 14
(7,143 Views)

You could try assigning the updated path to RunState.Caller.Locals.ReportPath in GetReportFilePath instead of to Parameters.ReportFilePath.

 

However, this will only work if your other report settings don't conflict with having the path changed at this point, which would be most easily determined by testing it.

 

- James

 

Message 8 of 14
(7,135 Views)

Getting closer...

 

I can update RunState.Caller.Locals.ReportPath in GetReportFilePath and I see an HTML document in the desired path. However, I have a 0 byte html file in the directory that is configured via the Report Options (so in the same directory as the sequence file. I can write a VI to delete that file unless you know of a way around that.

Aaron W.
National Instruments
CLA, CTA and CPI
Message 9 of 14
(7,133 Views)

Deleting it sounds reasonable.

0 Kudos
Message 10 of 14
(7,128 Views)