Accessing Arrays Using API - LabVIEW
- Updated2025-07-23
- 2 minute(s) read
Purpose
This example demonstrates how to use the TestStand API from a LabVIEW code module to access a one-dimensional array, two-dimensional array, and an array of strings in TestStand.
Example File Location
<TestStand Public>\Examples\TestStand API\Accessing Arrays Using API\LabVIEW\Accessing Arrays Using API.seq
Highlighted Features
- LabVIEW Adapter
- TestStand API
Major API
- PropertyObject.NewSubProperty
- PropertyObject.SetValVariant
Prerequisites
You must have the LabVIEW development system installed and you must configure the LabVIEW Adapter to use the LabVIEW development system.
How to Use This Example
Open the following example VIs, located in the <TestStand Public>\Examples\TestStand API\Accessing Arrays Using API\LabVIEW directory, and review the TestStand API calls used to get and set the TestStand local variables:
- FillLocalArray.vi—Demonstrates how to use the TestStand API from LabVIEW to populate an array stored in a TestStand local variable.
- AccessArray.vi—Demonstrates how to use the TestStand API from LabVIEW to read an array stored in a TestStand local variable and display a graph of the data.
- Create2DArray.vi—Demonstrates how to use the TestStand API from LabVIEW to dynamically create and populate a two-dimensional array stored in a TestStand local variable.
- Access2DArray.vi—Demonstrates how to use the TestStand API from LabVIEW to read a two-dimensional array stored in a TestStand local variable and display a graph of the data.
- SetStringArray.vi—Demonstrates how to use the TestStand API from LabVIEW to populate a string array stored in a TestStand local variable.
- GetStringArray.vi—Demonstrates how to use the TestStand API from LabVIEW to read a string array stored in a TestStand local variable and display the strings in the VI.
Complete the following steps to review how TestStand calls the VIs, review the created local variables, and review the parameters passed to and from the VIs.
- Open the AccessingArrays.seq example sequence file. On the Variables pane, the NumericArray and StringArray local variables have been created, but do not contain any data.
- On the Steps pane, select an Action step.
- On the Step Settings pane, review the settings for the Action step. The step does not pass local variables to or return local variables from the VI.
- Select Execute»Single Pass to run the sequence. The VIs populate the local variables with data, and LabVIEW accesses and displays the data.