0% found this document useful (0 votes)
263 views7 pages

LabVIEW Cluster Programming Exercises

The document discusses clusters in LabVIEW programming. Clusters group data elements of mixed types to reduce wire clutter and the number of connector pane terminals in subVIs. Clusters differ from arrays in that elements must be accessed all at once rather than individually indexed, and clusters have a fixed size. The document provides examples of using various cluster functions like Bundle, Unbundle, and numeric operations on numeric clusters. It also lists practice exercises for students to create VIs using clusters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
263 views7 pages

LabVIEW Cluster Programming Exercises

The document discusses clusters in LabVIEW programming. Clusters group data elements of mixed types to reduce wire clutter and the number of connector pane terminals in subVIs. Clusters differ from arrays in that elements must be accessed all at once rather than individually indexed, and clusters have a fixed size. The document provides examples of using various cluster functions like Bundle, Unbundle, and numeric operations on numeric clusters. It also lists practice exercises for students to create VIs using clusters.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

20EUEE058 MATHESWARAN V

[Link] Date:
PROGRAMMING EXERCISES FOR CLUSTERS

Aim:
To understand the principles of Virtual Instrumentation Programming and learn the basics of Clusters.
Equipment’s Required:
PC with National Instruments LabVIEW 2016.
Theory:
Clusters are implemented in a programming language as data types and the references (e.g.
relationships, links and pointers) and operations that are possible with them. Clusters 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. 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, 28 terminals. If front panel contains more than 28 controls and indicators
that want to be used programmatically, group some of them into a cluster and assign the cluster to a
terminal on the connector pane.
Although cluster and array elements are both ordered, all cluster elements must be unbundled
at once rather than index one element at a time. To access specific cluster elements the ‘Unbundle by
Name’ function is used. Clusters also differ from arrays in that they are a fixed size. Like an array, a
cluster is either a control or an indicator. A cluster cannot contain a mixture of controls and indicators.
Most clusters on the block diagram have a pink wire pattern and data type icon. Clusters of numerics,
sometimes referred to as points, have a brown wire pattern and data type icon. Numeric clusters can be
wired to Numeric functions, such as Add or Square Root, to perform the same operation
simultaneously on all elements of the cluster.

Fig. Block diagram- clusters


Cluster elements have a logical order unrelated to their position in the shell. The first object placed in
the cluster is element 0, the second is element 1, and so on. If an element is deleted, the order adjusts
automatically. The cluster order determines the order in which the elements appear as terminals on the
Bundle and Unbundle functions on the block diagram. The cluster order can be viewed and modified
by right-clicking the cluster border and selecting Reorder Controls in Cluster from the shortcut menu.
20
20EUEE058 MATHESWARAN V
To wire clusters, both clusters must have the same number of elements. Corresponding elements,
determined by the cluster order, must have compatible data types. For example, if a double- precision
floating-point numeric in one cluster corresponds in cluster order to a string in the other cluster, the
wire on the block diagram appears broken and the VI does not run. If numeric of different
representations, LabVIEW coerces them to the same representation. Use the Cluster functions located
on the Functions
» Cluster palette to create and manipulate clusters, such as the following tasks:
• Extract individual data elements from a cluster.
• Add individual data elements to a cluster.
• Break a cluster out into its individual data elements.
Procedure:
1. Open NI LabVIEW 8.5 and press <Ctrl_N> to open a blank VI.
2. Press <Ctrl_T> to tile front panel and block diagram windows.
3. Pull up the Functions Palette by right clicking on the white space on the LabVIEW block
diagram window.
4. Select Programming>>Cluster, Class & Variant>>Cluster Constant
5. Give different data types like Arrays, Numerics and Strings and build two cluster data.
6. Use Bundle and Unbundle functions to split the data and build Block Diagram as shown.
7. Now Run the VI and observe the cluster results in both data types
8. Save the file with extension “.vi”, a virtual instrument.

Pre- Lab Viva questions:


1. Define Clusters in VI.
2. What is the function of cluster?
3. Distinguish Array and Clusters.
4. What is Difference between Assemble clusters and Dissemble clusters?
5. What is cluster operations?
Post- Lab Viva questions:
1. What is function of Assemble clusters and Dissemble clusters?
2. Differentiate bundle cluster and bundle by name functions?
3. Explain the method of changing the value of an element in an existing cluster.
4. Differentiate unbundle cluster and unbundle by name functions?
5. Explain how clusters can reduce the number of terminals of sub VI?

Result:
Thus the VI program has been successfully executed and the output is verified

21
20EUEE058 MATHESWARAN V

Practice:

1. Build a cluster control which consists of a thermometer, a tank and a gauge. Build a cluster
constant which consists of a scaling factor for all the three cluster controls. Display the scaled
values in a cluster indicator.

2. Create a cluster which consists of a numeric control, two Boolean controls and a slide control.
Modify the values of the cluster control and display them in a cluster indicator

22
20EUEE058 MATHESWARAN V

3. Create a VI to check whether the cluster elements are in range or not. Specify the upper and
lower limits. Display the coerced output and a cluster of LEDs to indicate whether a particular
cluster element is in the range or not.

4. Create a VI to compare clusters and Switch ON an LED in the output cluster if the nth element of
cluster 1 is grater than the nth element of the cluster 2.

5. Create a VI to add a value with every element of an available cluster. (Adding a numeric to a
cluster results in the addition of the numeric to each element in the cluster.)

23
20EUEE058 MATHESWARAN V

6. Create a VI consisting of two clusters of LEDs. Perform the AND operation between the clusters
and display the output in another cluster of LEDs. (When comparing clusters, the And function
compares each element with its corresponding value in the second cluster.)

7. Create a VI to compare the elements of two clusters. If the values of corresponding elements of
both the VIs are the same, switch ON an LED in the output cluster.

8. Create a VI to select between two input clusters using a toggle switch and display in an output
cluster.

24
20EUEE058 MATHESWARAN V
9. Build an array of cluster controls in which each cluster consists of a numeric control and a 1D
numeric array (with 5 elements). This forms a database of marks of students. The numeric
control indicates the roll number and the array indicates the test marks of five subjects. Build
logic to modify the mark in a particular subject of a particular student. Input the roll number,
subject in which mark is to be changed and the new marks. Display the changed database on a
separate array indicator

25
20EUEE058 MATHESWARAN V

10. Explain the various function of a cluster

26

You might also like