Operate on Teststand Binary Strings in LabVIEW With the Teststand API

Updated Oct 13, 2023

Environment

Software

  • TestStand
  • LabVIEW

This article discusses how to read from and write to Teststand binary string variables using the Teststand API in LabVIEW. The steps presented in this article demonstrate how to pass binary string data between LabVIEW and Teststand using the Teststand LabVIEW adapter.

  1. Ensure that your system is set up correctly
  2. Read the binary string value from Teststand in LabVIEW 
    • Use the "AsPropertyObject" invoke node to convert the "Sequence Context In" reference to a property object reference type.
    • Use the "GetValBinary" invoke node to retrieve a variant containing the binary string data for the variable specified by "lookup string".
    • Use "Variant to Data.vi" to convert the variant to an array of U8 (byte array). This array is the numeric binary representation of the binary string.
    • Use "byte array to string.vi" to convert the byte array into a binary string.
  3. Operate on the binary string in LabVIEW
    • You can operate on the binary string however you would like. This section is left blank in the code snippet below to minimize confusion.
  4. Write the new binary string value to the Teststand Binary String variable.
  5. Configure the connector pane of the VI to prepare for calling the VI from Teststand. See Building the Connector Pane or more information.
  6. Call the VI in Teststand using one of the LabVIEW adapters.

The code snippet below is an example final result generated by following the steps above.