Docsity

Getting Started with LabVIEW: Familiarizing the Environment and Basic Tools, Exercises of Programming Languages

Toggle sidebar
bg1
ECE 100 Fundamentals of LabVIEW Programming

GETTING FAMILIAR WITH LABVIEW
Activity No. 1

I. INTENDED LEARNING OUTCOMES

At the end of this activity, the student shall be able to:
1. Familiarize the NI LabVIEW environment.
2. Distinguish between the front panel and the block diagram.
3. Identify basic tools and controls in LabVIEW.
4. Enumerate real-world applications of LabVIEW.
II. BACKGROUND INFORMATION

LabVIEW stands for Laboratory Virtual Instrument Engineering Workbench. It is a system-design
platform and development environment for a visual programming language developed by the National
Instruments. The graphical language is named “G” (not to be confused with G-code). Originally released for
the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control and
industrial automation on a variety of platforms including Microsoft Windows, various versions of UNIX,
Linux and Mac OS X.
Engineers and scientists use LabVIEW to bring information from the outside world into a computer
using data acquisition (DAQ) devices, process these data, and present these data to the user. Thus,
LabVIEW can be used to create virtual instruments (VI). A virtual instrument is a computer program that
imitates the functionality of the real-world physical instruments. These virtual instruments can also take in
external data and do something about these data, just as how a standard instrument will work. These VIs
however has the inherent advantage of being flexible in terms of its use. Being virtual, these instruments’
functionalities are being programmed, and hence can be changed whenever wanted and needed. In most
cases, virtual instrumentation also results to lower costs, as a single set of hardware (a DAQ device, a
computer, and software) can be configured to perform many instrumentation tasks that require multiple
physical instruments. A LabVIEW program is also called a virtual instrument or VI. Moreover, LabVIEW can
also be used to simulate processes and control external instruments and equipment. Thus, LabVIEW is
very useful in the field of instrumentation and control.
III. LEARNING ACTIVITIES

ACTIVITY 1.1: OPENING LabVIEW WINDOW

1. On your desktop computer, open NI LabVIEW 2012. When opened, a Welcome screen (or Getting  
Started window in older versions) should appear as shown on the next page:
Question: What options do you see as the Welcome screen of LabVIEW 2012 appears? What do the
following options indicate?
Page 1
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Getting Started with LabVIEW: Familiarizing the Environment and Basic Tools and more Exercises Programming Languages in PDF only on Docsity!

GETTING FAMILIAR WITH LABVIEW

Activity No. 1 I. INTENDED LEARNING OUTCOMES At the end of this activity, the student shall be able to:

  1. Familiarize the NI LabVIEW environment.
  2. Distinguish between the front panel and the block diagram.
  3. Identify basic tools and controls in LabVIEW.
  4. Enumerate real-world applications of LabVIEW. II. BACKGROUND INFORMATION LabVIEW stands for Laboratory Virtual Instrument Engineering Workbench. It is a system-design platform and development environment for a visual programming language developed by the National Instruments. The graphical language is named “G” (not to be confused with G-code). Originally released for the Apple Macintosh in 1986, LabVIEW is commonly used for data acquisition, instrument control and industrial automation on a variety of platforms including Microsoft Windows, various versions of UNIX, Linux and Mac OS X. Engineers and scientists use LabVIEW to bring information from the outside world into a computer using data acquisition (DAQ) devices, process these data, and present these data to the user. Thus, LabVIEW can be used to create virtual instruments (VI). A virtual instrument is a computer program that imitates the functionality of the real-world physical instruments. These virtual instruments can also take in external data and do something about these data, just as how a standard instrument will work. These VIs however has the inherent advantage of being flexible in terms of its use. Being virtual, these instruments’ functionalities are being programmed, and hence can be changed whenever wanted and needed. In most cases, virtual instrumentation also results to lower costs, as a single set of hardware (a DAQ device, a computer, and software) can be configured to perform many instrumentation tasks that require multiple physical instruments. A LabVIEW program is also called a virtual instrument or VI. Moreover, LabVIEW can also be used to simulate processes and control external instruments and equipment. Thus, LabVIEW is very useful in the field of instrumentation and control. III. LEARNING ACTIVITIES ACTIVITY 1.1: OPENING LabVIEW WINDOW
  5. On your desktop computer, open NI LabVIEW 2012. When opened, a Welcome screen (or Getting Started window in older versions) should appear as shown on the next page: Question: What options do you see as the Welcome screen of LabVIEW 2012 appears? What do the following options indicate?
  1. Start using LabVIEW 2012 by clicking on the Blank VI. You can also choose File New VI Menu or press Ctrl+N. Question: How many windows did you see as you click on the Blank VI? What are the functions of these windows? SCREEN-CAPTURE these windows and provide this on your activity report for this specific question.
  2. On the Front Panel window, right click anywhere on an empty field. The Controls Palette will be shown. Question: As you browse on the Controls Palette, what options do you see? Enumerate these options and state their functions. SCREEN-CAPTURE these options and provide this on your activity report for this specific question.
  1. On an empty field in the Front Panel window, right click and choose Silver. Drag the following item in the front panel window as shown: Question: What is/are difference/s between the controls fetched from an ordinary controls palette and the tools obtained from a Silver palette? Question: What are the sequences to access the objects as shown above?
  2. On the Front Panel Menu, choose View Tools Palette. A window as shown on the next page should appear. Use this palette to change the background color of the Front Panel. SCREEN-CAPTURE this procedure and provide it on your activity report.

