Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab...

50
Raspberry Pi with LabVIEW LINX

Transcript of Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab...

Page 1: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

Raspberry PiwithLabVIEWLINX

Page 2: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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

Page 3: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Information

Page 4: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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

Page 5: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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

Page 6: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

Hardware:ØRaspberry Pi2/3ØEthernetcableØMiniusb cableØRouter/Hub

Retailers :Ø (http://no.rs-online.com/web/)Ø (http://www.ebay.com/)(Recommended)

v Information

Page 7: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Softwareinstallation

Page 8: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Softwareinstallation

Installationorder:Ø LabVIEW 2014Ø Real-Time-2014Ø VISAØ Linx

Page 9: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. MountLV4E2014SP1-Win.iso

v Softwareinstallation

Page 10: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

2. Navigate toLabVIEW2014folder3. Runsetup

v Softwareinstallation

Page 11: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. NavigatetoLabVIEW2016folder*2. Runsetup

v Softwareinstallation

*Optional

Page 12: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. Install VIPackage Manager2. OpenVIPackage Managerandsearch for«Linx»

v Softwareinstallation

Page 13: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

2. Choose toinstall «Digilent Linx»on LabVIEW 20143. Install then forLabVIEW 2016*

v Softwareinstallation

*Optional

Page 14: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Raspberry Pi2/3setup

Page 15: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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/)

Page 16: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3

Page 17: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. Create anew «BlankProject»inLabVIEW 2014(Not2015/2016)

v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3

Page 18: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

2. Configurate Linx target(Tools->MakerHub ->Linx ->Linx TargetConfiguration…)

v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3

Page 19: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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)

Page 20: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

4. Click «Install software»and«Install»

v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3

Page 21: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

5. When completed,click «OK»(LabVIEWRun-Timeisnow installed on the Raspberry Pi2/3)

v LabVIEWRun-Timeinstallasion onRaspberry Pi2/3

Page 22: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Connecting toRaspberry Pi2/3

Page 23: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. Add anew «TargetandDevices»(RightClick Project->New->TargetandDevices)

v Connecting toRaspberry Pi2/3

Page 24: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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

Page 25: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

3. Rightclick «Raspberry Pi2B»andselect «Properties»

v Connecting toRaspberry Pi2/3

Page 26: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

4. Insert the «IPaddress»(andchange «Name»if wanted)

v Connecting toRaspberry Pi2/3

Page 27: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

5. Rightclick «Raspberry Pi»andthen «Connect»

v Connecting toRaspberry Pi2/3

Page 28: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

6. There should now beagreenlight(indicator)showingon the rightsideof the «Raspberry Pi»icon

v Connecting toRaspberry Pi2/3

Page 29: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Uploading «Blink»example toRaspberry Pi2/3

Page 30: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. Click on «Help»and«Find Example»

v Uploading «Blink»example toRaspberry Pi2/3

Page 31: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

2. Search for«Linx»andselect «Linx – Blink(Advanced).vi»

v Uploading «Blink»example toRaspberry Pi2/3

Page 32: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

3. Inthe block diagram;Remove «Serialport»(redcross)andchange inputfrom«Serial»to«Local I/O»(blue arrow)

v Uploading «Blink»example toRaspberry Pi2/3

Page 33: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

4. Inthe frontpanel;Change inputfrom«13»to«7»5. Rightclick andselect «Makecurrent value default»

v Uploading «Blink»example toRaspberry Pi2/3

Page 34: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

5. Savethe .VIandname itBlink_test(File->Saveas->Rename ->«Blink_test»)

v Uploading «Blink»example toRaspberry Pi2/3

Page 35: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

6. Draganddrop the .VIinto «Raspbery Pi3»7. Add new Real-TimeApplication

(Rightclick «Build specifications»->«New»->«Real-TimeApplications»)

v Uploading «Blink»example toRaspberry Pi2/3

Page 36: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

8. Name the build specification «Blink»

v Uploading «Blink»example toRaspberry Pi2/3

Page 37: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

9. Setthe .VIas«Startup Vi»(Sourcefiles->Select.VIandclick blue arrow )

v Uploading «Blink»example toRaspberry Pi2/3

Page 38: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

10. Build the .VI(Rightclick on .VIunder«Build specifications»andclick «Build»)

v Uploading «Blink»example toRaspberry Pi2/3

Page 39: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

11. Setthe built .VIasstartup(Rightclick on .VIunder«Build specifications»andclick «Runasstartup»)

v Uploading «Blink»example toRaspberry Pi2/3

Page 40: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

12. Rebot the target(Raspberry Pi)(Click «Yes»when promoted toreboot the target)

v Uploading «Blink»example toRaspberry Pi2/3

Page 41: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Running the «Blink»example

Page 42: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

1. Remove the Ethernetcable2. Connect/build asshown below3. Powerupthe Raspberry Pi2/3(miniusb)4. Confirm that the LEDisblinking!

v Running the «blink»example

Page 43: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v «Temp_test»example using TMP36

Page 44: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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:

Page 45: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Uploading «Temp_test»example toRaspberry Pi2/3

Page 46: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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

Page 47: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

v Runningthe«Temp_test»example

Page 48: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

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)

Page 49: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

4. Confirm that the temperature displayed inthe frontpaneliscorrect(using areference,forexample a«multimeter»)

v Running the «Temp_test»example

Page 50: Raspberry Pi with LabVIEW LINX - Telemark University …home.hit.no/~hansha/documents/lab/Lab Equipment/Raspberry Pi... · Contents: v Information v Software installation v RaspberryPi

Formoreinformation:

LINXTutorials:Ø https://www.labviewmakerhub.com/doku.php?id=learn:tutorials:libraries:linx:start

Forums:Ø https://www.labviewmakerhub.com/forums/viewforum.php?f=12