Anda di halaman 1dari 7

National University of Sciences & Technology

Course: MTS- 336 Instrumentation and Measurements


Lab Manual 11
Instructor: LE Muhammad Umar Masood

Experiment 11: Setup of LabVIEW Interface for Arduino


Safety Precautions:
 Do not harm your computer while interfacing external devices. Double check the external device
if it is electrically working.
 While stopping the program, do not use stop button of VI. I may leave the communication ports
busy which might not be usable next time you run the program.

Introduction/Motivation:
To interface Arduino (www.arduino.com) boards with LabVIEW for real time operation (Acquisition
and Actuation)

Procedure:
1. Download and install NI LabVIEW
http://www.ni.com/download/labview-development-system-2015/5314/en/
2. Download and install NI VISA 15.0
http://download.ni.com/support/softlib/visa/NI-VISA/15.0.1/NIVISA1501full.exe
3. Download and install VI Package Manager
http://ftp.ni.com/evaluation/labview/lvtn/toolkits/jki/vipm-windows.exe

4. Install the latest version of LIFA (v2.2.0.79) using VIPM. You must have an active internet
connection on target machine. Complete the following steps:

a. Make sure you have the most recent version of VI Package Manager (VIPM) installed on
your system. You can download VIPM Community Edition for free at External Link: VI
Package Manager.
b. Launch VIPM.
If VIPM fails to launch, there is most likely a problem with the VI Server setting in
LabVIEW. See Knowledgebase 60EEQC1Z: Why Can't VI Package Manager (VIPM)
Connect to LabVIEW? for troubleshooting steps.

Department of Mechatronics Engineering College of EME NUST


Page 1 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

c. Browse to LabVIEW Interface for Arduino in the list of packages. (Check for the
latest version)

d. Click the Install &Upgrade Packages button.

e. Click Continue.

Department of Mechatronics Engineering College of EME NUST


Page 2 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

f. You will see a screen indicating that LabVIEW will be restarted. When you click okay,
LabVIEW will prompt you to save any open VIs as it is restarted.

g. Click Finish.

h. The LabVIEW Interface for Arduino is now installed on your system. Once the toolkit is
installed you can use VIPM to check for updates for it. When there is an update to the
toolkit the icon in VIPM will change to look like the image below. Clicking the Upgrade
Packages button will update the toolkit to the latest version.

You will now have access to the Arduino palette in LabVIEW. You can use this palette to interface
with the LabVIEW Interface for Arduino Firmware once it has been loaded onto your Arduino.
Alternative for step 4: Follow the link below
http://www.myclassbook.org/labview-interface-for-arduino/

Department of Mechatronics Engineering College of EME NUST


Page 3 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

5. Now you have to program the LIFA Firmware in Arduino to make it remote device. For that
purpose follow these steps (You can skip step 5 if you already have firmware installed in
Arduino)
a. Download Arduino IDE v1.0.5
http://arduino.googlecode.com/files/arduino-1.0.5-r2-windows.exe
if you already have some latest version of Arduino installed in your target machine, it
won’t allow you to install old version unless you uninstall the latest one.
One way of solving this problem is to use standalone version of this release of Arduino
IDE.
http://downloads.arduino.cc/arduino-1.0.5-r2-windows.zip
b. Follow these steps to install firmware in Arduino
i. Connect the Arduino Uno / Mega to your PC as described in KnowledgeBase
5INA7UYG: How do I Connect an Arduino Uno to my PC?.
ii. Install the LabVIEW Interface for Arduino toolkit as described in KnowledgeBase
5L38JQYG: How do I Install the LabVIEW Interface for Arduino Toolkit Using
VIPM?.

iii. Open the Arduino IDE by browsing to the folder that you extracted in step 1 and
double clicking arduino.exe

iv. The Arduino IDE will open. Click File»Open and browse to LIFA_Base.ino
found in C:\Program Files\National Instruments\LabVIEW
201x\vi.lib\LabVIEW Interface for Arduino\Firmware\LIFA_Base

Department of Mechatronics Engineering College of EME NUST


Page 4 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

v. Choose the Arduino board type by clicking Tools»Board»Arduino Uno

vi. Choose the COM port by clicking Tools»Serial Port and choosing the COM port
that corresponds to your Arduino Uno.

Department of Mechatronics Engineering College of EME NUST


Page 5 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

vii. You can determine the COM port that corresponds to your Arduino Uno using the
device manager by clicking Start»Control Panel»Device Manager and
expanding Ports(LPT & COM).

viii. Click the Upload button to upload the firmware to the Arduino Uno.

Department of Mechatronics Engineering College of EME NUST


Page 6 of 7
National University of Sciences & Technology
Course: MTS- 336 Instrumentation and Measurements
Lab Manual 11
Instructor: LE Muhammad Umar Masood

ix. The Arduino IDE should report Done Uploading when the firmware has been
successfully uploaded to the Arduino.

x. You are now ready to use the Arduino Uno with the LabVIEW Interface for
Arduino Uno. The LIFA toolkit contains a number of examples which can be
accessed through the functions palette; this is a great place to start.

6. Run LabVIEW on your machine. If you have done all the above steps correctly you will see the
following menu added in LabVIEW block diagram like this

7. It is done. Now you can program pretty much everything on Arduino using LabVIEW’s block
diagram coding. As a startup try this code

Department of Mechatronics Engineering College of EME NUST


Page 7 of 7

Anda mungkin juga menyukai