Example Code

Arranging Output of Variable Container Children Array Using LabVIEW

Code and Documents

Attachment

Download All

Overview

Performs logic to re-arrange the Children[] array that follows the below naming convention so the array will list the variables in numeric order.

 

Description

When using the naming convention of Variable_Name01, Variable_Name02, ...Variable_Name10 for network shared variables and the Variable Container property node to access the array of the Children[] of a library, the first ten variables will always be an the last elements of the array. The output does not equal the variable listing in the Project Explorer. This VI performs the logic needed to arrange the Children[] array so the elements will be in numeric order.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Determine if the Children[] array size is greater than or equal ten. Use this output as input for the conditional terminal of a case structure.
  2. If the array size is False, no re-arrangement is needed. Wire the array through the case structure.
  3. If the array size is True, use the Split 1D Array to split the last ten elements of the Children[] array. Then, insert the first elements of the array into the array containing the last ten elements of the original Children[] array.

 

Additional Information or Reference

 

ArrayOrder.png

 

**This document has been updated to meet the current required format for the NI Code Exchange.**

LabVIEW Product Marketing Engineer
National Instruments

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