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: 

station globals variables teststand api C#

hi,

 

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

 

thanks

0 Kudos
Message 1 of 4
(645 Views)

Hi, brother,

         I think there is something you want in this post:

 

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

Message 2 of 4
(642 Views)

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
(617 Views)

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
(605 Views)