09-27-2011 03:02 PM
When attempting to access a FileGlobals variable with the following line of code in a C# GUI, I encounter an "Unknown variable or property name" exception.
double tm2 = axExecutionViewMgr.Execution.AsProperteryObject().GetValNumber("FileGlobals.TM2", 0);
The exception can be duplicated using the "Simple Test Executive Operator Interface Example" supplied with TestStand 2010 SP1, add a Windows Form button, and a button_Click event handler with the code above in it; Then run a TestStand sequence from the interface that contains a FileGlobals.TM2 variable and click the button.
Solved! Go to Solution.
09-27-2011 03:19 PM
File globals are per sequence file. You need to do this instead:
PropertyObject mySequencesFileGlobals = axExecutionViewMgr.Execution.GetFileGlobals(mySequenceFile);
double myval = mySequencesFileGlobals.GetValNumber("TM2", 0);
See the API help for more details for these APIs.
Hope this helps,
-Doug