Skip to content Skip to navigation

Connexions

You are here: Home » Content » Cluster Functions

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

      What are tags? tag icon

      Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

    • External bookmarks
  • E-mail the author
  • Rate this module (How does the rating system work?)

    Rating system

    Ratings

    Ratings allow you to judge the quality of modules. If other users have ranked the module then its average rating is displayed below. Ratings are calculated on a scale from one star (Poor) to five stars (Excellent).

    How to rate a module

    Hover over the star that corresponds to the rating you wish to assign. Click on the star to add your rating. Your rating should be based on the quality of the content. You must have an account and be logged in to rate content.

    (0 ratings)

Lenses

What is a lens?

Definition of a lens

Lenses

A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

What is in a lens?

Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

Who can create a lens?

Any individual Connexions member, a community, or a respected organization.

What are tags? tag icon

Tags are descriptors added by lens makers to help label content, attaching a vocabulary that is meaningful in the context of the lens.

This content is ...

Affiliated with (What does "Affiliated with" mean?)

This content is either by members of the organizations listed or about topics related to the organizations listed. Click each link to see a list of all content affiliated with the organization.
  • National Instruments display tagshide tags

    This module is included in aLens by: National InstrumentsAs a part of collection:"LabVIEW Graphical Programming Course"

    Comments:

    "A full introductory course on programming with LabVIEW."

    Click the "National Instruments" link to see all content affiliated with them.

    Click the tag icon tag icon to display tags associated with this content.

Recently Viewed

This feature requires Javascript to be enabled.

Tags

(What is a tag?)

These tags come from the endorsement, affiliation, and other lenses that include this content.

Cluster Functions

Module by: National Instruments

Summary: In this section, you will learn about Cluster Functions.

Note: Your browser may not currently support MathML. See our browser support page for additional details. You can always view the correct math in the PDF version.

Use the Cluster functions located on the Functions>>All Functions>>Cluster palette to create and manipulate clusters. Use the Bundle and Bundle by Name functions to assemble and manipulate clusters and use the Unbundle and Unbundle by Name functions to disassemble clusters.

You also can create the Bundle, Bundle by Name, Unbundle, and Unbundle by Name functions by right-clicking a cluster terminal on the block diagram and selecting Cluster Palette from the shortcut menu. The Bundle and Unbundle functions automatically contain the correct number of terminals. The Bundle by Name and Unbundle by Name functions appear with the first element in the cluster. Use the Positioning tool to resize the Bundle by Name and Unbundle by Name functions to show the other elements of the cluster.

Assembling Clusters

Use the Bundle 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 Positioning tool to resize the function or right-click an element input and select Add Input from the shortcut menu. If you wire a cluster to the cluster input, the number of inputs must match the number of elements in the input cluster.

If you wire the cluster input, you can wire only the elements you want to change. For example, the cluster in Figure 1 contains three controls.

Figure 1
Figure 1 (bundle.png)

If you know the cluster order, you can use the Bundle function to change the Command value by wiring the elements shown in Figure 2.

Figure 2
Figure 2 (bundlebd.png)

Replacing or Accessing Cluster Elements

Use the Bundle by Name function to replace or access labeled elements of an existing cluster. Bundle by Name works similarly to the Bundle 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 output cluster.

Use the Operating 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 Select Item shortcut menu.

In Figure 3, you can use the Bundle by Name function to change Command and Function.

Figure 3
Figure 3 (bundbyname.png)

Use the Bundle by Name 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 Bundle by Name function because the names still are valid.

Disassembling CLusters

Use the Unbundle function to split a cluster into its individual elements.

Use the Unbundle by Name 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.

Use the Operating 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 Select Item shortcut menu.

For example, if you use the Unbundle function with the cluster in Figure 4, 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 Boolean terminal of the unbundled cluster with the corresponding switch in the cluster. In Figure 4, the elements are ordered from top to bottom starting with element 00. If you use the Unbundle by Name function, you can have an arbitrary number of output terminals and access individual elements by name in any order.

Figure 4
Figure 4 (unbundlebyname.png)

Comments, questions, feedback, criticisms?

Send feedback