myrio overview

28
Hans-Petter Halvorsen http://home.hit.no/~hansha/?equipment=myrio 2016.08.17 myRIO Overview

Upload: vucong

Post on 19-Jan-2017

252 views

Category:

Documents


2 download

TRANSCRIPT

Page 1: myRIO Overview

Hans-PetterHalvorsen

http://home.hit.no/~hansha/?equipment=myrio

2016.08.17

myRIOOverview

Page 2: myRIO Overview

http://www.ni.com/myrio

http://home.hit.no/~hansha

myRIO Resources

http://home.hit.no/~hansha/?equipment=myrio

Page 3: myRIO Overview

HardwareOverview

Page 4: myRIO Overview

HardwareOverview• Wi-Fi• Three-axisAccelerometer• AudioIn/Out• USB• 4LEDs• 1PushButton• 3differentI/OConnectors(MXP:ConnectorA,B),MSP:ConnectorC)

• AnalogIn• AnalogOut• DigitalIn• DigitalOut• UART

Page 5: myRIO Overview

HardwareOverview

2MXP34pinsConnectors(A,B)

Analog/DigitalI/OConnector(C)

Page 6: myRIO Overview

QuickStart

1. InstallSoftware– LabVIEW– LabVIEWReal-TimeModule– LabVIEWmyRIOToolkit

2. ConnectyourmyRIOHardwaretotheUSBPortonyourPC3. Makesureyourdeviceisworkingproperly(followthewizard

thatpopsup)4. CreateasimpletestprograminLabVIEW

Page 7: myRIO Overview

SoftwareInstallation

ThefollowingSoftwareareneeded:1. LabVIEW2. LabVIEWReal-TimeModule3. LabVIEWmyRIOToolkit

www.ni.com/academic/download

www.ni.com/download

Youmaydownloadthesoftwarehere:

Page 8: myRIO Overview

GettingStartedWhenplugginginthemyRIOdevice,thefollowingwindowshouldpopup:

Page 9: myRIO Overview

GettingStarted– TesttheDevice

9

Page 10: myRIO Overview

WebConfiguringmyRIOdefaultIPAddress:172.22.11.2

JusttypetheIPAddress(172.22.11.2)inastandardWebBrowser

Page 11: myRIO Overview

MAXMAX– Measurement&AutomationExplorer

Page 12: myRIO Overview

Accessories

MXPBreadboard

IncludedwithmyRIOStarterKitorbuyseparately

Page 13: myRIO Overview

AccessoriesmyRIOStarterKit

Page 14: myRIO Overview

myRIOStarterKit• Barrelconnectorwithleads• Assortedcapacitors• Diodes• 7-segmentdisplay• Mechanicalrotaryencoder• Photointerruptor(lightsensorwithLED)

• Assortedop-amps• AssortedLEDs• SmallDCmotor(1VDCto3VDC,noloadspeed:6600rpm)

• Microphonewithaudiojack• MXPBreadboardAccessory

• Potentiometer(500kΩ)• Relay• Assortedresistors• Piezoelectricsensor• Photocell• 2Halleffectsensors(latchandswitch)

• Buzzer• Assortedswitches(DIP,slide,androtary)

• Thermistor(NTC:10kΩ,25degrees)

• Assortedtransistors• Forcesensingresistor• Wirekit

Page 15: myRIO Overview

AccessoriesmyRIOMechatronicsKit

Page 16: myRIO Overview

myRIOMechatronicsKitTheNImyRIOMechatronicsAccessoryKitincludesavarietyofcommonlyusedmotors,sensors,andcomponents.• Gearedmotor19:1(includesencoderforrotationandspeed,12V)

• Ultrasonicrangefinder(accuratereadingsof0in.to255in.or6.45m)

• Compass• Servomotor:standard(215degreesrotation)• Servomotor:continuousrotation• Accelerometer(3axis,digital- SPIandI2C)• H-bridgedriver(compatiblewithgearmotor)• Gyroscope(3axis,digital- SPIandI2C)• Infraredproximitysensor(10cmto80cm)• Ambientlightsensor(SPI)

Page 17: myRIO Overview

LEDExampleThissimpleexamplelightsaLEDontheBreadboardwhenpushingthebutton(BUTTON0)inthemyRIOdevice

