{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lab+02

# Lab+02 - C ASE S TRUCTURES A RRAYS WAVEFORMS E LECTRICAL E...

This preview shows pages 1–4. Sign up to view the full content.

C ASE S TRUCTURES , A RRAYS , W AVEFORMS 2 E LECTRICAL E NGINEERING 20N Department of Electrical Engineering and Computer Sciences University of California, Berkeley S IMON H ONG , H SIN -I L IU , J ONATHAN K OTKER , AND B ABAK A YAZIFAR 1 Introduction In this lab, we will explore another LabVIEW construct – the case structure – that allows different behaviors based on the states of certain blocks and variables. We will also explore how arrays are implemented and manipulated in LabVIEW . In the most basic sense, an array is simply a sequence of data points. What makes these sequences in- teresting is that they can represent signals. A signal usually contains information that describes a natural phenomenon. For instance, sound can be represented as varying pressure waves, which in turn can be approximated by a sequence of numbers describing this physical phenomena. These sequences, or arrays, are fundamental in describing and dealing with signals, as we shall see in this lab. We will also play around with graphical methods of displaying the signals that these arrays represent, with the help of waveforms . 1.1 Lab Goals Manipulate case structures. Use arrays in a LabVIEW application, in association with other structures. Generate waveforms and display them on the front panel using charts and graphs. 1.2 Checkoff Points 2. Case Structures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (20 minutes) 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Example VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (25%) 3. Arrays . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (45 minutes) 1. Data Types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Example VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (15%) 3. Self-Exercise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (20%) 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
4. Array Manipulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (30 minutes) 1. Example VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (25%) 5. Waveform Generation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (30 minutes) 1. Terminology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2. Example VI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . (15%) 6. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2 Case Structures 2.1 Terminology Until now, the block diagrams of the VIs we generated were fairly static: data moved from left to right through a preset arrangement of blocks and functions. A case structure adds a layer of dynamism, allowing CASE STRUCTURE us to change the block diagram itself, based on the data flowing through it and various triggers. 2.2 Example VI The following exercise will demonstrate how to use case structures in a VI. 1. Open LabVIEW . 2. Open a new VI by clicking on Blank VI on the LabVIEW Getting Started window. 3. Save the VI as Case Structure.vi . 4. Create the block diagram in Figure 2 . Right-click on the block diagram and place down a Case Structure from the Programming Structures subpalette. Figure 1 Structures Subpalette from the Functions Palette. Place a One Button Dialog function inside both the True and False cases of the Case Structure. This can be found under Programming Dialog & User Interface . Click on the case selector label on top of the Case Structure to view all available cases. 2
Create a String Constant from under Programming String and wire it to the message input of the One Button Dialog function. Initialize the constant to True in the true case and a value of False in the false case.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 13

Lab+02 - C ASE S TRUCTURES A RRAYS WAVEFORMS E LECTRICAL E...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online