Creating a User-Defined Test VI
- Updated2025-11-07
- 2 minute(s) read
-
Create a user-defined test VI from the User-Defined Test
Template.vit file in one of the following ways:
- Select to display the New dialog box and select to open the User-Defined Test Template.vit file. You also can locate this file in the labview\templates\UnitTestFramework directory.
- Create a test from a user-defined test VI. The test and user-defined test VI appear in the Project Explorer window. Right-click the user-defined test VI and select Open.
- Modify the VI to define your own test. Keep in mind the following requirements
for the user-defined test VI:
- Do not modify the Unit Test Framework Result indicator name or cluster elements.
- The Unit Test Framework Result indicator contains the following
three cluster elements:
Element Name Data Type Notes Required time elapsed [ms] Numeric indicator Time in milliseconds. No result (test) Enum Enum values must be Passed, Failed, Error, Skipped, and Not Processed. Yes result (parameters) Array of cluster Each array is a cluster of comparison results between the expected and resulting values. No Note You must include data from this element in the Unit Test Framework Result indicator. - The Unit Test Framework Result indicator must be connected to the connector pane.
- Wire the result of your test to the result (test) element.
- Optional: For advanced test VIs, wire the results of your tests to the time elapsed [ms] and results (parameters) elements.
- Select to save this user-defined test VI in an easily accessible
location.Note If you rename a user-defined test VI that you create from the shortcut menu, you must specify the new User-defined test VI file path on the Configuration page of the Test Properties dialog box.