<?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>Cluster Functions</name>
  <metadata>
  <md:version>**new**</md:version>
  <md:created>2004/06/21 11:18:00.756 GMT-5</md:created>
  <md:revised>2004/07/01 11:41:28.902 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>Cluster Functions</md:keyword>
    <md:keyword>cluster functions</md:keyword>
  </md:keywordlist>

  <md:abstract>In this section, you will learn about Cluster Functions.</md:abstract>
</metadata>
  
  <content>
    <para id="para1">
      Use the <code>Cluster</code> functions located on the
      <code>Functions&gt;&gt;All Functions&gt;&gt;Cluster</code> palette to
      create and manipulate clusters. Use the <code>Bundle</code>
      and <code>Bundle by Name</code> functions to assemble and
      manipulate clusters and use the <code>Unbundle</code> and
      <code>Unbundle by Name</code> functions to disassemble
      clusters.  </para>
    <para id="para2">
      You also can create the <code>Bundle</code>, <code>Bundle by
	Name</code>, <code>Unbundle</code>, and <code>Unbundle by
	Name</code> functions by right-clicking a cluster terminal on
      the block diagram and selecting <code>Cluster Palette</code>
      from the shortcut menu. The <code>Bundle</code> and
      <code>Unbundle</code> functions automatically contain the
      correct number of terminals. The <code>Bundle by Name</code>
      and <code>Unbundle by Name</code> functions appear with the
      first element in the cluster. Use the <code>Positioning</code>
      tool to resize the <code>Bundle by Name</code> and
      <code>Unbundle by Name</code> functions to show the other
      elements of the cluster.
    </para>
    <section id="section1">
      <name>Assembling Clusters</name>
      <para id="para3">
	Use the <code>Bundle</code> function to assemble a cluster
	from individual elements or to change the values of
	individual elements in an existing cluster without having to
	specify new values for all elements. Use the
	<code>Positioning</code> tool to resize the function or
	right-click an <code>element</code> input and select
	<code>Add Input</code> from the shortcut menu. If you wire a
	cluster to the <code>cluster</code> input, the number of
	inputs must match the number of elements in the input
	cluster.
      </para>
      <para id="para4">
	If you wire the <code>cluster</code> input, you can wire
	only the <code>elements</code> you want to change. For
	example, the cluster in <cnxn target="f1"/> contains three
	controls.
	<figure id="f1">
	  <media type="image/png" src="bundle.png"/>
	</figure>
      </para>
      <para id="para5">
	If you know the cluster order, you can use the
	<code>Bundle</code> function to change the
	<code>Command</code> value by wiring the elements shown in
	<cnxn target="f2"/>.
	<figure id="f2">
	  <media type="image/png" src="bundlebd.png"/>
	</figure>
      </para>
    </section>
    <section id="section2">
      <name>Replacing or Accessing Cluster Elements</name>
      <para id="para6">
	Use the <code>Bundle by Name</code> function to replace or
	access labeled elements of an existing cluster. <code>Bundle
	  by Name</code> works similarly to the <code>Bundle</code>
	function, but instead of referencing cluster elements by
	their cluster order, it references them by their owned
	labels. You can access only elements with owned labels. The
	number of inputs does not need to match the number of
	elements in <code>output cluster</code>.
      </para>
      <para id="para7">
	Use the <code>Operating</code> tool to click an input
	terminal and select an element from the pull-down menu. You
	also can right-click the input and select the element from
	the <code>Select Item</code> shortcut menu.
      </para>
      <para id="para8">
	In <cnxn target="f3"/>, you can use the <code>Bundle by
	  Name</code> function to change <code>Command</code> and
	<code>Function</code>.
	<figure id="f3">
	  <media type="image/png" src="bundbyname.png"/>
	</figure>
      </para>
      <para id="para9">
	Use the <code>Bundle by Name</code> function for data
	structures that might change during development. If you add
	a new element to the cluster or modify its order, you do not
	need to rewire the <code>Bundle by Name</code> function
	because the names still are valid.
      </para>
    </section>
    <section id="section3">
      <name>Disassembling CLusters</name>
      <para id="para10">
	Use the <code>Unbundle</code> function to split a cluster
	into its individual elements.
      </para>
      <para id="para11">
	Use the <code>Unbundle by Name</code> function to return the
	cluster elements whose names you specify. The number of
	output terminals does not depend on the number of elements
	in the input cluster.
      </para>
      <para id="para12">
	Use the <code>Operating</code> tool to click an output
	terminal and select an element from the pull-down menu. You
	also can right-click the output terminal and select the
	element from the <code>Select Item</code> shortcut menu.
      </para>
      <para id="para13">
	For example, if you use the <code>Unbundle</code> function
	with the cluster in <cnxn target="f4"/>, it has four output
	terminals that correspond to the four controls in the
	cluster. You must know the cluster order so you can associate
	the correct <code>Boolean</code> terminal of the unbundled
	cluster with the corresponding switch in the cluster. In <cnxn target="f4"/>, the elements are ordered from top to bottom
	starting with element <m:math><m:cn>0</m:cn></m:math>. If you
	use the <code>Unbundle by Name</code> function, you can have
	an arbitrary number of output terminals and access individual
	elements by name in any order.
	<figure id="f4">
	  <media type="image/png" src="unbundlebyname.png"/>
	</figure>
      </para>
    </section>
  </content>
  
</document>
