NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

C# and ActiveX TestStand (Station Globales)

hi,
 
i use Visual Studio 2005 C# and TestStand 3.5, and i would like to know how i can create a Station Globales ?
 
I arrive to read the station globales with the Engine or the SequenceContext, but not create it.
0 Kudos
Message 1 of 13
(6,932 Views)

Hi,

If you are able to read the Station Globals, then by using the SetVal method instead of the GetVal method you should beable to set the value.

If the Station Global doesn't exist to start with, then use the value of 1 for the options parameter.

Maybe you could post your example code.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 2 of 13
(6,908 Views)

Thank for you answer, but I find the instruction.

 

For create a global variable en TestStand with AxtiveX (C#), We must use "NewSubProperty" inside the class "Globals"

This instruction have some parameters =

1 = string, it's the name you want for the new global variable without "StationGlobals" item .

                                       (Ex : MyVariable, NOT StationGlobals.MyVariable)

2 = PropertyValueType, it's witch type (Number, String, Boolean, ... )

3 = Bool, it's a Array or not.

4 = String, I don't know, but i put nothing ("")

5 = Int, it's the Option (I put 0 also).

With that, you can creat a Global Variable inside TestSTand.

0 Kudos
Message 3 of 13
(6,888 Views)

Hi,

That's great you found an answer.

But equally you could have used the method

PropertyObject.SetValBoolean ("<variable name>", 1, newValue) and using StationGlobals as the reference.

eg PropertyObject.SetValBoolean("MyBool", 1, True)

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 4 of 13
(6,886 Views)

In my C# project, I have access to the testand active X functionality

NationalInstruments.TestStand.Interop.API.

This contains many things.

Is there some documentation somewhere ?

For example, I am unable to guess which object contains methods to access station globals.

0 Kudos
Message 5 of 13
(6,644 Views)
Hi,
I believe that you are talking about the pdf document attached.
Regards
Manuel R
AE dans une autre vie
0 Kudos
Message 6 of 13
(6,565 Views)
Look in Start Menu>>Programs>>National Instruments>>TestStand x.x>>Online Help>>TestStand Help
 
Type the name of the class, method, or event you are interested in into the index.
 
Alternatively, browse the contents starting at TestStand API Reference Help.
 
The api poster attached earlier in this thread is a good way to get a higher level picture of what is available.

Message Edited by James Grey on 05-24-2007 10:34 AM

0 Kudos
Message 7 of 13
(6,563 Views)
... if you type Globals into the index, it should lead to the Engine.Globals property, which returns the station globals.
0 Kudos
Message 8 of 13
(6,555 Views)

Using C# to access stationglobals ...

 

 

String foobar = axApplicationMgr.GetEngine().Globals.GetValString("StationGlobals.OIStuff.foobar", PropertyOptions.PropOption_CaseInsensitive);

 

but getting the following error:

 

Unknown variable or property name 'StationGlobals'.

 

Is this a problem with when I load my model sequence or my model seq is not finding the propery file?

0 Kudos
Message 9 of 13
(5,429 Views)

Do not use the full lookup string "StationGlobals.OIStuff.foobar"

 

Use "OIStuff.foobar" only as you are using a reference to StationGlobals. You would use the full lookup if you were using the SequenceContext reference.

 

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 10 of 13
(5,406 Views)