Remote Connectivity Demo Script labview移动化教程.docx
《Remote Connectivity Demo Script labview移动化教程.docx》由会员分享,可在线阅读,更多相关《Remote Connectivity Demo Script labview移动化教程.docx(29页珍藏版)》请在冰豆网上搜索。
RemoteConnectivityDemoScriptlabview移动化教程
LabVIEW
RemoteConnectivitywithLabVIEW
DemoScriptVersion1.0,February2013
GrantHeimbach,LabVIEWProductMarketingManager
grant.heimbach@
512-683-5862(work)
512-944-0128(personalcell)
RemoteFrontPanelDemo2
DataDashboardDemo7
HTML/JavascriptDemo16
MoreInformation24
TodownloadacopyofthismanualandthelatestversionofLabVIEWcodereferencedintheexercises,pleasevisit:
andsearchforthepresentationtitle.
RemoteFrontPanelDemo
Goal/目标
TheprimarypurposeofthisdemoistoshowhoweasyitistocreateaRemoteFrontPanelandhowitfunctions./最初目的用于如何容易地创建出远程前面板并使用其功能
Scenario/方案
Thepresentation/陈诉justtalkedthroughthebasicscenariooflocalmonitoring.AquickandeasyoptionispreferredsoRemoteFrontPanelswerethebestsolutioninthisscenario.Thefictional/虚构的customerinthescenariohasanexistingapplicationandwewillbebuildingaRemoteFrontPanelforitsoitcanberemotelyinteractedwith.
ConceptsCovered
∙SettingupLabVIEWenvironmentaloptionsforRemoteFrontPaneluse
∙StartingfromoneofthenewSampleProjectsinLabVIEW2012
∙CreatingaRemoteFrontPanelfromaMainVIwithinaproject
∙Talkingtothepoint(notshowing)howitcouldthenbebuiltintoanexecutable/可执行的ortransferredtoareal-timeoperatingsystem
Setup
∙TheRemoteFrontPanelserverintheLabVIEWenvironmentaloptionsneedstobeturnedonandLabVIEWrestartedafterenablingit.Leaveallthedefaultsettingsandjustclickthecheckbox.
∙Createanewinstance/实例oftheContinuousMeasurementandLoggingSampleProjectinLabVIEW2012(orlater).CallitwhateveryouwouldlikebuthavetheLabVIEWprojectopenandreadybeforebeginningthepresentation.WewillbeshowinghowtheSampleProjectfunctionsandcreatingtheRemoteFrontPanelfortheMainVI.
1.ShowhowtoenabletheRemotePanelserverintheLabVIEWenvironmentaloptions
a.OpenLabVIEWandgotoTools>>Options
b.GototheWebServercategory
c.Showthe“EnableRemotePanelServer”checkboxisenabled(thisjustbedonebeforethepresentation)
d.LeavetheotheroptionsasdefaultbutthisiswhereyouwouldchangetheportthatitusestocommunicatethroughorenableSSLsecurity.
2.ShowhowtheContinuousMeasurementandLoggingSampleProjectworks
a.OpentheMain.VIfromtheproject
b.Showtheblockdiagramtoexplainthatthisisascalable/可升级的andcustomizablearchitecture/可重用结构
c.RuntheVIandhittheStartbuttontogetthesinewaveonthegraphandthenclicktheStopbutton
d.ClicktheSettingsbuttonandchangefromSignalTypefromSineWavetoSquarewithNoiseandthenclicktheStartbuttonagaintoshowtheothersignal.
e.ClicktheStopbuttonandthentheExitbuttontostoptheVIfromrunningbutleavethefrontpanelopen.
3.CreatetheRemoteFrontPanelhtmlpagethatwillbeinteracted/沟通,交流withremotely
a.FromtheMain.VIfrontpanel,gotoTools>>WebPublishingTool.Thiswizardwillwalkthroughthestepsofscrapingthefrontpanelandcreatingcorresponding/对应的HTMLcodeforyou.
b.UndertheVINamedropdown,selecttheMain.VIintheprojectfileinstance.Youcanrunintoproblemsifyoudon’topentheMain.VIfromtheprojectfileandthenchooseitfromthedropdown.IfyoujustcreateaRemoteFrontPanelbyopeningaVIondiskandgoingthroughthewizard,LabVIEWisn’tawareofallthedependencies/属性needed.OpeningitfromtheLabVIEWprojectgetsaroundthisissue.
c.PointoutthedifferentViewingModeoptions.Embeddedisformonitoringandcontrol.Snapshotwilljustshowastaticimageofthefrontpanel.MonitordoesthesamethingasSnapshotbutautomaticallyrefreshesthebrowseratgiveninteveralstogetnewinformation.PointoutthattheHelpbuttonhasreallygoodhelpforcreatingRemoteFrontPanels.Leaveallthesettingsasdefault(i.e.Embedded)andclickNext.
d.Onthenextpage,youcanchangetheTitle,Header,andFooterifyouwanttoandseeitupdateinthepreviewwindowbutIleaveitasdefaultandmoveon.
e.Onthenextpage,pointoutthatthelocaldirectorybeingusedbydefaultisthe“www”folder.ThisisspecifiedintheTools>>Options>>WebServercategorythatweshowedearlier.TheRemotePanelserverissetuptolookinthe“www”folderbydefaultsojustchangetheenvironmentalsettingsyouwanttostoretheHTMLfileinadifferentlocation.IfyoumovetheHTMLfilefromthefolderthattheRemotePanelServerislookingforthenitwon’twork.Thefilenameshouldbeleftasdefault.PointoutthatthefilenamereferencesthatMain.VIisinaProjectunderMyComputer.IfaVIwasopenedfromthelocaldiskinsteadoffromaproject(anditneededotherfileswithintheprojecttorun),thisformattingwouldneedtobeaddedmanuallytothefilenamesectionfortheRemoteFrontPaneltowork.ThisiswhyopeningtheVIintheprojectisbetterbecauseLabVIEWhandlesitforyou.TheURLiscreatedfromthefilenameandisnotcustomizable.ClicktheSavetoDiskbuttonandthentheConnectbutton.
f.SincetheMain.VIshouldstillbeopenfrombefore(andthereforeinmemory),theRemoteFrontPanelshouldshowthefrontpanelinthebrowser.IfitsaysthattheVIisnotinmemorythenopentheMain.VIfromthesampleprojectandrefreshthebrowser.RuntheVIagainandshowthatthewebbrowserisupdatingwithinformation.TrytoclicktheStopbuttoninthewebbrowserandshowyoucannotpressit.Right-clickontheRemoteFrontPanelandchoose“RequestControlOfVI”.YoucannowclicktheStopbuttonandotherwiseinteractwiththeVIremotely.ShowtheMain.VIfrontpanelanditsmessagethatcontrolhasbeentransferred.Ifauserdoesn’twantpeopletocontroltheVI,thentheycanright-clickontheMain.VIandchoose“LockControl”whileitisrunningoruseSnapshotorMonitoroptionsinsteadofEmbedded.IfsomeoneelseiscontrollingtheVIwhenyourequestcontrol,theywillgetamessageaskingwhethertheywanttotransfercontrolandtoclickyesorno.
g.IfsomeoneelseonthenetworkwantedtointeractwiththeMain.VI,theywouldjustchangetheURLtopointtothemachineIPAddresswheretheHTMLfileandRemotePanelServerwere.
h.IfsomeonewantedtocreatethisforacRIO,thenyouwouldaddittotheprojectfileunderthetargetinformation,configuretheremotepanelserveronthecRIObyright-clickingonthetargetandgoingintoProperties,andthenbuildthereal-timeexecutablewiththeHTMLfileintheAlwaysIncludedsection.TheRemotePanelServersoftwarecomponentwouldneedtobeinstalledonthecRIOthroughMAX(normalsoftwareinstallwizard).Thereisatutorialonwalkingthroughthesestepssocustomerscanjustsearchfor“real-timeremotefrontpanel”tofinditlater
i.IMPORTANT:
TellcustomersthatremotefrontpanelslicensesarenolongerneededinLabVIEW2012andlater.Beforeyouhavetopurchaseextralicensesforeverytabthatwasopenatatime.ThisshouldbewellreceivednewsfromanycustomersthathavedealtwithRemoteFrontPanelsinthepast.
DataDashboardDemo
Goal
TheprimarypurposeofthisdemoistoshowhowwebservicesarecreatedandoperateandalsohowDataDashboardcaninteractwithrunningLabVIEWcode
Scenario
Thepresentationjusttalkedthroughtheremoteaccessscenario.SomethingsecurebutstillrelativelyeasytocreatewaspreferredsoLabVIEWWebServicesandDataDashboardwaschosen.ThefictionalcustomerhasanexistingLabVIEWapplicationthatwe’lladdawebservicetoandthenlinkDataDashboardtothat.
ConceptsCovered
∙SettingupLabVIEWenvironmentaloptionsforLabVIEWWebServiceuse
∙CreatingaLabVIEWWebServicethatcanhandlerequestsfromtheoutsideworldandcommunicatewiththeseparaterunningLabVIEWcode
∙CreatingadashboardinDataDashboardthatcaninteractwithaLabVIEWWebService
∙Talkingtothepoint(notshowing)howwebservicescouldrunonreal-timetargetsorbuiltintoanexecutable.
Setup
∙TheWebserverintheLabVIEWenvironmentaloptionsneedstobeturnedonandwholecomputerrestartedifit’snotalreadyturnedon.GotoTools>>Options>>WebServerinLabVIEWandthenclicktheConfigureWebApplicationServerbutton.ThiswillopentheWebInterface(thisiswhattheoverallsettingspageiscalled)whereyoucanconfiguretheserver.
∙GototheWebServerConfigurationpage(clickthebuttonontheleftthathasaPCandGlobeimage).ClicktheLoginbuttoninthetoprightcornerandputintheusername“admin”andleavethepasswordblank.MakesurethattheSystemWebServerandtheApplicationWebServerareEnabledandiftheyarenotthendoso.Leavetheothersettingsasdefault.AfterEnablingforthefirsttime,youwillbepromptedtorestartthecomputer.Keepthispageopenaswewillbeshowingittocustomersduringthisdemo.
∙MakesurethattheiPadissetupproperlyandthedashboardhasbeenimported.IfyouopentheDataDashboardappontheiPad.IfyouclicktheNIcloudiconatthetopandthenclicktheManagemyAccountbutton.Usetheusernamedatadashboard.nic@andthepassword“welcomenic”.Oncetheaccountissignedin,clicktheNIcloudiconagainandchooseImportfromNICloudandthenimporttheDataDashboardDemodashboard.
1.ShowhowtoenablethewebserverthroughtheLabVIEWenvironmentaloptionsandtheWebInterface
a.OpenLabVIEWandgotoTools>>Options
b.GototheWebServercategory
c.Clickthe“ConfigureWebApplicationServer”buttontoopentheWebInterface.Thiscanalsobeaccessedbytypinghttp:
//localhost:
3580intothewebbrowser.
d.Showthateverythingisenabledandthewebserverp