Use the techniques in this section to minimize cases where type conflicts are handled incorrectly, and prevent unwanted type version propagation.
Maintain the Type Version Field
TestStand types use the version field to determine which version of a type is the most recent. If the most recent version of the type is loaded in memory, and you load a sequence file which uses an older version of the type, TestStand can automatically update the file to use the newer type version, depending on station settings. By default, TestStand automatically resolves any conflicts that do not update types in type palette files.
To help ensure that type versions are updated, TestStand tracks types you edit using the Modified type flag. If you save a type with this flag enabled, TestStand displays a warning indicating that changes have been made.
TestStand provides a warning when you make modifications to types to ensure that the changes are intended before saving them.
You should choose to increment the type versions in this case, which will ensure that the changes you make are propagated to other files which reference the type when they are loaded in TestStand. However, you should not select the option to save the settings and not prompt, since this warning is a useful tool to prevent unwanted changes to types. If you are unsure of the change, cancelling the dialog will cancel the save operation, allowing you to inspect the type and ensure the changes are valid.
Configuring Automatic Type Conflict Resolution
In some cases, TestStand can automatically determine which type should be loaded in the case of a type conflict. Automatic type conflict resolution is only possible when these conditions are met:
- The type versions are not the same for the two types
- The “modified” flag is not set for either type.
TestStand provides the Allow Automatic Type Conflict Resolution setting to allow you to determine when TestStand will resolve these conflicts automatically. To access this setting:
- In the sequence editor, select Configure » Station Options
- Select the File tab
TestStand allows you to configure when type conflicts are handled automatically, and when the developer is prompted to choose which type version to keep in memory.
In most cases, you should use the default value of this setting, which is to only prompt if a type palette file will be modified. This setting will allow TestStand to automatically choose the type with the higher version, as long as the lower version type is not stored in a type palette file. This setting helps to ensure that the type conflict prompt only appears when a potential for unwanted type propagation occurs. It will also ensure that harmless conflicts, such as loading an older sequence file with older NI types in a new version of TestStand, are resolved automatically do not require the user to make a decision.
For example, developer A updates step type “RunCalibration”, a type stored in the company type palette file, Company_types.ini. After discussing this with the type palette file owner, they save the change to the type, and select to increment the type version to 220.127.116.11. They then save the updated type palette in the source code control repository. Another developer B later syncs to the repository, obtaining the version of Company_types.ini with the updated type. They then open TestStand, and load a sequence file which references the type. Since the sequence file is still referencing the previous type version, the reference in the sequence file is updated automatically, which is the desired behavior.
However, a third developer C also has a sequence file which uses the “RunCalibration” step, and they inadvertently make a separate change to the “RunCalibration” step type without consulting the type owner, updating their local instance to version 18.104.22.168. If this developer syncs the company type palette file, then loads their sequence file in TestStand, TestStand will prompt them to resolve the type conflict, since the type will be modified if the newer version is used. Developer C will know that the type palette file was updated and will either consult the type palette owner or revert the local changes they made to the type.
If TestStand cannot automatically resolve the type conflict, you will be prompted to decide on how to resolve the conflict:
Use the Type Conflict In File dialog box to resolve type conflicts that cannot be resolved automatically
To resolve the type conflict, you can choose to load one of the two types, rename one of the types, or cancel opening the file. When you select the version to use, TestStand converts all instances in memory to match the type you selected. If you rename one of the types, TestStand modifies the instances in memory to refer to the loaded type, and the instances in the new file to refer to the type in the file.
Setting Type Specific Conflict Resolution Settings
In a tightly controlled environment, you may be tempted to select the Always prompt the user to resolve the conflict option to disable automatic type conflict resolution in all cases. This will prompt the user to resolve the conflict in any case a type conflict is detected, allowing you to have full control over which types are loaded. However, this adds additional decision making to the development process, which can cause developers to make incorrect decisions and quickly dismiss the many dialogs they will encounter.
A better approach is to use the type specific setting for types which require strict control. Located in the Version tab of the Type settings, you can specify whether the type can be resolved automatically. Using this setting prevents unnecessary user interaction for low-risk type conflicts, such as loading an older sequence file with older NI types in a new version of TestStand, while still providing full control over tightly controlled custom types.
Disable automatic type conflict resolution for specific types that require more tight control
Avoiding Unwanted Type Version Propagation to Previous Versions of TestStand
Because you can save sequence files to previous versions of TestStand but some types might not run correctly on previous versions of TestStand, you can specify the earliest version of TestStand that can run a type. Enable the Set Earliest TestStand Version that can Use this Type option on the Version tab of the Type Properties dialog box and set the earliest version to the current version of TestStand. This will prevent the current version of a type from being used in or accidentally propagated to an earlier TestStand version.
If a type needs to be available in previous TestStand versions, create different versions of the type to run in different versions of TestStand. When you save a sequence for a previous version of TestStand, TestStand searches a set of compatibility directories to find the type version that is compatible with the previous version for which you want to save the sequence file. TestStand saves the types from the type palette files in the <TestStand Public>\Components\Compatibility\<version number> and <TestStand Public>\Components\Compatibility\<version number> directories with the sequence file. You can place type palette files from earlier versions of TestStand in the <TestStand Public>\Components\Compatibility\<version number> directory to ensure that TestStand saves the correct version of the types with the sequence file.