NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Programatical Access to Station Globals

Happy new year to all of you,Smiley Very Happy
 
mine starts with customizing my TestStand ... that's why I need to know, if there is an TS-API method to get a list of all available StationGlobals? Even more: is there a method for adding new ones programatically? I wan't to create a kind of "dynamic UI" using LV 7.1 /TS 3.1 (haven't had the guts to update yet) Smiley Wink that shows me a list of available data. Accessing Station Globals fron LabVIEW is no problem.
 
Cheers
 
Oli
0 Kudos
Message 1 of 5
(3,796 Views)

Hi,

Get a PropertyObject reference of the StationGlobals by calling SequenceContext.StationGlobals() method.

Then use PropertyObject.GetNumSubProperties("") to return the number of items in the StationGlobals.

Then you can use PropertyObject.GetNthSubPropertyName("", index, 0) within a loop to obtain the Name of each item in the StationGlobals. "Index in a non-zero value".

Use the TestStand Programmer Help for more details.

Hope this helps.

Regards

Ray Farmer

Regards
Ray Farmer
Message 2 of 5
(3,777 Views)

Hi Ray,

 

thank you very much. I'll try that!

 

Cheers

 

Oli

0 Kudos
Message 3 of 5
(3,749 Views)

Hi

I want to do that too, but what you have written, does not work. I attached a screenshot, where I expect NrOfElements to be 45 (I have 45 StationGlobals)

What do I do wrong?

0 Kudos
Message 4 of 5
(3,593 Views)

Hi,

What you return is the number of sub properties in the StationGlobals, i.e with the default StationGlobals there is one container called TS therefore the method returns 1.

If you are looking for the number of elements in an array, then first you have to find that property in the StationGlobals then you can find the size of the array.

If you know the name of the Property then use GetPropertyObject() with the lookup string set to the number of the property.

Using this reference you can then use GetDimensions to get the size of the array (multi dimensional) or if you know its a 1D array then use GetNumElements.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
Message 5 of 5
(3,580 Views)