To download NI software, including the products shown below, visit ni.com/downloads.
This example creates a new TestStand data type programmatically using the TestStand API. The example allows you to choose whether to store the type in the MyTypes.ini type palette, or in the current sequence file.
This example shows how to access the TypeUsageList for a type palette file such as MyTypes.ini, or for the current Sequence file. The TypeUsageList is an object which contains all data and step types referenced by a particular file. The following methods are used by the example:
To access the TypeUsageList for a type palette
To access the TypeUsageList for a Sequence File
Once the example has stored the PropertyObjectFile reference to the destination for the type, it retrieves the TypeUsageList object from the property PropertyObjectFile.TypeUsageList. The TypeUsageList class provides methods and properties to operate type definitions.
The type object itself is created in the same way as any other PropertyObject, using the Engine.NewPropertyObject method and populates this container using the PropertyObject.SetValString and PropertyObject.SetValNumber methods with the PropOption_InsertIfMissnig flag to create the fields. The value you set for each field is the default value for the data type.
To insert the new PropertyObject into the Sequence File or Type Palette as a data type, use the TypeUsageList.InsertType method, then save the changes using the PropertyObjectFile.IncChangeCount and PropertyObjectFile.SaveIfModified.
Create Data Type Using TestStand API - TS2012.seq
TestStand 2012 SP1 or Compatible
Create Data Type Using TestStand API - TS3_1.seq
TestStand 3.1 or Compatible
TestStand API Reference: TypeUsageList
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.