Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

How Can I Easily Create a Cluster with a lot of Elements?

Primary Software: LabVIEW Development Systems>>LabVIEW Professional Development System
Primary Software Version: 8.6
Primary Software Fixed Version: N/A
Secondary Software: LabVIEW Development Systems>>LabVIEW Base Package, LabVIEW Development Systems>>LabVIEW Full Development System

Problem:
How can I easily create a cluster with many elements? Do I have to add each element manually or is there a way to programatically create a big cluster?

Solution:
You can easily create a single cluster with as many elements as you want by first creating an array of the datatype you want the cluster to have. Once you have your array (it can be a constant or a control), place the Array to Cluster VI from the Cluster, Class, & Variant palette in the block diagram and connect the array. Right-click the VI and select Cluster Size... and select the number of elements you want the cluster to have.

Create an indicator from the Array to Cluster VI. This indicator will be a cluster containing as many elements as you selected of the same datatype of the array. You can then convert this indicator to a control or constant and use it as you need.

This process can be repeated with different datatypes and the multiple clusters created can be bundled into a single cluster containing everything that is required.



Related Links:
KnowledgeBase 43GBTHSN: Passing an Array of Clusters From LabVIEW to a DLL
KnowledgeBase 45AE6784: Modifying Cluster Properties in Arrays

Attachments:





Report Date: 08/18/2008
Last Updated: 08/19/2008
Document ID: 4OHCQ6EQ

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit