05-21-2024 11:30 AM
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?
Solved! Go to Solution.
05-21-2024 03:08 PM
IIRC, when using the API, you need to save StationGlobals.ini. Don‘t forget to increase the changecount before doing so.
05-24-2024 12:45 PM - edited 05-24-2024 12:47 PM
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()