How to Guide LabVIEW

From GT RoboJackets

Jump to: navigation, search

LabVIEW (Laboratory Virtual Instrumentation Engineering Workbench) is graphical development / visual programming environment developed by National Instruments. Used in many industrial, R&D, and educational settings.

Contents

What is LabVIEW

Since LabVIEW is a graphical programming environment it represents data flow within a system. This graphical appearance is represented by blocks and wires.

What are Virtual Instruments (VI)

Virtual Instruments are essentialy what you will be creating in LabVIEW. The files have a .vi extension. Each VI has two parts.

Block Diagram

A Block Diagram in LabVIEW
Enlarge
A Block Diagram in LabVIEW
The block diagram is the code that makes what ever you are doing possible. It is composed of blocks and wires.

Front Panel

A simple front panel in LabVIEW
Enlarge
A simple front panel in LabVIEW
The front panel is the User Interface (UI) that is connected to the block diagram. It has items such as dials, input text boxes, and switches for input. For output it has graphs, indicator lights, sliders, etc.


Getting LabVIEW

LabVIEW trials can be acquired from NI's LabVIEW Test Drive. Note this currently offers 8.6 (this version does not have NXT toolkit support as of yet). Do note the web based option does not allow you to save any thing you make. This is none the less a good way to gain some exposure to the interface and familiarize yourself with the software.

Installing LabVIEW

The over all process of installing LabVIEW is simple depending on what you want to accomplish. If you want to use a Lego NXT you will need to download and install the NXT Toolkit (this process outlined below). At present you must have LabVIEW 8.5.x or lower to work with Lego NXTs. As of yet there is not a patch for 8.6.

Note: If you wish to use the NXT you must have Windows XP (32bit), Windows Vista (32bit), or Mac OSX. Drivers are not available for 64bit Vista.

Support for linux does not exist for the student editions or for the NXT Toolkit.

Linux users might want to look into using VirtualBox to run Windows. We have had success doing so with good performance.

To install start the installer located on your media. Agree the the usual license statement and select the location to install to on your computer. Now depending on what variant you have (Student, FTC, FRC, etc.) you will see different available addons. What ever is default selected by the installer will be fine. However, you should review these to be aware of what you are installing. Once you're ready, begin the install by hitting next. Form here it will take up to an hour or more depending on the machine you are installing it on and what edition you are using. Student and FTC editions have the lowest install time (30 min or less on a Pentium M 2.0Ghz). Once you are done installing you will need to restart your machine.

Student Edition

NXT Toolkit

Download the tool kit from National Instruments (http://www.ni.com/academic/mindstorms/). You will need a Windows.zip (or Macintosh.zip if you use a Mac) file and a nxt_toolkit_x_patch.zip file.

Installer

First thing is to unzip the Windows.zip file and run the installer. It will install the toolkit and the drivers you need to communicate with the NXT. (If you are running Windows Vista 64bit you will get an error relating to the Microsoft Windows Installer service. It will tell you to reregister msi.dll. This will not fix this error because the toolkit does not support 64bit OS.) Once this is done proceed onward to patching.

Patching

For this step LabVIEW should not be running. You will now need to unzip the nxt_toolkit_x_patch.zip file. Go to the appropriate corresponding version folder (LabVIEW 8.5). Copy the vi.lib folder found with in to the labview directory on your computer (ie. C:\Program Files\National Instruments\LabVIEW 8.5) over write any files it asks you to. Before you do this it would be good practice to back up vi.lib before doing copying over the files. Once the copying is done continue on.

Mass Compiling

If this step has not been done you will get a warning about the NXT's being compatible with only 7.something and not 8.5.x.

  1. Launch LabVIEW
  2. Go to Tools -> Advanced -> Mass Compile.
  3. Browse to the folder where you just pasted vi.lib and then go to vi.lib\addons\NXTToolkit (ie. C:\Program Files\National Instruments\LabVIEW 8.5\vi.lib\addons\NXTToolkit).
  4. Go within the NXTToolkit folder and then click on the Current Folder (this is near the Ok button).
  5. Double check to that the path ends with NXTToolkit.
  6. Now click Mass Compile. Once this process is done you will be ready to create blocks for the NXT.
(OSX 10.5 Users Only) Apply Firmware Fix

Without this patch the NXT terminal will refuse to launch, or crash LabVIEW.

  1. Download Mac OS 10.5 (Leopard) Firmware Fix from Lego NXT Software Updates.
  2. Double click on the .pkg installer and follow the instructions

FIRST Tech Challenge Edition (FTC)

The process is the same as the normal student edition except it comes bundled with the NXT drivers & NXT software.

NXT Toolkit

While this comes with the NXT software it does not seem to let you make blocks. You still need to run the installer.

Installer

This process is the same as the student edition. It will however tell you that you have a newer version of the NXT Drivers installed. By default it will not install the older ones. So hit next and continue on ward to patching.

Patching

This process is identical to the Student edition.

Mass Compiling

This process is identical to the Student edition.

FIRST Robotics Competition Edition (FRC)

Process is untested for NXTs.

Making a Simple VI

To start adding blocks to the Block Diagram or indicators / controls to the Front Panel right click on an open area in either the Front Panel or Block Diagram. You will see a list of different items you can use. To make this menu stick click the thumb tack icon. This menu is either labeled Functions (with in the Block Diagram) or Controls (with in the Front Panel).

Specific How-Tos

Notes For the NXT

Only VI's made with blocks/indicators/controls from the NXT Toolkit can be sent to the NXT. These can be found in Addons -> NXT Toolkit in the Functions / Controls menu.

Notes For the FRC CompactRio

Talking to the NXT

The NXT Terminal
Enlarge
The NXT Terminal
All communication to the NXT is done via the NXT Terminal. This can be found by going to Tools -> NXT Toolkit -> NXT Terminal.
  1. Hook up the NXT to the computer.
  2. Hit Find NXT
  3. Select VI
  4. Select what you want to do from the four buttons (ordered below from left to right):
    Compile, Download, and Run without maintaining a link to the host computer.
    Compile and Download the VI without running it.
    Debug - Compile, download and run the VI while maintaining a link to the host compute
    Abort - Stops running the VI.


USB

Simply connect the NXT to your computer. Wait for windows to auto detect and fully install it. Your drivers should be already installed at this point. Once this is done then go to the NXT Terminal.

Bluetooth

Talking to the CompactRio

Additional Resources

Personal tools