LabVIEW Internet Toolkit User Guide

整理文档很辛苦,赏杯茶钱您下走!

免费阅读已结束,点击下载阅读编辑剩下 ...

阅读已结束,您可以下载文档离线阅读编辑

资源描述

©1999–2004NationalInstrumentsCorp.Allrightsreserved.LabVIEW™,NationalInstruments™,NI™,ni.com™,andNIDeveloperZone™aretrademarksofNationalInstrumentsCorporation.Productandcompanynamesmentionedhereinaretrademarksortradenamesoftheirrespectivecompanies.ForpatentscoveringNationalInstrumentsproducts,refertotheappropriatelocation:Help»Patentsinyoursoftware,thepatents.txtfileonyourCD,orni.com/patents.January2004323747A-01LabVIEWInternetToolkitUserGuideVersion6.0TheLabVIEWInternetToolkitprovidesyouwiththeabilitytoincorporateInternetcapabilitiesintoVIs.YoucanuseLabVIEWtoworkwithXMLdocuments,buildCGIprogramsandURLs,andsendandreceivedata.TheInternetToolkitincludesthefollowingcomponents:•XMLDOMParserandVIs—Create,access,andeditXMLdocumentsinLabVIEW.CGIVIs—BuildCGIprogramsandmanageclientstateinformation.GWebServer—PublishVIstotheWebandhostCGIapplications.Onlineexamples—LearnhowtobuildanduseCGIVIsbyreviewingonlineexampleVIsthatyoucanrunfromtheGWebServer.URLClientVIs—ParseandbuildURLsanddownloaddatafromInternetservers.FTPVIs—StoreandretrievefilesfromFTP(FileTransferProtocol)servers.TelnetVIs—SendandreceivedatausingtheTelnetprotocol.RefertotheLabVIEWHelpformoreinformationabouttheURLClientVIs,FTPVIs,andTelnetVIs.ContentsUpgradingfromVersion5.0...................................................................2GettingStartedwiththeXMLDOMParser...........................................2UsingXMLDOMParserVIs..........................................................3ValidatingXMLDocuments...........................................................3ConfiguringtheXMLDOMParser.................................................4UsingCGIinLabVIEW.........................................................................5MaintainingClientStateInformationwithCGIVIs.......................6UsingClient-SideCookies...............................................................7UsingServer-SideCookies..............................................................7GettingStartedwiththeGWebServer..................................................8™ni.comLabVIEWInternetToolkitUserGuide2ni.comConfiguringtheGWebServer.........................................................9RunningtheGWebServer...............................................................10ViewingOnlineExamples................................................................12ExaminingOnlineCGIExamples.............................................12DisplayingtheGWebServerWindowinDetailedMode...............13UsingCGIVIswiththeGWebServer............................................15PublishingFrontPanelImageswiththeGWebServer...................15WheretoGofromHere...........................................................................15UpgradingfromVersion5.0TheInternetToolkitversion6.0containsthefollowingchangesfromversion5.0:YoucanusetheInternetToolkitversion6.0onlywithLabVIEWversion7.0orlater.YoucanselectoneoftwodifferentmodestoruntheGWebServer.Inindependentmode,theGWebServerrunsonaportdifferentfromtheoneonwhichtheLabVIEWWebServerruns.Inshared-portmode,theGWebServersharesaportwiththeLabVIEWWebServerandhandlesonlyCGIrequests,whiletheLabVIEWWebServerhandlesotherrequests.RefertotheConfiguringtheGWebServersectionformoreinformationaboutselectingmodesfortheGWebServer.YoucanuseXMLDOMParserfeaturestoread,write,orprocessXMLdocuments.RefertotheGettingStartedwiththeXMLDOMParsersectionformoreinformationaboutusingXMLfeaturesinLabVIEW.YoucanfindtheSMTPE-mailVIsontheFunctionspaletteintheFullandProfessionalDevelopmentSystemsofLabVIEWversion7.0.ThefilenamesfortheseVIchangedslightly.TheInternetToolkitincludescompatibilitylibrariesthatautomaticallyreplacetheversion5.0VIswiththeLabVIEW7.0VIswhenyouopenaVIthatcontainstheolderversionoftheSMTPE-mailVIs.GettingStartedwiththeXMLDOMParserXML(ExtensibleMarkupLanguage)isaplatform-independentsubsetofSGML(StandardGeneralizedMarkupLanguage)thatyoucanusetostoreandexchangeinformation.WhenyouworkwithXMLdocuments,youcanuseaparsertoextractandmanipulatedatawithouthavingtotranslatetheXMLformatdirectly.Forexample,theDOM(DocumentObjectModel)Corespecificationdefinesaprogramminginterfaceforcreating,reading,andmodifyingXMLdocuments.TheDOMCorespecificationdefinesthepropertiesandmethodsthatanXMLDOMParsermustsupport.©NationalInstrumentsCorporation3LabVIEWInternetToolkitUserGuideTheInternetToolkitincludesanXMLDOMParserandapaletteofXMLDOMParserVIsthatyoucanusetoread,write,orotherwisemanipulateXMLdocuments.UsingXMLDOMParserVIsTheInternetToolkitXMLDOMParserVIsallowyoutoaccessacross-platformXMLDOMParserinLabVIEW,asshowninthefollowingexample.TheXMLOpenVIopensanXMLDOMParsersessionandreturnsanXMLDocumentreference.YoucancreateanXMLdocument,loadanexistingdocumentintotheXMLDOMParser,orconfiguredocumentsettings.Tomanipulateanexistingfile,usetheLoadFilemethodtoloadtheXMLdocumentintomemory.TheXMLdocumentisaccessibleunlesstheXMLDOMParserencounterserrorswiththedocument.UsetheGetXMLmethodtopopulateastringwiththecontentsofthecurrentXMLobject.Inthisexample,theXMLContentindicatordisplaysthe

1 / 16
下载文档,编辑使用

©2015-2020 m.777doc.com 三七文档.

备案号:鲁ICP备2024069028号-1 客服联系 QQ:2149211541

×
保存成功