PropertyObject Attributes
- Updated2025-07-23
- 4 minute(s) read
You can create attributes for TestStand PropertyObjects, such as variables, steps, module parameters, and type definitions. Use attributes to store additional information about a PropertyObject within a sequence file or type palette file, such as the author of a sequence. Every PropertyObject includes an Attributes property, which is an unstructured container that stores arbitrary data.
Use container subproperties under the Attributes property to serve as attribute namespaces. NI recommends that you create a uniquely named container or hierarchy of containers under which you store attribute variables to avoid name conflicts, such as CompanyName.AttributeCategory.Attribute. The name NI is reserved at the root level for National Instruments.
Editing Attributes
Select Advanced»Edit Attributes from the Sequences pane context menu to launch the Attributes dialog box, in which you can create and edit attributes for the sequence. When the sequence includes attributes, you can click the Edit Attributes button in the Sequence column of the Sequences pane to launch the Attributes dialog box.
Right-click a PropertyObject on the Variables pane and select Advanced»Edit Attributes from the context menu to launch the PropertyObject Attributes dialog box, in which you can create and edit attributes. PropertyObjects with attributes include an Edit Attributes button in the Name column of the Variables pane.
Click the Edit Attributes button on the General panel of the Properties tab on the Step Settings pane to launch the Attributes dialog box for steps. Steps with attributes include the word Attributes in the step description.
Right-click a parameter on the Module tab of the Step Settings pane in the sequence editor or in the Specify Module dialog box in user interfaces and select Edit Attributes from the context menu to launch the Attributes dialog box for a module parameter. Parameters with attributes include an Edit Attributes button in the Name column of the Parameters Table. When editing a LabVIEW or .NET code module, you can edit attributes for fields of containers and elements of arrays. TestStand associates parameter attributes with the code module parameter, which TestStand stores with the step configuration information, not with the parameter value that TestStand passes to the code module.
Managing Attributes
Right-click a type in the Types window of the sequence editor, select Properties from the context menu, click the Advanced button on the General tab of the Properties dialog box, and select Attributes to launch the Attributes dialog box for a type definition. When editing the attributes of a type definition, you can edit both attributes and type attributes. For a type definition, attributes determine the default values of the attributes of type instances. Type attributes are attributes for the type definition and do not exist for type instances.
Enable the Include Attributes option on the Contents tab of the Report Options dialog box or enable the PropFlags_IncludeInReport flag on both an attribute and on the PropertyObject object that owns the top-level attribute to include attribute information in reports. Typically, a report generator does not recursively apply the PropFlags_IncludeInReport flag from a property to its attributes.
The default TestStand database schemas do not log attribute values for result properties. You can customize a database logging schema to log attributes.
Enable the Attributes option on the Filter tab of the Find/Replace in Files dialog box and in the Find/Replace dialog box to include the attributes and type attributes of variables and properties in search results.
The TestStand File Diff and Merge utility detects and merges attribute differences. Right-click an item and select Advanced»Edit Attributes from the context menu or click the Edit Attributes button in the Name column of the utility to launch the related Attributes dialog box. When you right-click an item and select Replace Item Values in File <filename> from the context menu, TestStand also copies attribute values.
You can specify an attribute or type attribute using a lookup string. Use Attributes in a lookup string to specify the attributes of the property object and use TypeAttributes to specify the type attributes of the property object. For example, the following lookup string accesses an attribute of a local variable from a sequence:
"Locals.Foo.Attributes.AttributeNamespace.Attribute1"
- If a property object has a subproperty named Attributes or TypeAttributes, the subproperty takes precedence over the attributes or type attributes in a lookup string. As a result, some TestStand features, such as accessing attributes using lookup strings, undo, and find and replace, do not support attributes if the parent property object also has a subproperty named Attributes. NI does not recommend using attributes and a subproperty named Attributes on the same property object. You can convert the subproperty to attributes or rename the subproperty.
- You cannot specify an attribute or type attribute with a lookup string you pass to a method in the TestStand API if you also use the PropOption_InsertIfMissing option in the method call. Using the PropOption_InsertIfMissing option with a lookup string that contains Attributes or TypeAttributes causes methods in the TestStand API to create a subproperty for Attributes or TypeAttributes.