The NewSubProperty() method should be used to create Property Objects that cannot have values. The expression below is an example of how to create a variable such as a Container or Object Reference.
Using this method, a variable called “Container1” has been added in Locals. You can see Locals.Container1 has been added at runtime in Figure 3 below.
Figure 3. Container 1 Displayed at Runtime
This isn’t as quick a solution for a variable that can have a value, but it is a great method for creating Containers, Object References, or any other type that does not have a value. You can also use this method or the SetVal method to populate items under programmatically created containers. You will notice, though, that any expressions referencing programmatically created variables, including containers, will not evaluate correctly, so make sure to use the method #NoValidation() around each expression if you have your Sequence Analyzer set to “Analyze File Before Executing”.
One thing to note about this method is that it also allows you to create custom typed variables. To do this, set the PropValType to “PropValType_NamedType” and specify the string of the type to reference in the typeNameParam parameter. For more information on this method, please reference the NewSubProperty Method topic in the NI TestStand Help.
However, you may have an existing type you want to temporarily copy into another location, and going through the effort of creating this variable for only certain situations would require normally unneeded alterations to your sequence file. This leads into the third method.