LabVIEW Installation With Arduino
LabVIEW Installation With Arduino
October, 2011
LabVIEW is a software product from National Instruments for data acquisition, signal
processing, instrument control and industrial automation. It is the most popular application for
computer-based data collection and control of an experiment, and widely used by industry. The
LabVIEW home page is www.ni.com/labview/.
The objective of this guide is for to install LabVIEW and the required device drivers to collect
voltage data from the arduino.
It will likely take much more time to install and configure LabVIEW than it will to create some
simple programs. The trial version of LabVIEW and device drivers are more than 2GB of data,
so both the download and installation are lengthy. So plan accordingly. You may use either the
Student Edition of LabVIEW, the Fully licensed version through the university, or the 30 day
trial of the full version.
1.
Get LabVIEW
To obtain LabVIEW, from the home page of the ME2011 course web site, see the LabVIEW
Resources page.
The following instructions are for a Windows Vista machine. Your configuration may differ in
some of the details.
Download LabVIEW
You have several options to download and install LabVIEW. The 30-day trial version is a free
full version available from the NI website. It will expire 30 days after installation unless you
purchase a full version key from the University of Minnesota. The Student Edition is a fullylicensed lite version of the full version. It is available for a very reasonable fee and will not
expire. If you want the Student Version with an Arduino, Sparkfun sells this in a bundle. Links to
these options are on the LabVIEW resources page on the ME2011 website. Pick one option and
download and install.
To download the LabVIEW 30-day trial version software, follow the link on the ME2011
website. Choose the Evaluating LabVIEW option. If you are using anything other than 32-bit
Windows (i.e. 64-bit, Mac OS) click the + by Additional Operating System and Language
Downloads and choose your operating system.
This download file is almost 1GB in size, so it will take time to download, even on a fast Internet
connection.
Once downloaded, open the downloaded file to unzip. The install dialog opens automatically.
Follow all prompts. Keep all default options, especially for hard drive location, so the Arduino
Toolkit can find it later. The install takes about 10 minutes. Towards the end, you may be
Page 1 of 7
prompted to install hardware support. Click Decline Support since the drivers will be installed
later. If asked to restart your computer, do so. The Download utility may start again, but you can
cancel it.
After the installation has completed, start LabVIEW. On Windows, you may be asked about the
firewall. Click Unblock. Check the box next to Do not show this dialog again and click
Launch LabVIEW. Not checking this box will cause errors when installing the Arduino
toolkit.
Once LabVIEW has completely started, close it to proceed with the remainder of the driver
installation.
2.
The NI-VISA device drivers are used for communication with the Arduino. This is a Gb
package and will take some time to download.
Download the drivers from the site found on the ME2011 LabVIEW Resources page. After the
download is complete, the self-extractor and the installation will proceed semi-automatically,
with some assisting clicks from you. Keep the default installation path and the default settings
for the features when asked. Your computer may need to be restarted after the drivers are
installed.
3.
The VI Package manager is needed to install the Arduino Toolkit, along with other toolkits
should you decide to use them.
The link to download the Package Manager can be found on the ME2011 LabVIEW Resources
webpage. It is a 43 Mb download. Once the file has been downloaded and the setup started, the
Page 2 of 7
installation will proceed semi-automatically. Like the previous two installations, keep the default
installation path so LabVIEW is able to find it. In the final screen of the installer, confirm that
Launch VI Package Manager is checked then click Finish.
4.
The Arduino toolkit is needed to find the drivers required by LabVIEW to recognize the Arduino
and communicate with it.
For Mac Users (Windows users: skip this paragraph and continue after the figure)
The Mac operating system is not able to configure the TCP/IP port automatically, so you will
need to first configure it. Open LabVIEW, navigate to the Tools menu, and choose Options.
Under the categories column, choose VI Server, check the TCP/IP box under protocol, and set
the port to 3363. It should look like the figure below. Click OK and quit LabVIEW.
configure LabVIEW to use the specified TCP/IP Port is checked, and click Test. LabVIEW will
open at this time. Do not close LabVIEW during this process. You should receive a message
saying it was successful. Click OK a few times to get back to the Package Manager, and after
about a minute, a list of packages should appear.
In the Package Manager list, click LabVIEW Interface for Arduino. Click the Install Package(s)
button. Verify the Arduino toolkit is checked and click Continue. The toolbox will download and
install itself. After a few minutes (in the VI Package Manager window see the bottom message
area at the bottom and the spinning circle at the top right for progress), a box should appear
saying the installation was successful. Exit from the VI Package Manager.
Warning: all the above may be a frustrating process. While our instructions are generally correct,
things my run slightly differently on your computer. Pay attention to dialog messages and use
your best engineering judgment to get through the install process.
5.
To communicate with the Arduino using LabVIEW, the LabVIEW firmware must be uploaded to
the Arduino. You do this the same way you would upload your own programming code to the
Arduino, but you upload code that National Instruments has provided to you instead. Therefore,
this step uses the Arduino programming interface instead of LabVIEW.
Start the Arduino programming interface. Open the sketch for the LabVIEW interface
(LFIFA_Base.pde). This is Arduino code written by NI and located at C:\Program Files\National
Instruments\LabVIEW 2011\vi.lib\LabVIEW Interface for Arduino\Firmware\LVIFA_Base
(Windows machine).
Connect the Arduino board to your computer. Upload the sketch to the Arduino board.
Mac Users
When you connect the Arduino board to your computer, a Network Configuration box may
appear. Click on Network Preferences, click Apply, and then exit. Due to the serial
communication, the Mac thinks its a serial modem, but the Arduino drivers will still work for
communication.
6.
Run LabVIEW
Start LabVIEW by selecting it from the start menu: Start Button > Programs > National
Instruments > LabVIEW 20xx > LabVIEW.
Once LabVIEW launches, you should have a screen similar to the one below. In this example,
LabVIEW 2009 is installed.
Page 4 of 7
The screen above is the primary starting point for LabVIEW. From here you may open exisiting
pieces of code (called VIs) using Browse, or create a new Blank VI.
7.
Page 5 of 7
The program will show the voltage wired to the Analog In 0 pin on the Arduino. This is the pin
labeled A0, not to be confused with the pin on the other side of the board labeled 0.
Connect the +5 volt pin to the Analog In 0 pin on the Arduino. Press the Run Continuously
button. The Arduinos RX and TX lights should be an amber color, and the meter on the
LabVIEW program should read around 5 volts. .
If the program displays 5 volts and there are no errors, you have connected the Arduino correctly.
Congratulations.
With the program running, connect the analog pin to ground (GND) and then to the 3.3 V supply
on the Arduino. The on-screen meter should change accordingly.
Press the Stop button on the LabVIEW program (below the meter) to end the program.
Here is what the LabVIEW program looks like when running with Arduino analog pin 0
connected to 5V.
category. Click on it and choose Edit. In the Alias field type Arduino and click Ok. You can
now exit the configuration wizard, saving the changes you made. Make note of which USB port
you use. If you use a different USB port next time, it might assign a different number and you
will need to configure it again.
From the front panel of the VI, open the controls palette if it is not already. Navigate to Modern
> I/O > VISA Resource Name and insert it on the front panel. Switch to the block diagram and a
VISA Resource Name block should appear. Wire this to the VISA Resource pin of the Arduino
Init block. Your block diagram should now look like the figure below.
Change the VISA reource name block to a constant by control-clicking and choosing Change to
Constant. From the drop-down menu, choose the entry labelled Arduino. Save the block
diagram and run the program. It should now run without any errors. This must be done for
every new block diagram that you create in LabVIEW.
Page 7 of 7