Question: What are the options do you see on the Tools Palette Window? Explain the functions of these options. Question: How do you change the background color of the Front Panel Window? Question: What are the other options do you see in the Front Panel window, specifically the options right below the Menu bar? Explain their uses.

  1. Right click anywhere on the Front Panel, and drag one Numeric Control in the Panel. Select that Numeric Control, copy it and paste in such a way that it will look scattered as shown on the figure. Controls labelled Numeric to Numeric 6 should be provided from left to right and Controls labelled Numeric, Numeric 7, Numeric 8, and Numeric 9 should be in a position from top to bottom.

ACTIVITY 1.3: EXPLORING LabVIEW BLOCK DIAGRAM Question: In LabVIEW, when do we use the BLOCK DIAGRAM window?

  1. Clear the Front Panel from the previous activities you have done. Together with this window, open the Block Diagram window. On the Front Panel window, choose Controls Numeric Numeric Control. Place it on the front panel. Place also a Tank by choosing Controls Numeric Tank. Question: What do you notice in the Block Diagram as you place objects like Numeric Control and Tank on your front panel?
  1. Write the sequence to access the following objects and identify what are these objects/icons: Example of Sequence to Access Add function: Right click anywhere in Block DiagramProgrammingNumericAdd Object name: Random Number (0-1) Sequence to access: Right click anywhere in Block Diagram >> Programming >> Numeric >> Random Number (0-1) Object name: Cosine Sequence to access: Right click anywhere in Block Diagram >> Mathematics >> Elementary >> Trigonometric >> cos Object name: Tick Count (ms) Sequence to access: Right click anywhere in Block Diagram

Programming >> Timing >> Tick Count (ms) Object name: Flat Sequence Sequence to access: Right click anywhere in Block Diagram >> Programming >> Structures >> Flat Sequence Object name: Max & Min Sequence to access: Right click anywhere in Block Diagram >> Programming >> Comparison >> Max & Min Object name: Add Array Elements Sequence to access: Right click anywhere in Block Diagram >> Programming >> Numeric >> Array Elements Question: What are the functions of the icons/objects shown in procedure 2?

  1. On the Front Panel window, click the upper arrow on the Numeric Control until it reaches the value 2. Then click on the Run button located just below the Menu bar. The Run button is shown to the right. Question: What happens to the Tank as you run your VI? SCREEN-CAPTURE the result and include this on your activity report.
  2. Set back the Numeric Control to 0. Click now on the Run Continuously button which is located right after the Run button. Click the upper arrow continuously on the Numeric Control. Question: What is the difference when you execute the program by clicking on Run and Run Continuously button? SCREEN-CAPTURE the result and include this on your activity report.
  3. Replace the Tank with Numeric Indicator. You can do this by selecting the Tank and press Delete on your Keyboard, then Choose Controls Numeric Numeric Indicator. Another way to replace the Tank is by right-clicking on the TankReplace Numeric Numeric Indicator. Question: State the difference between using a Numerical Indicator and Tank. SCREEN-CAPTURE the result of this procedure and include it in your activity report. ***Note: You can change the scale of the Tank if you want your Tank to display negative values. You can do that by Right-Clicking the Tank Object in the FP Choose Properties Select Scale Tab Scale Range and then define your minimum and maximum range.
  1. Clear the Front Panel and the Block Diagram from the previous procedures. Create a VI with the following Block Diagram objects as shown: Question: What output is generated in the Numeric Indicator labelled Output 1? Question: What output is generated in the Numeric Indicator labelled Output 2?

VI. CONCLUSION

I believe the activity’s goal to help the students be familiarized with LabVIEW was achieved. I understood the basic steps in creating a program through the software. Different applications were tasked in this activity that helped us explore the different sides. The interface of LabVIEW is now clear to me and the basic flow in creating an application. The feeling of accomplishing the task correctly and being able to run it with no problem was the best. I think it made me a step closer to my own goal of being an Electronics and Communication Engineer someday. VII. RUBRICS FOR LABORATORY PERFORMANCE