Example Code

Unbundling an Array of Clusters

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

  • LabVIEW

Code and Documents

Attachment

Overview

In this example, an array of clusters is broken down into its elements with each iteration of the for-loop.

 

Description

In this  example, an array of clusters is broken down into its elements with each iteration of the for-loop. Within the for-loop, the isolated cluster is broken down into its data types. Outside of the for-loop,arrays of each individual elements of the same data type are created by auto-indexed tunnels. These are then displayed as array indicators and all of the numeric arrays are displayed as graphs.

 

Using the VI:

  1. Start off with an array of clusters. In the original example, we initialized 3 clusters to default.
  2. Auto-index the input array on the for loop, each of the cluster elements is output. 
  3. Unbundle the cluster such that each element of the cluster is isolated.
  4. Convert the boolean from a true/false data type to a 1/0 numeric data type.
  5. Use auto-indexed tunnels to create arrays of each individual elements of the cluster. 
  6. Display the arrays as array indicators as well as graphs.

Requirements:

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Input the values of Array of Clusters.
  2. Run the VI  and the Graph and corresponding Array controls will display the values of elements. 

 

Additional Information or References

Front Panel

11.PNG

 

VI Snippet

3.png

 

 

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

DAQ Product Marketing Engineer
National Instruments

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

Comments
peter_smith
Member
Member
on

Hi,

Why do you use the index array function? Autoindexing input on the for loop would do the job as well.

Why do you need the build array functions for the arrays already created by the auto-indexed outputs on the for loop?

Peter