<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE document PUBLIC "-//CNX//DTD CNXML 0.5 plus MathML//EN" "http://cnx.rice.edu/cnxml/0.5/DTD/cnxml_mathml.dtd">
<document xmlns="http://cnx.rice.edu/cnxml" xmlns:md="http://cnx.rice.edu/mdml/0.4" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:bib="http://bibtexml.sf.net/" id="None">
  <name>Clusters</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/18 15:27:04.050 GMT-5</md:created>
  <md:revised>2004/07/01 11:40:48.640 GMT-5</md:revised>
  <md:authorlist>
      <md:author id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:author>
  </md:authorlist>

  <md:maintainerlist>
    <md:maintainer id="lizzardg">
      <md:firstname>Elizabeth</md:firstname>
      
      <md:surname>Gregory</md:surname>
      <md:email>lizzardg@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="mshiralkar05">
      <md:firstname>Malan</md:firstname>
      
      <md:surname>Shiralkar</md:surname>
      <md:email>mshiralkar05@hotmail.com</md:email>
    </md:maintainer>
    <md:maintainer id="harika">
      <md:firstname>Harika</md:firstname>
      
      <md:surname>Basana</md:surname>
      <md:email>ilsai@rice.edu</md:email>
    </md:maintainer>
    <md:maintainer id="NationalInstruments">
      <md:firstname>National</md:firstname>
      
      <md:surname>Instruments</md:surname>
      <md:email>certification@ni.com</md:email>
    </md:maintainer>
  </md:maintainerlist>
  
  <md:keywordlist>
    <md:keyword>National Instruments</md:keyword>
    <md:keyword>LabVIEW</md:keyword>
    <md:keyword>Clusters</md:keyword>
    <md:keyword>clusters</md:keyword>
  </md:keywordlist>

  <md:abstract>In this section, you will learn about clusters.</md:abstract>
</metadata>
  
  <content>
      <para id="para1">
	<term>Clusters</term> group data elements of mixed types, such
	as a bundle of wires, as in a telephone cable, where each wire
	in the cable represents a different element of the cluster. A
	cluster is similar to a record or a struct in text-based
	programming languages.
      </para>
      <para id="para2">
	Bundling several data elements into clusters eliminates wire
	clutter on the block diagram and reduces the number of
	connector pane terminals that subVIs need. The connector pane
	has, at most, <m:math><m:cn>28</m:cn></m:math> terminals. If a
	front panel contains more than
	<m:math><m:cn>28</m:cn></m:math> controls and indicators that
	you want to use programmatically, group some of them into a
	cluster and assign the cluster to a terminal on the connector
	pane. Like an array, a cluster is either a control or an
	indicator. A cluster cannot contain a mixture of controls and
	indicators.
      </para>
      <para id="para3">
	Although cluster and array elements are both ordered, you must
	unbundle all cluster elements at once rather than index one
	element at a time. You also can use the <code>Unbundle By
	Name</code> function to access specific cluster elements.
      </para>
      <section id="section1">
	<name>Creating Cluster Controls and Indicators</name>
	<para id="para4">
	  To create a <code>cluster</code> control or indicator,
	  select a cluster on the <code>Controls&gt;&gt;All Controls&gt;&gt;Array
	  &amp; Cluster</code> palette, place it on the front panel,
	  and drag controls or indicators into the cluster
	  shell. Resize the <code>cluster</code> shell by dragging the
	  cursor while you place the <code>cluster</code> shell.
	</para>
	<para id="para5">
	  The example in <cnxn target="f1"/> is a cluster of three
	  controls.
	  <figure id="f1">
	    <media type="image/png" src="cluster.png"/>
	  </figure>
	</para>
      </section>
      <section id="section2">
	<name>Creating Cluster Constants</name>
	<para id="para6">
	  Create a <code>cluster constant</code> on the block diagram
	  by selecting a <code>cluster constant</code> on the
	  <code>Cluster</code> palette, placing it on the block
	  diagram, and dragging a constant into the
	  <code>cluster</code> shell.
	</para>
	<para id="para7">
	  If you have a <code>cluster</code> control or indicator on
	  the front panel and you want to create a <code>cluster
	  constant</code> containing the same elements on the block
	  diagram, you can either drag that cluster from the front
	  panel to the block diagram or right-click the cluster on the
	  front panel and select <code>Create&gt;&gt;Constant</code> from
	  the shortcut menu.
	</para>
      </section>
      <section id="section3">
	<name>Cluster Order</name>
	<para id="para8">
	  Cluster elements have a logical order unrelated to their
	  position in the shell. The first object you place in the
	  cluster is element <m:math><m:cn>0</m:cn></m:math>, the
	  second is element <m:math><m:cn>1</m:cn></m:math>, and so
	  on. If you delete an element, the order adjusts
	  automatically.
	</para>
	<para id="para9">
	  The cluster order determines the order in which the elements
	  appear as terminals on the <code>Bundle</code> and
	  <code>Unbundle</code> functions on the block diagram.
	</para>
	<para id="para10">
	  You can view and modify the cluster order by right-clicking
	  the cluster border and selecting <code>Reorder Controls In
	  Cluster</code> from the shortcut menu. The toolbar and
	  cluster change, as shown in <cnxn target="f2"/>.
	</para>
	<figure id="f2">
	  <media type="image/png" src="clusord.png"/>
	  <caption>
	    1. Confirm Button,
	    2. Cancel Button,
	    3. Cluster Order Cursor,
	    4. Current Order,
	    5. New Order
	  </caption>
	</figure>
	<para id="para11">
	  The white box on each element shows its current place in the
	  cluster order. The black box shows the new place in the
	  order for an element. To set the order of a cluster element,
	  type the new order number in the <code>Click to set
	  to</code> text box and click the element. The cluster order
	  of the element changes, and the cluster order of other
	  elements adjusts. Save the changes by clicking the
	  <code>Confirm</code> button on the toolbar. Revert to the
	  original order by clicking the <code>Cancel</code> button.
	</para>
	<para id="para12">
	  Corresponding elements, determined by the cluster order,
	  must have compatible data types. For example, in one
	  cluster, element <m:math><m:cn>0</m:cn></m:math> is a
	  numeric control, and element <m:math><m:cn>1</m:cn></m:math>
	  is a string control. In a second cluster, element
	  <m:math><m:cn>0</m:cn></m:math> is a numeric indicator, and
	  element <m:math> <m:cn>1</m:cn></m:math> is a string
	  indicator. The cluster control correctly wires to the
	  cluster indicator.
	</para>
	<para id="para13">
	  However, if you change the cluster order of the indicator so
	  the string is element <m:math><m:cn>0</m:cn></m:math>, and
	  the numeric is element <m:math><m:cn>1</m:cn></m:math>, the
	  wire from the cluster control to the cluster indicator
	  appears broken, indicating that the data types do not match.
	</para>
      </section>
  </content>
  
</document>
