NI TestStand

Showing results for 
Search instead for 
Did you mean: 

station globals variables teststand api C#



how can I get all station globals variables teststand api C# ?



0 Kudos
Message 1 of 4

Hi, brother,

         I think there is something you want in this post:


         C# 和 ActiveX TestStand (Station Globales) - NI 社区

Message 2 of 4

Hi brother


I have already seen it but I did not find how to get all the Station Golobals variables dynamically without knowing their names before ?

0 Kudos
Message 3 of 4

I think you can try this:

PropertyObject globals = engine.Globals;
string sLastUser = globals.GetValString("TS.LastUserName", 0);
Console.WriteLine($"the last user is: {sLastUser}");


It gets a property object containing all global variable information, then you can do some things, such as reading the value of a global variable


But I don't know how to get all the variables in the object

Message 4 of 4