NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Can Teststand report base name be changed programatically?

I see how to change the base name using Report Options>. However, I need to change this at run time so that different units run on the same station have different base names. How can this be accomplished?
0 Kudos
Message 1 of 7
(4,413 Views)
Hi,

You change all the Report Options by using the Sequence Callback Override 'ReportOptions'.

A container is passed to the Sequence ReportOptions with the settings as defined in the static conditions. This allows the user to modify these settings before the sequence returns to the process model sequence.

I have attached an example which changes the basename.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 7
(4,413 Views)
Ray,

I used this method to change the name of the file and also alter some of the other variables and it works fine, except for one problem.

When I change the name of the report, it doesn't change until the next time the sequence is run. For example, the report is initally named 'report 1'. I start the sequence, and change the name to 'report 2' in a dialog box. Now I exit the sequence and look at the report. It is still named 'report 1'. If I run the sequence again, however, now the report will be named 'report 2'.

Is there any way of having the changes take effect immediately?

Thanks in advance,

Dave Neumann
d.neumann@astronautics.com
0 Kudos
Message 3 of 7
(4,413 Views)
Hi Dave,

Can you attach an example of what you are doing.

If you are changing the basename as per the attached example then it should only change the name during runtime by overwritting the default values. The default values dont change from one run to the next unless you change the values via the Configure|Report Options... menu item.

Prior to the Process Model sequence calling the ReportOptions sequence callback, the defaults report option values are obtained by a call to a function in the modelsupport2.dll. This container is then passed (by reference) to the ReportOptions sequence for the user to ammend.

Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 4 of 7
(4,413 Views)
Ray,

I've attached a small sequence file showing what I'm essentially trying to do. When I type in the report name, the report is named after the previous run, not the name I just typed in.

If you see anything I could do differently to make this work or work better, I'd appreciate your input.

For example, I pass the name via a StationGlobal (StationGlobal.Name), which I don't know if that is the most efficient way of passing the new BaseName. I just couldn't figure out a better way of doing this.

Anyway, the big problem is with the report options.

Thanks in advance for your help!

Dave Neumann
d.neumann@astronautics.com
0 Kudos
Message 5 of 7
(4,413 Views)
Hi Dave,

I see your problem.
What you are doing is setting up the name in the wrong place. When the process model executes, the ReportOptions sequence is run before the MainSequence. Therefore, the Report Name will pickup the current value in the StationGlobals. Then MainSequence executes it will set the StationGlobals.Name to a new value. This new value will not be used until the next execution.

I've changed your sequence and moved the Get Name step to the ReportOptions sequence. (also I'm using a Locals.Name).
If you use the API call SetValString with the Options set to InsertIfMissing instead of a Statement step. Then no error will be generated if the Property is missing.

Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 6 of 7
(4,413 Views)

I'm using the BatchModel in TestStand 2012, and a custom Operator Interface.  Is there a way to change the base name, and report location, after the PreBatch Sequence has run?  I want to be able to use the Part Number (for each socket) as part of the report name, and it is not available until after PreBatch.

0 Kudos
Message 7 of 7
(3,688 Views)