raspberry pi with labview linx - telemark university …home.hit.no/~hansha/documents/lab/lab...
TRANSCRIPT
Raspberry PiwithLabVIEWLINX
Contents:v Informationv Softwareinstallationv Raspberry Pi2/3setupv LabVIEWinstallation on Raspberry Pi2/3v Connecting toRaspberry Pi2/3v Uploading «Blink»example toRaspberry Pi2/3v Running «Blink»examplev Uploading «Temp_test»example toRaspberry Pi2/3v Running «Temp_test»example
v Information
Important:
AnOS(operatingsystem)mustbeinstalled on theRaspberry Pi2/3before LabVIEWcan beuploaded!
RecommendedOS:Ø Raspbian
(https://www.raspberrypi.org/downloads/raspbian/)AlternativeOS:Ø NOOBS(NewOutOftheBoxSoftware)
(https://www.raspberrypi.org/downloads/noobs/)
v Information
Software:Ø LabVIEW2014SP1
(http://www.ni.com/download/labview-for-education-2014-sp1/5281/en/)Ø LabVIEW2015/2016*
(http://www.ni.com/download/labview-development-system-2016/6046/en/)
Ø VIPackage Manager(LINX)(http://ftp.ni.com/evaluation/labview/lvtn/toolkits/jki/vipm-windows.exe)
v Information
*Can notbeusedforuploading VI’s toRaspberry PI
Hardware:ØRaspberry Pi2/3ØEthernetcableØMiniusb cableØRouter/Hub
Retailers :Ø (http://no.rs-online.com/web/)Ø (http://www.ebay.com/)(Recommended)
v Information
v Softwareinstallation
v Softwareinstallation
Installationorder:Ø LabVIEW 2014Ø Real-Time-2014Ø VISAØ Linx
1. MountLV4E2014SP1-Win.iso
v Softwareinstallation
2. Navigate toLabVIEW2014folder3. Runsetup
v Softwareinstallation
1. NavigatetoLabVIEW2016folder*2. Runsetup
v Softwareinstallation
*Optional
1. Install VIPackage Manager2. OpenVIPackage Managerandsearch for«Linx»
v Softwareinstallation
2. Choose toinstall «Digilent Linx»on LabVIEW 20143. Install then forLabVIEW 2016*
v Softwareinstallation
*Optional
v Raspberry Pi2/3setup
Alternativ1:Usingarouter (recommended)1. Connectthe Raspberry Pi2/3toarouter
using anEthernetcable2. Powerupthe Raspberry Pi2/3using the
mini-usb cable
v Raspberry Pi2/3setup
Alternativ2:Directly toPC1. Follow the instructions on this page:
(http://www.instructables.com/id/Direct-Network-Connection-between-Windows-PC-and-R/)
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
1. Create anew «BlankProject»inLabVIEW 2014(Not2015/2016)
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
2. Configurate Linx target(Tools->MakerHub ->Linx ->Linx TargetConfiguration…)
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
3. ConnecttoTarget(EnterIPaddress,username andpassword)
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
Note;Ifyou dontknow the IPaddressfollow these instructions:(https://www.raspberrypi.org/documentation/remote-access/ip-address.md)
4. Click «Install software»and«Install»
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
5. When completed,click «OK»(LabVIEWRun-Timeisnow installed on the Raspberry Pi2/3)
v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3
v Connecting toRaspberry Pi2/3
1. Add anew «TargetandDevices»(RightClick Project->New->TargetandDevices)
v Connecting toRaspberry Pi2/3
2. Select«Newtargetordevice»andLinx «Raspberry Pi»
v Connecting toRaspberry Pi2/3
Note:IfLINXfolderisnotavailable(notshowing),goto;«ProgramFiles(x86)\NationalInstruments\LabVIEW2014\vi.lib\MakerHub\LINX\Resources»andextract«LinxProvider2014.zip»into«ProgramFiles(x86)\NationalInstruments\LabVIEW2014»folder.
Overwritefilesifaskedfor
3. Rightclick «Raspberry Pi2B»andselect «Properties»
v Connecting toRaspberry Pi2/3
4. Insert the «IPaddress»(andchange «Name»if wanted)
v Connecting toRaspberry Pi2/3
5. Rightclick «Raspberry Pi»andthen «Connect»
v Connecting toRaspberry Pi2/3
6. There should now beagreenlight(indicator)showingon the rightsideof the «Raspberry Pi»icon
v Connecting toRaspberry Pi2/3
v Uploading «Blink»example toRaspberry Pi2/3
1. Click on «Help»and«Find Example»
v Uploading «Blink»example toRaspberry Pi2/3
2. Search for«Linx»andselect «Linx – Blink(Advanced).vi»
v Uploading «Blink»example toRaspberry Pi2/3
3. Inthe block diagram;Remove «Serialport»(redcross)andchange inputfrom«Serial»to«Local I/O»(blue arrow)
v Uploading «Blink»example toRaspberry Pi2/3
4. Inthe frontpanel;Change inputfrom«13»to«7»5. Rightclick andselect «Makecurrent value default»
v Uploading «Blink»example toRaspberry Pi2/3
5. Savethe .VIandname itBlink_test(File->Saveas->Rename ->«Blink_test»)
v Uploading «Blink»example toRaspberry Pi2/3
6. Draganddrop the .VIinto «Raspbery Pi3»7. Add new Real-TimeApplication
(Rightclick «Build specifications»->«New»->«Real-TimeApplications»)
v Uploading «Blink»example toRaspberry Pi2/3
8. Name the build specification «Blink»
v Uploading «Blink»example toRaspberry Pi2/3
9. Setthe .VIas«Startup Vi»(Sourcefiles->Select.VIandclick blue arrow )
v Uploading «Blink»example toRaspberry Pi2/3
10. Build the .VI(Rightclick on .VIunder«Build specifications»andclick «Build»)
v Uploading «Blink»example toRaspberry Pi2/3
11. Setthe built .VIasstartup(Rightclick on .VIunder«Build specifications»andclick «Runasstartup»)
v Uploading «Blink»example toRaspberry Pi2/3
12. Rebot the target(Raspberry Pi)(Click «Yes»when promoted toreboot the target)
v Uploading «Blink»example toRaspberry Pi2/3
v Running the «Blink»example
1. Remove the Ethernetcable2. Connect/build asshown below3. Powerupthe Raspberry Pi2/3(miniusb)4. Confirm that the LEDisblinking!
v Running the «blink»example
v «Temp_test»example using TMP36
v «Temp_test»example using TMP36
«Temp_test example»Ø Temp_test.viØ Convert_ADC_Voltage.viØ Gen_bytes.viØ V_to_degrees
1.Build the .viexample shown below:
v Uploading «Temp_test»example toRaspberry Pi2/3
1. Draganddrop the Temp_test.VI(andits subVI’s)into «Raspbery Pi3»2. Add new Real-TimeApplication3. Set«Temp_test»asstartup VIandthe subVI’s asAlways included4. Setthe built .VIasstartup andrebot the target(Raspberry Pi)
v Uploading «Temp_test»exampletoRaspberry Pi2/3
v Runningthe«Temp_test»example
1. Remove the Ethernetcable2. Connect/build asshown below3. Powerupthe Raspberry Pi2/3(miniusb)
v Running the «Temp_test»example
Datasheet forMCP3002:(http://www.ee.ic.ac.uk/pcheung/teaching/ee2_digital/MCP3002.pdf)
Datasheet forTMP36:(http://http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf)
4. Confirm that the temperature displayed inthe frontpaneliscorrect(using areference,forexample a«multimeter»)
v Running the «Temp_test»example
Formoreinformation:
LINXTutorials:Ø https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:start
Forums:Ø https://www.labviewmakerhub.com/forums/viewforum.php?f=12