NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StationGlobals non volatil changes, API

Solved!
Go to solution

Hi, 

I'm trying to modify the value of some StationGlobals values through the API, but the changes are made only during execution and i'm not able to store permanent changes...

 

I'm using this lines to made the change

 

PropertyObject myGlobals = runtime.AppMgr.GetEngine().Globals;
myGlobals.SetValString(sLookup, 0, tbVariableValue.Text);

 

Is there a method to save the changes permanently?

0 Kudos
Message 1 of 3
(271 Views)

 

IIRC, when using the API, you need to save StationGlobals.ini. Don‘t forget to increase the changecount before doing so.

0 Kudos
Message 2 of 3
(254 Views)
Solution
Accepted by topic author GenerQ

Try this: https://www.ni.com/docs/en-US/bundle/teststand-api-reference/page/teststand-api-ref/propertyobjectfi... Engine.CommitGlobalsToDisk()

and this: https://www.ni.com/docs/en-US/bundle/teststand-api-reference/page/teststand-api-ref/engine_commitglo... PropertyObjectFile.IncChangeCount()

 

Michał Bieńkowski
CLA, CTA, CPI

  1. Did someone devote their time to help solve your problem? Appreciate it and give kudos.
  2. Problem solved? Accept as a solution so that others can find it faster in the future.
  3. Contribute to the development of TestStand by voting on the TestStand Idea Exchange.
Message 3 of 3
(234 Views)