User Tools

Site Tools


labview_tutorial

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
labview_tutorial [2017/07/21 14:18] yuhanghelabview_tutorial [2017/08/15 15:46] (current) – [LabVIEW Basic Elements] yuhanghe
Line 1: Line 1:
-====== Basic Elements of LabVIEW ======+====== LabVIEW Basic Elements ======
 <!-- Replace the above line with the name of your "How To" Tutorial e.g. How to Laser cut Your Name in Wood --> <!-- Replace the above line with the name of your "How To" Tutorial e.g. How to Laser cut Your Name in Wood -->
  
Line 6: Line 6:
 **Author:** Yu Hang He **Email:** <hey6@unlv.nevada.edu> <!-- replace with your email address --> **Author:** Yu Hang He **Email:** <hey6@unlv.nevada.edu> <!-- replace with your email address -->
 \\ \\
-**Date:** Last modified on 07/21/17+**Date:** Last modified on <07/24/17>
 \\ \\
 **Keywords:** LabVIEW, Tutorial, Installation, Examples, Exercises **Keywords:** LabVIEW, Tutorial, Installation, Examples, Exercises
Line 30: Line 30:
   * Interests in graphical programming language   * Interests in graphical programming language
 </fc> </fc>
-\\+\\ \\ 
 The rest of this tutorial is presented as follows: The rest of this tutorial is presented as follows:
