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 station options programmatically

Hi
 
I am trying to change the Station Options programmatically (in a TestStand seq) rather than via the dialog. In particular, I want to change the "Immediately Goto Cleanup on Sequence Failure", although I will probably also want to change other options later. 
 
I have succeeded in:
  • Getting the ConfigFile (PropertyObjectFile) using the Runstate.Engine reference
  • Getting the Data (PropertyObject) using the Configfile reference.
  • Setting "StopOnSequenceFailure" using SetValBoolean with the Data reference.
  • Saving the changes to TestExec.ini, using SaveFileIfModified with the ConfigFile reference.

However, the change only takes effect when TestStand is restarted, and does not show up in the StationOptions dialog (until a restart). Using the dialog, I can change the setting while stepping through a sequence, and it takes effect immediately, so there must be a way to do this from within a sequence.

How do I "refresh" TestStand's "copy" of the variable?

Thanks

(I am using TestStand 2.0.1.)

Message Edited by Jan0 on 09-30-2005 02:50 AM

0 Kudos
Message 1 of 4
(4,143 Views)

OK, I have solved my immediate problem.

Shortly after posting the original message, I came across the Engine property, AlwaysGotoCleanupOnFailure, which seems to be identical to changing the station option manually (via the dialog).

My question still remains: How would I change this (or another) station option, if I didn't find a direct property or method to change it?

Thanks
0 Kudos
Message 2 of 4
(4,139 Views)

Jan,

What Version of TestStand are you using?
I assume you are using the TestStand API.

You can get a reference to the StaionOptions Object from the Engine.

StationOptions Property (Read Only)

Syntax

Engine.StationOptions

Data Type

StationOptions

Purpose

Gets a reference to the StationOptions object.

Remarks

Use the StationOptions object to set preferences for your TestStand station. Station option settings affect all sequence editor and operator interface sessions that you run on your computer.

See Also

StationOptions

Check TestStand Help.

Usin this reference you can access most of the options present in the station options dialog.

I hope this helps.

Message 3 of 4
(4,130 Views)
Hi Antonio
 
Thanks. Unfortunately it seems TestStand 2.0.1 does not have this property available on the Engine.
 
We will probably be switching to TestStand 3.1 in the next 3-6 months, so then I will know where to look!
 
Thanks again
Jan
0 Kudos
Message 4 of 4
(4,120 Views)