BUTTON0ElectriccircuitthatmakestheLEDlight

Page 18: myRIO Overview

LEDExampleThissimpleexamplelightsaLEDontheBreadboardwhenpushingthebutton(BUTTON0)inthemyRIOdevice

Page 19: myRIO Overview

LEDExample

LabVIEWApplication:

Page 20: myRIO Overview

Add/RemoveSoftwareComponentsAdd/RemoveSoftwareusingMAX

Bydefault,onlyaminimumsetofSoftwarecomponentsareinstalled.Ifyoucreatemoreadvancedapplications,youmayneedtodownloadadditionalsoftwarecomponentsrunningonthedevice.

Page 21: myRIO Overview

PublishingData

SincemyRIOincludesWiFi,thedeviceisidealforPublishingDataoveraNetworkExamples:• OPC• WebService

MakesuretoAdd/InstalltheproperSoftwareComponentsonthemyRIOdevice

Page 22: myRIO Overview

OPC

YoucanusetheDataSocketfunctionsinordertocommunicatewithanOPCServer

Page 23: myRIO Overview

WebService

• WebServicesisamoremodernapproachthanOPC

• LabVIEWhasbuilt-infeaturesforcreatingWebServicesandconsumingWebServices

CreatingandAccessingaLabVIEWWebService:http://zone.ni.com/reference/en-XX/help/371361K-01/lvhowto/build_web_service

Page 24: myRIO Overview

DeployyourApplication

https://www.youtube.com/watch?v=JXoJECRS-eo&feature=youtu.be

• DuringdevelopmentyounormallyconnectNImyRIOtoyourcomputerwithaUSBcable.

• Afterdevelopmentiscompleteyoucaneasilydeployyourprojectasastand-aloneapplicationstoredonthemyRIOsolid-stateharddrivethatstartsautomaticallywhenyoupowerupthemyRIO

• NoUSBcablerequiredafterwards.

BuildaStand-AloneApplication

Step-by-stepprocedure:

Page 25: myRIO Overview

CommunicationProtocolsavailableonmyRIO

• UART(UniversalAsynchronousReceiver/Transmitter,)• ...– http://en.wikipedia.org/wiki/Universal_asynchronous_receiver/transmitter

• SPI(SerialPeripheralInterface)– ...– http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

• I2C(Inter-IntegratedCircuit)– ...– http://en.wikipedia.org/wiki/I2C

http://www.byteparadigm.com/applications/introduction-to-i2c-and-spi-protocols

Page 26: myRIO Overview

myRIO – SPIBus• SerialPeripheralInterface(SPI)isasynchronousserialdataprotocolusedby

microcontrollersforcommunicatingwithoneormoreperipheraldevicesquicklyovershortdistances.

• WithanSPIconnectionthereisalwaysonemasterdevice(usuallyamicrocontroller)whichcontrolstheperipheraldevices.

• SPIdevicescommunicateinfullduplexmodeusingamaster-slavearchitecturewithasinglemaster.

• TheinterfacewasdevelopedbyMotorolaandhasbecomeadefactostandard.• Typicalapplicationsincludesensors,SecureDigitalcards,andliquidcrystaldisplays

(LCD).

http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus

SCLK:SerialClock(outputfrommaster)MOSI:MasterOutput,SlaveInput(outputfrommaster)MISO:MasterInput,SlaveOutput(outputfromslave)SS(orSC):SlaveSelect(activelow,outputfrommaster)

https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi

Page 27: myRIO Overview

myRIO - I2CBus

http://en.wikipedia.org/wiki/I2C

• I²C(Inter-IntegratedCircuit),isamulti-master,multi-slave,single-ended,serialcomputerbus

• Itistypicallyusedforattachinglower-speedperipheralICstoprocessorsandmicrocontrollers.

• I²CistypicallyspelledI2C(pronouncedI-two-C)• TheI²Cbuswasdevelopedin1982byPhilipsSemiconductor.• TheI²Cprotocolrequiresonly2wiresforconnectingalltheperipheraltoamicrocontroller.

https://learn.sparkfun.com/tutorials/i2c

Page 28: myRIO Overview

Hans-PetterHalvorsen,M.Sc.

UniversityCollegeofSoutheastNorwaywww.usn.no

E-mail:[email protected]:http://home.hit.no/~hansha/