University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What...

15
Laboratory 1 Introduction to LabVIEW and USRP Advanced Wireless Lab TLEN 5830 Advanced Wireless Lab Introduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different from the traditional programming languages like MATLAB, C# etc. because the programs need to be “drawn” instead of writing the code. Getting started Open LabVIEW and select File>New VI as shown.

Transcript of University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What...

Page 1: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Laboratory

1 Introduction to LabVIEW and

USRP

  Advanced Wireless Lab

TLEN 5830  

Advanced Wireless Lab  

Introduction to LabVIEWWhat is LabVIEW?

It is a visual programming language and environment. It’s quite different from the traditional programming languages like MATLAB, C# etc. because the programs need to be “drawn” instead of writing the code.

Getting startedOpen LabVIEW and select File>New VI as shown.

Page 2: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

A Blank VI consists of two Windows – a Front Panel and a Block Diagram.

Controls Palette: (available only on front panel)

The Controls palette contains the controls and indicators used to create the front panel. We access the Controls palette from the front panel window by selecting View> Controls Palette or by right clicking on any empty space in the front panel window.

Page 3: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Functions Palette: (available only on block diagram panel)

The Functions palette contains the VIs, functions and constants you use to create the block diagram. We access the Functions palette from the block diagram by selecting View>Functions Palette. The Functions palette is broken into various categories; we can show and hide categories to suit our needs.

Wires: (function palette only)

We transfer data among block diagram objects through wires. Each wire has a single data source, but you can wire it to many VIs and functions that read the data. Wires are different colours, styles, and thicknesses, depending on their data types.

Page 4: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

A broken wire appears as a dashed black line with a red X in the middle. Broken wires occur for a variety of reasons, such as when we try to wire two objects with incompatible data types.

If we have broken wires to remove, press <Ctrl-B> to delete all the broken wires on the block diagram.

Loops and Structures:

To Run the Program:

Click the highlighted button to run the Project. This could be done either from the Front Panel or the Block Diagram.

Using Help:

In case of confusion on how to use a block, right click>Help will give the schematics of the block and the types of inputs and outputs expected.

Fixing errors:

Page 5: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Exercises:

1) Create a simple example for math operation as shown below. Insert the components using the Control and Function Palettes and connect the components (math operation components are available in functions palette only). Also, keep in mind that ‘numeric control’ is for the input and ‘numeric indicator’ is for the output.

2) Create an example utilizing the while loop as shown.

Page 6: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

3) Create an example to convert values in Celsius to Fahrenheit as shown.

4) Create an example to use the waveform chart to display the generated signal. Random number block can be found by searching it in the function palette.

Page 7: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

5) Create a Waveform chart vs Waveform graph example.

Note: Waveform graph can only be placed outside of the while loop.

Page 8: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Creating SubVI.

SubVI in LabVIEW is equivalent to a ‘Function’ in a C program. It allows a functional block to be re-used and so, reduces complexity and saves time. (note: you won’t see its benefits in small diagrams)

To create a SubVI, select the components which needs to be in the SubVI (left click and drag) and go to Edit>Create SubVI. A block will be generated that performs the same function as before. To check the components within the SubVI, simply double-click on it to open the front panel (note: Ctrl+E to display the block diagram).

Page 9: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

A custom icon for the SubVI can also be created.

6) Redo example 3 using SubVI. (if you want, try creating a custom icon for the SubVI)

Page 10: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

7) Create the following ‘formula node’ example. To add input/output, right-click on the node box and add the input/output. (note: answer must be 0.004373)

Page 11: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

8) Repeat the above using Math script node.

9) Create an example using ‘for’ loop.

10) Create the following example to play a sound file.

Page 12: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Introduction to LabVIEW Communications System Design Suite

The LabVIEW Communications System Design Suite is an integrated, hardware-aware design environment for prototyping communications systems.

Page 13: University of Colorado Bouldergifford/5830-AWL/Intro t… · Web viewIntroduction to LabVIEW What is LabVIEW? It is a visual programming language and environment. It’s quite different

Introduction to NI-USRP

The USRP (Universal Software Radio Peripheral) is a flexible and affordable transceiver that turns a standard PC into a powerful wireless prototyping system. Paired with LabVIEW Communications System Design Software, USRP transceivers help you prototype a wide range of single-channel and MIMO wireless communications systems.

The USRP and LabVIEW Communications System Design Suite offer a powerful solution for prototyping RF and communications systems. Build a complete wireless communications system using the intuitive LabVIEW programming environment that supports multirate DSP for physical layer communications and helps you integrate .m file scripts and C language algorithms.

Benefits of USRP: Tunable RF transceiver with frequency options from 50 MHz to 6 GHz Up to 20 MHz of real-time bandwidth with plug-and-play MIMO support Option for an integrated GPS receiver for better frequency accuracy and synchronization