EXERCISE 1
1.A) Front Panel
- Open a blank VI and build the front panel in Figure 1.
Figure 1 - Place a
stopbutton, located on theControls>>Buttons & Switchespalette, a numeric indicator, located on theControls>>Numeric Indicatorspalette, and a round LED, located on theControls>>LEDspalette, on the front panel. - Place a
cluster, located on theControls>>All Controls>>Array & Clusterpalette, on the front panel. - Place a
numeric control, located on theControls>>Numeric Controlspalette, two vertical toggle switches, located on theControls>>Buttons & Switchespalette, and a horizontal fill slide, located on theControls>>Numeric Controlspalette, in the cluster. - Create the
Modified Clusterby duplicating the first cluster and relabeling it. Right-click the shell ofModified Cluster, and selectChange to Indicatorfrom the shortcut menu. - Copy
Modified Clusterand relabel it to createSmall Cluster. Remove the second toggle switch and horizontal fill slide indicators. Relabel thenumeric indicatortoSlide value. Resize theclusteras shown in Figure 1.
- Place a
- Verify the cluster order of
ClusterandSmall Cluster.Modified Clustershould have the same order asCluster.- Right-click the boundary of each
clusterand selectReorder Controls in Clusterfrom the shortcut menu. - Confirm the cluster orders.
Figure 2
- Right-click the boundary of each
1.B) Block Diagram
- Build the block diagram in Figure 3.
Figure 3 Place the
While Loop, located on theFunctions>>All Functions>>Structurespalette, on the block diagram.Place the
Unbundlefunction, located on theFunctions>>All Functions>>Clusterpalette, on the block diagram. This function disassemblesCluster. Wire the input cluster to resize the function automatically.Place the
Bundlefunction, located on theFunctions>>All Functions>>Clusterpalette, on the block diagram. This function assemblesSmall Cluster.Place the
Unbundle by Namefunction, located on theFunctions>>All Functions>>Clusterpalette, on the block diagram. This function returns two elements fromCluster. Resize this function to have two output terminals. If a label name is not correct, right-click the name and select the correct name from theSelect Itemshortcut menu.Place the
Incrementfunction, located on theFunctions>>All Functions>>Numericpalette, on the block diagram. This function adds one to the value ofNumeric.Place the
Notfunction, located on theFunctions>>Arithmetic & Comparison>>Express Booleanpalette, on the block diagram. This function returns the logical opposite of the value of theBooleanterminal of theUnbundle by Namefunction.Place the
Bundle by Namefunction, located on theFunctions>>All Functions>>Clusterpalette, on the block diagram. This function replaces the values ofNumericandBoolean1 inClusterand createsModified Cluster. Resize this function to have two input terminals. If a label name is not correct, right-click the name and select the correct name from theSelect Itemshortcut menu.- Complete the block diagram and wire the objects as shown in Figure 3.
- Save the VI as
Cluster Exercise.viin theC:\Exercises\LabVIEW Basics Idirectory.
1.C) Run the VI
- Display the front panel and run the VI.
- Enter different values in
Clusterand run the VI again. Notice how values entered inClusteraffect theModified ClusterandSmall Clusterindicators. Is this the behavior you expected? - Try changing the cluster order of
Modified Cluster. Run the VI. How did the changed order affect the behavior? - Close the VI. Do not save changes.
No comments:
Post a Comment