-  * Installation Guide +  * [[labview_Tutorial#installation_guide|Installation Guide]] 
-  * Basic Elements +  * [[labview_Tutorial#basic_elements|Basic Elements]] 
-  * Examples and Exercise +  * [[labview_Tutorial#examples_and_exercises|Examples and Exercise]] 
-  * Final Words+  * [[labview_Tutorial#final_words|Final Words]]
  
-==== Installation Guide ====+===== Installation Guide =====
  
-=== Section 1.1: Register Account ===+==== Section 1.1: Register Account ====
  
 First step is to create a free National Instruments account. Follow this link https://lumen.ni.com/nicif/create.xhtml to create an account. **Remember to enter an educational email address to activate 6-months LabVIEW Student Edition later. You will need to confirm your email address.** First step is to create a free National Instruments account. Follow this link https://lumen.ni.com/nicif/create.xhtml to create an account. **Remember to enter an educational email address to activate 6-months LabVIEW Student Edition later. You will need to confirm your email address.**
    
-=== Section 1.2: Request Serial ===+==== Section 1.2: Request Serial ====
  
 Next step is to register for LabVIEW Student Edition. **This license works for Window OS only.** Follow this link https://forums.ni.com/t5/Projects-Products/Free-6-Month-Evaluation-of-LabVIEW-Student-Edition-for-at-home/ta-p/3497362 to request a license.  Next step is to register for LabVIEW Student Edition. **This license works for Window OS only.** Follow this link https://forums.ni.com/t5/Projects-Products/Free-6-Month-Evaluation-of-LabVIEW-Student-Edition-for-at-home/ta-p/3497362 to request a license. 
Line 51: Line 51:
 Click on the “I AGREE, Request serial” will lead to a new webpage with your serial number and instructions for next step. Remember to note down the serial number. The serial number and activation code is also send to your registered email. Click on the “I AGREE, Request serial” will lead to a new webpage with your serial number and instructions for next step. Remember to note down the serial number. The serial number and activation code is also send to your registered email.
  
-=== Section 1.3: Download Software ===+==== Section 1.3: Download Software ====
  
-Follow the “Download Software” link or this link http://www.ni.com/en-us/shop/labview/download.html to download LabVIEW. Click on “EXISTING USERS” tab and choose “FULL UNIVERSITY ACCESS” version. Download the NI Student Edition Software installer.+Follow the “Download Software” link or this link http://www.ni.com/en-us/shop/labview/download.html to download LabVIEW. Click on “EXISTING USERS” tab and choose “FULL UNIVERSITY ACCESS” version. Download the NI Student Edition Software installer. **If you are going to work with LEGO MINDSTORMS NXT/EV3, download the 2016 Version, which have the option to include LabVIEW Modules for LEGO MINDSTORMS.**   
  
-=== Section 1.4:Activate Product ===+==== Section 1.4: Activate Product ====
  
 LabVIEW Student Edition can be activated during installation or through NI License Manager.  LabVIEW Student Edition can be activated during installation or through NI License Manager. 
Line 67: Line 67:
 Enter serial number to activate LabVIEW Student Edition. Enter serial number to activate LabVIEW Student Edition.
 \\ \\  \\ \\ 
-Alternatively, you can use NI License Manager. Open NI License Manager, which was included during LabVIEW installation, and click on “Active Software”.+{{ yuhang:labview:packageselection.png?500 |}} 
 +\\ \\  
 +Check all the packages that you will need. **If you are going to work with LEGO MINDSTORMS, installed the LabVIEW 2016 Module for LEGO MINDSTORMS.** 
 +\\ \\  
 +Alternatively, you can use NI License Manager to activate LabVIEW Student Edition. Open NI License Manager, which was included during LabVIEW installation, and click on “Active Software”.
 \\ \\  \\ \\ 
 {{ yuhang:labview:licensemanager.png?500 |}} {{ yuhang:labview:licensemanager.png?500 |}}
 \\ \\  \\ \\ 
-Enter your serial number to activate LabVIEW 2017 Student Edition. Alternatively, you can click on “Enter Activation Codes” to enter activation code, which should have been sent to your email. +Enter your serial number to activate LabVIEW 2016 or 2017 Student Edition. Alternatively, you can click on “Enter Activation Codes” to enter activation code, which should have been sent to your email. 
  
  
-==== Basic Elements ====+===== Basic Elements =====
  
 You have successfully installed and activated LabView Student Edition, it is time to learn some basic elements of LabVIEW. You have successfully installed and activated LabView Student Edition, it is time to learn some basic elements of LabVIEW.
  
-=== Section 2.1: Creating VI ===+==== Section 2.1: Creating VI ====
  
 A program created through LabVIEW is called VI, or Virtual Instrument. A VI is consisted of two components: Front Panel and Block Diagram. Front Panel is similar to console or terminal in text-based programming. It is a graphical user interface where users can input data information and where result of program is displayed. Block Diagram is the workbench for working with underlying visual-based programming. A program created through LabVIEW is called VI, or Virtual Instrument. A VI is consisted of two components: Front Panel and Block Diagram. Front Panel is similar to console or terminal in text-based programming. It is a graphical user interface where users can input data information and where result of program is displayed. Block Diagram is the workbench for working with underlying visual-based programming.
Line 92: Line 96:
 If only one window appears, click on “Window” => “Show Block Diagram” or “Show Front Panel.” If only one window appears, click on “Window” => “Show Block Diagram” or “Show Front Panel.”
  
-=== Section 2.2: Front Panel ===+==== Section 2.2: Front Panel ====
  
 Front Panel is a graphical user interface that resembles terminal or console from textual programming. There are two types of objects that you can create on Front Panel: Controls and Indicators. **Controls are responsible for user input to the VI.** They resemble text box, switch, button, etc. to simulate different types of data. **Indicators display result or output of program back to users.** They are in the form of graphs, tables, and charts. To access controls and indicators, simply right-click on the Front Panel.  Front Panel is a graphical user interface that resembles terminal or console from textual programming. There are two types of objects that you can create on Front Panel: Controls and Indicators. **Controls are responsible for user input to the VI.** They resemble text box, switch, button, etc. to simulate different types of data. **Indicators display result or output of program back to users.** They are in the form of graphs, tables, and charts. To access controls and indicators, simply right-click on the Front Panel. 
Line 106: Line 110:
 You can resize and reposition the string indicator and edit the labeling by double clicking the text.  You can resize and reposition the string indicator and edit the labeling by double clicking the text. 
  
-=== Section 2.3: Block Diagram ===+==== Section 2.3: Block Diagram ====
  
 The Block Diagram is an integrated development environment for developing VI. Block Diagram contains four basic elements: terminal, node, constant, and wire. The Block Diagram is an integrated development environment for developing VI. Block Diagram contains four basic elements: terminal, node, constant, and wire.
Line 124: Line 128:
 **Constants are user or system defined variables of specific data types, for example, integer, string, array.** There are also universal constants that you can use. Let’s create a constant with string data type. **Constants are user or system defined variables of specific data types, for example, integer, string, array.** There are also universal constants that you can use. Let’s create a constant with string data type.
 \\ \\  \\ \\ 
-{{ yuhang:labview:constant.png?300 |Constant}}+{{ yuhang:labview:constant.png?450 |Constant}}
 \\ \\  \\ \\ 
 Right-click on Block Diagram to open Function Palette. Hover your mouse over string category to open string submenu. Click on String Constant, place it on the Block Diagram and type in “Hello World!” in the text box. Right-click on Block Diagram to open Function Palette. Hover your mouse over string category to open string submenu. Click on String Constant, place it on the Block Diagram and type in “Hello World!” in the text box.
Line 138: Line 142:
 For more information on different elements of Block Diagram, visit this link http://zone.ni.com/reference/en-XX/help/371361K-01/lvconcepts/block_diagram_objects/ For more information on different elements of Block Diagram, visit this link http://zone.ni.com/reference/en-XX/help/371361K-01/lvconcepts/block_diagram_objects/
  
-=== Section 2.4: Execute and Debug Tool ===+==== Section 2.4: Execute and Debug Tool ====
  
 **To execute the program, click on the run button in the tool bar on top of Front Panel or Block Diagram.** **To execute the program, click on the run button in the tool bar on top of Front Panel or Block Diagram.**
Line 161: Line 165:
 \\ \\  \\ \\ 
  
-==== Examples and Exercises ====+===== Examples and Exercises =====
  
  
 Now that you have learned basic elements of LabVIEW, let’s try some examples and exercises. Now that you have learned basic elements of LabVIEW, let’s try some examples and exercises.
  
-=== Section 3.1: Mathematical Operations ===+==== Section 3.1: Mathematical Operations ====
  
 For this exercise, create a program that add, subtract, multiple, and divide two numbers provided by user and display the results. For this exercise, create a program that add, subtract, multiple, and divide two numbers provided by user and display the results.
Line 184: Line 188:
   - Calculate volume of sphere based on radius.   - Calculate volume of sphere based on radius.
  
-=== Section 3.2: Case Structure ===+==== Section 3.2: Case Structure ====
  
 Building on the previous example, what if you want users to choose which operation they want to perform. In this type of situation, you need conditional statements, or case structures. A conditional statement is only executed when the condition is met. **Case structure in LabVIEW is similar to if-else statement or switch case in text-based programming.** Building on the previous example, what if you want users to choose which operation they want to perform. In this type of situation, you need conditional statements, or case structures. A conditional statement is only executed when the condition is met. **Case structure in LabVIEW is similar to if-else statement or switch case in text-based programming.**
Line 226: Line 230:
   - Create a program to determine if a number is odd or even.   - Create a program to determine if a number is odd or even.
  
-=== Section 3.3: While and For Loops ===+==== Section 3.3: While and For Loops ====
  
 The ability to repeat a process until certain condition or for certain number of times is fundamental to any programming process. **LabVIEW provide while loop for repeat a block of code until a condition and for loop for set number of repetition. ** The ability to repeat a process until certain condition or for certain number of times is fundamental to any programming process. **LabVIEW provide while loop for repeat a block of code until a condition and for loop for set number of repetition. **
Line 259: Line 263:
  
  
-==== Final Words ====+===== Final Words =====
  
 The purpose of this tutorial was to introduce reader to some of the fundamental elements of LabVIEW. The tutorial included installation guide for LabVIEW Student Edition and examples and exercises that will further improve reader’s understanding of LabVIEW programming process. After following through with the tutorial, reader should be able to create simple VI and know where to find more resources for help. The purpose of this tutorial was to introduce reader to some of the fundamental elements of LabVIEW. The tutorial included installation guide for LabVIEW Student Edition and examples and exercises that will further improve reader’s understanding of LabVIEW programming process. After following through with the tutorial, reader should be able to create simple VI and know where to find more resources for help.
labview_tutorial.1500671884.txt.gz · Last modified: 2017/07/21 14:18 by yuhanghe