04-25-2011 03:39 PM
Hi,
How to add a container object in a station globals
04-25-2011 09:42 PM
In TestStand go to View>>Station Globals (or click Ctr->G).
Right click in the Station Globals window. Select Insert Station Global>>Container..
Attached is an image.
Hope this helps,
04-26-2011 03:51 AM
Thank you for your response ?
But it is not what I want to do ! .to summarize I want to add a container object in a station global in a vb.net application.
I managed to add a string and a number with PropertyObject.SetValNumber and PropertyObject.SetValString but I failed to add a container object because I dont find a suitable Property?
04-26-2011 07:09 AM
Hi radlou,
This might be what you're looking for:
PropertyObject.NewSubProperty ( lookupString, ValueType, asArray, typeNameParam, options)
Creates a new subproperty with the name the lookupString parameter specifies.
lookupString As String
[In] Pass the lookup string for the new subproperty to be created. If you pass a lookup string with multiple levels (such as "x.y.z"), this method creates all of the necessary intermediate container objects. Refer to lookup string for more information about the strings you can use.
ValueType As PropertyValueTypes
[In] Pass the type of value you want the new subproperty to store.
asArray As Boolean
[In] Pass True to make the new subproperty an array whose elements are of the type you specify in valueType.
typeNameParam As String
[In] Pass the name of an existing type if you want to create the new subproperty as an instance of a named type. Otherwise, pass an empty string. If you pass a type name, you must pass PropValType_NamedType for the ValueType parameter. Refer to NamedPropertyTypes for a list of built-in named types.
options As Long
[In] Pass 0 to specify the default behavior, or pass one or more PropertyOptions constants. Use the bitwise-OR operator to specify multiple options. You do not need to pass the InsertIfMissing option to create the new subproperty. Pass DoNothingIfExists if you want the method to not report an error if the subproperty already exists.
04-26-2011 11:35 AM
Hi Radlou,
In fact with TestStand you can create programmatically custom datatype, included Containters.
For this purpose you can use the NewPropertyObject from the NI-TestStand API server.
Also, i invite you to read the information presented from the following internet link, and to launch the corresponding sequence in order to understand the process:
http://zone.ni.com/devzone/cda/epd/p/id/3606
Best regards,
Rémi D.
National Instruments France
04-27-2011 01:29 AM
Hi Radlou, Hi Remi
This example is only interresting if you are using NamesTypes !
NamedTypes are pretty well there are a lot of advantages, especailly if you are
using them in arrays. But there is one behavior that should be mentioned !
If you store them on INI-File you have to distribute this files !!
And often you have some version. And if your are not famous with TS
i will say: "Welcome to the Type Conflict Hell"
My opinion is: "Avoiding Names Types if there is no need".
I am interesting what other members and NI will think about this.
Regards
Juergen
In this thread there is an example without: