Example Code

Comparing the Contents of TestStand Containers

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • Teststand

Code and Documents

Attachment

Description

Overview

This example compares two containers of the same custom data type and returns all of the differences between them.

Description

TestStand has the ability to check if two containers are equal by using the '==' operator within an expression.  However, this does not indicate what fields are different between the containers.  The attached sequence and LabVIEW VI take two variables of the same custom data type, parses through all sub-elements of each variable, and returns the names of all sub-elements that are different.  If one of the sub-elements is an array, the VI first checks if the arrays in each variable are the same size, returns the name of the array if they are not, and checks each individual element if they are.

Hardware and Software Requirements

Comparing Containers - TS2019.zip

TestStand 2019 or Compatible

LabVIEW 2020 or Compatible

 

Comparing Containers - TS2016 - NI Verified.zip

TestStand 2016 or Compatible

LabVIEW 2016 or Compatible

 

Steps to Implement or Execute Code

  1. Run the sequence using Execute » Single Pass
  2. Observe that the differences between the containers are shown in the test report

 

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Contributors