Download EE115 Lab manual solutions and more Study notes Telecommunications Engineering in PDF only on Docsity!
Lab Based Learning with NI USRP and LabVIEW
INTRODUCTION TO
COMMUNICATION SYSTEMS
Student Lab Manual
By: Mahdi Maaref
October 30, 2017
Contents
LAB 1
Introduction to the LabView
Communication
1.1 Objective
The purpose of this introductory laboratory exercise is to ensure that students have a working installation of LabVIEW Communication and be familiar with basics of LabVIEW Communication programming.
1.2 LabVIEW Communication 2.0 Installation on
Laptops
- Open the link below: http://systems.engr.ucr.edu/software/labviewcomm.html
- Download the Package.
- Extract the LabVIEW package, you will need 7zip or a similar extraction utility to do this.
- Connect to engineering VPN server.
- Right click and run “autorun.exe” as admin. The “autorun.exe” file is located inside the folder you extracted. Install Labview.
- After LabVIEW is installed, you need to update the license server information using “NI License Manager”.
- Run “NI License Manager”.
- Choose Options/Preferences.
- Check the “Use Volume License Server” and enter “labview.engr.ucr.edu”. Click OK.
- To run LabVIEW, make sure you are connected to engineering VPN server and then run the program like you normally would.
1.3 Background
LabVIEW Communication is a graphical programming language developed by Na- tional Instruments. The basic building block of LabVIEW Communication is the virtual instrument (VI). Conceptually, a VI is analogous to a procedure or function in conventional programming languages. Each VI consists of a block diagram and a front panel. The block diagram describes the functionality of the VI, while the front
Figure 1.1: Context Help Window
Figure 1.2: Screenshot of LabVIEW Online Help
1.4 Lab Procedure
- Ensure LabVIEW Communications 2.0 is installed.
- Open LabVIEW Communications.
- From the Help → lessons enter to the learning section. (also called the lobby), open and complete the guided help tutorial from Learn → Getting Started → Introduction to the LabVIEW Editor. Follow the steps in this tutorial. Skip pages 1 to 5 and start from page 6 which explains “Viewing, Creating and Interacting with Documents”
Figure 1.3: Tenurial for Viewing, Creating and Interacting with Documents
- In page 7, you are asked to open and run Flip Multiple Coins VI. Double click on this file as shown in figure bellow:
Figure 1.4: Opening Flip Multiple Coins VI
Figure 1.7: Capturing and Viewing Data on the Panel
After capturing the data (Based on page 10 instructions) drag the Capture and drop it into indicator. You can also double click on the capture to view it more precisely.
Figure 1.8: Capturing and Viewing Data on the Panel
- Page 12 highlights the parts of the editor you use to create code. The indicated parts in bellow figure are important for creating a code:
Figure 1.9: Important parts for creating a code is indicated with numbers 1 to 4
- Skip pages 13 and 14.
- Pages 15 explain multiple avenues for seeking help in LabVIEW Communica- tion.
- Page 16 explain how to use Help tools to understand a code. You are asked to Open Flip a Coin VI. Make sure you understand how the Flip a Coin program works. You will develop this program in this lab.
Figure 1.10: Flip a Coin program
- After finishing this tutorial return to the lobby.
- From learning section, open and complete the guided help tutorial for “Design- ing a User Interface” from Learn → Programming Basics → Designing a User Interface. In this tutorial you will design your first program which allows you to monitor the temperature of a room. Read pages 1 and 2 of this toturial for more information about main parts of program: Panel and Diagram.
Figure 1.12: For Loop and While Loop
- In page 3, the Die.VI is opened. This VI simulate a dice and each time you run the program a dice has been rolled and the rolled number is illustrated. Check out the diagram of this code and make sure you understand how it works. The goal is to develop this code and add while loop to it. Let’s say we want to know how many tries it takes to roll a 6!
Figure 1.13: This code simulates rolling a dice, each time you run the code, a rolled number is illustrated. Check out the diagram of this code and make sure you under- stand how it works.
- Page 4 helps you to find a while loop in the pallete. Make sure to switch to the diagram before inserting the while loop. Page 4 also illustrates different parts of while loop such as: Border, Iteration terminal and Conditional terminal.
Figure 1.14: While loop
Figure 1.16: Switch to the panel. Add the number of rolls indicator to the panel from the Unplaced Items tray.
- Page 10 helps you to control the timing of your while loop by adding Wait. Follow the instructions presented in page 10 to add a 1 second wait into your loop. Finally, your code should look like the diagram illustrated in Page 10.
Figure 1.17: using timing in a loop
- Finish this tutorial and return to return to the lobby.
- Now, we want to rewrite the Flip a Coin program and add a while loop. So, it can continuously flip a coin until we press the stop button.
- open the Flip a Coin program from Help → Lessons → Getting Started → Introduction to the LabVIEW Editor.
Figure 1.18: Flip a Coin program
- make a new Project : File → New → Project
Figure 1.21: Stop Button
Figure 1.22: Stop Button
- From the “Diagram Pallete” add a “While Loop” to the diagram (Fig. 1.23) and add a While Loop around all of the code in the VI. Finally, connect the stop button to the stop indicator of the while loop (Fig. 1.24).
Figure 1.23: While Loop in the diagram palette
Figure 1.24: While Loop around the code
- From the “Diagram Pallete” add a “Wait” to the diagram (Fig. 1.25), Then add a numeric constant to the diagram.(Fig. 1.26)
Figure 1.25: Wait
Figure 1.26: Numeric constant