06 LabVIEW Interface For Arduino (LIFA)
06 LabVIEW Interface For Arduino (LIFA)
06 LabVIEW Interface For Arduino (LIFA)
Why LIFA?
There are many reasons LabVIEW makes you more productive when using Arduino:
Open API allows for complete customization -- customize your programs to fit
your application.
Introduction
The labview interface for arduino is a vi based API that was written and distributed by
national instruments. The code also includes and arduino embedded program which must
be downloaded to the device. This program which runs on the Arduino, responds to
commands sent on the USB bus from the LabVIEW program. It then sends back data to
the the computer via the USB.
The LabVIEW VIs provided, allow you to read back the analog inputs, control the digital
IO lines and use several other features of the Arduino hardware.
Figure.1
After select the LIFA press the install icon.
2. Install NI-VISA Drivers. To LabVIEW, the arduino appears as a serial instrument device.
To communicate with serial instruments in LabVIEW, you need to have the latest version
of the NI-VISA driver. You can get the latest NI_VISA driver from
http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:d
u,n8:3.1637,ssnav:sup/.
3. Upload the sketch LIFA_Base.pde to the Arduino. The LIFA comes with a sketch
program that must be uploaded to the Arduino before you can use the VIs to
communicate with it. You must use the Arduino IDE software to do this.The sketch is
located at:
o C:\Program Files\National Instruments\LabVIEW 2011\vi.lib\LabVIEW Interface
for Arduino\Firmware\LVIFA_Base\LVIFA_Base.pde
Procedures
A.load example in order to be more familiar with LIFA
From C:\Program Files\National Instruments\LabVIEW 2011\examples\LabVIEW Interface for
Arduino open the Arduino RGB LED.VI the front panel will be same as figure 2.a and block
diagram will same as figure 2.b
Figure 2.a
Figure 2.b
Run the application then you will note that the Tx and Rx LED start blinking, which means there is
a communication start with arduino. After that change the RGB bars in the front panel and notice
the RGB LED color.
B.Array example
In this example you will be use two binary arrays in as indicator and the other as control.
To add array: Front panel >> Modern >> Array, Matrix >> array.
To make it a control binary array drags and drops a switch in it.
To make it a indicator binary array drags and drops a switch in it.
To re size the array graphically.
Connect the output voltage of the LDR voltage divider circuit to analog bin 0 of Adriano. Then
build the following example.
In this part You have to build a 12 bits light detection security key using a LDR with Arduino and
Labview ,where you will insert the password using the LDR if it detects a light it will be a one
otherwise it will be zero.
Use for loop to get the data from arduino and store them in binary array.
System needs a trigger to start reading. (you can use a Ok button with case structure).
If the password is correct, then a green light is on. Else a red one is on.
Note:
LVIFA_Base folder is attached to the experiment please use them.
Lab Report:
1. Report as described in the Lab Policies.
2. Screen Shots of the Block Diagram and Front Panel windows where only
these windows and their title bars and nothing else are visible. Points will be
deducted if the components are not clearly visible in these windows or of any of
the Windows screen components like the Start Button or Task Bar are visible.