NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically change station option in TestStand 2.0.1

Previously, I had an issue with changing the station model but that was overcome by the GetStationModelSequenceFile() function and StationModelSequenceFilePath variable.  What I need to do now is to get and change the Test Report type ( text or html ) and enable/disable database reporting.  I haven't found functions or variables to do so.  Does anyone out there know how to do that?  Thanks.
-G-
0 Kudos
Message 1 of 4
(4,005 Views)

Hi,

You can do this by adding the Callbacks Sequences ReportOptions and Database Options to your SequenceFile.

These two Sequence take the ReportOptions container and DatabaseOptions container as Parameters and allow you to change the settings which were set by the Configure Report Options... and Configure Database Options...

You should beable to find more information about these Sequences in the Reference Manual in one of the Appendices about the Process Models.

There may even be an example either as part of the TestStand Samples or on this forum.

try the following link

http://forums.ni.com/ni/board/message?board.id=330&message.id=6778&query.id=102013#M6778

Regards

Ray Farmer



Message Edited by Ray Farmer on 07-24-2008 09:11 PM
Regards
Ray Farmer
0 Kudos
Message 2 of 4
(4,000 Views)
Ray,
I took a look at the link you posted and implemented the ReportOptions and DatabaseOptions callbacks.  Inside each I use the Thread.PostUIMessage ActiveX step type to send a user defined message id to my program.  The program has an event handler for the TestStand engine and receives the messages okay.  Inside the ReportOptions handler ( in the program ), I get the message execution pointer from which I get the report pointer from which I use the PutFormat function to set the report format.  By have 2 of the ActiveX steps in the sequence and adding some debug code in the ReportOptions handler ( in the program ) I can see that format changes as expected.  The format does not change overall, though.  With the station model ( which is modified for On the Fly Reporting and another change for my program ) open in TS I set the ReportOptions and DatabaseOptions using the dialog boxes from the menu.  Whatever they're set to there, regardless of what I set them to in the program handler, is what they behave as further down in the StationModel.  I tried setting the station model local variables ( the ones passed to the ReportOptions and DatabaseOptions sequences as parameters ) but that didn't have an effect either.  What I'm thinking is the variables get changed okay but they don't take hold unless they are saved and reran.  I want to change them at run-time and have them take effect.  Any more ideas?  Thanks.
-G-
0 Kudos
Message 3 of 4
(3,961 Views)
Hi Grasshopper,
 
I'm not sure I follow the behavior you describe. You mention that "format changes as expected.  The format does not change overall, though.".
Where does the format change and where does it not change?
Jervin Justin
NI TestStand Product Manager
0 Kudos
Message 4 of 4
(3,932 Views)