組態(tài)王與AB PLC通過OPC的連接_第1頁
組態(tài)王與AB PLC通過OPC的連接_第2頁
組態(tài)王與AB PLC通過OPC的連接_第3頁
組態(tài)王與AB PLC通過OPC的連接_第4頁
組態(tài)王與AB PLC通過OPC的連接_第5頁
已閱讀5頁,還剩4頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領

文檔簡介

組態(tài)王與ABPLC的連接。RockwellAutomation的A-BPLC是一個著名的可編程控制器產(chǎn)品。其產(chǎn)品體系基本上涵蓋了工業(yè)控制產(chǎn)品的各個領域,并以產(chǎn)品的可靠而著稱。在國內(nèi)的PLC市場的占有率將近30%o由于A-B的PLC的種類繁多,且各種類型的PLC支持的通信協(xié)議不盡相同,使得第三方的HMI軟件都不能很好的與A-BPLC進行連接。RSLhix軟件是A-BPLC通用的通信配置軟件(2.2以上的版本支持對以太網(wǎng)的網(wǎng)關配置),目前主要有以下幾個版本:RSLhixOEM.RSLnixProfessional、RSLnixGateway>RSLnixSDK四個版本。且均支持0?(3服務(2.3版以上支持OPC2.0版)。組態(tài)王軟件己內(nèi)嵌了OPC服務功能,支持OPC客戶端和OPC服務器的工作方式。這樣組態(tài)王就可以很方便的與A-BPLC進行通信。具體的配置方法如下:在組態(tài)王與A-BPLC進行OPC的配置是必須要有A-BPLC及相關的通訊附件。1、 安裝A-BPLC、通訊卡、相關的軟件,并作物理連接2、 使用RSLuix連接A-BPLC的通訊網(wǎng)絡。配置通訊卡(參加圖-1),選擇ConFigureDrivers□冉EiX? 心?寸Qonnuni3ons DDE/orccvity"nAEUvlp函Alj匹WhoAxatokx-ovx?GojiiicurcIirivcr^.函Alj匹WhoAxatokx-ovx?GojiiicurcIirivcr^.-.FAtion.CeiLftswolewti..?Cli?nI oxax...C*?71X&<UC-?CXEOpt3-2M...JlrxvwrDx.11<i..SiBcnaxtio...Gj?匕Dinrxioxtjc:x.圖J彈出入下的配置窗I1(參見圖?2)。圖?2選擇對應的通訊卡,并進行端II配置(可參照附帶的安裝手冊),配置成功后將顯示所配置的設備的運行狀態(tài)。使用RSWho命令查找連接的PLC設備(參見圖.3)。留?BSLnech~chs5i?Md-〔浴幫s-幻PClym園刨旦圓!£STT>.3PClym園刨旦圓!£STT>.3〔gti£ur?OriYflrx...C-*4*w裾:_FH,XC?Ttiei?C-*4*w裾:_FH,X舌LDgyPlusCmHcut,C】】fl知舌LDgyPlusC<mfi<ur?CIPCpitircx>c<r:ti^JTt- .Bnwrm皿mw.-CJPD>3c?..7i?CJirTtic?參見圖?3RSWho命令成功的執(zhí)行后,將在設備列表中列出與本機連接的所有硬設備。使用TopicConfigoration來進行OPC服務的配置(參見圖.4)。在DateSource配置框中配置Topic,選擇一個物理設備(PLC),按New按鈕即可建立一個Topic,單擊Done即可(參見圖.5)。圖?圖?53、在組態(tài)王中建立y與OPC設備的連接。添加OPC設備。在組態(tài)王的工程器中選擇設備3OPC服務器3新建,則彈出如下的窗I1(參見圖-6)。在OPC服務器列表中選擇RSLinxOPCServer—選擇確定即可。OPC新建…-0表&史諾咤充詞也電站艮并污陀敏陀肥陀腎血體而分方3;主佝揖客V.1財V-5巴童OPC新建…-0表&史諾咤充詞也電站艮并污陀敏陀肥陀腎血體而分方3;主佝揖客V.1財V-5巴童-CJ衍沔?黃幽史沽尸卬向?qū)⒕勖贩抢?{散報EcacaDIIteOFCFJxflie.技報歷用用打-C5*葩皆§日迥第由張帽>>如3IE1譬%sw£、翌afuKftsreBBs&ui參見圖-6在數(shù)據(jù)字典里加入IO點(參見圖-7)在組態(tài)王的工程器中選擇數(shù)據(jù)庫今數(shù)據(jù)字典3新建。確定變量名、變量類型等變量屬性,在連接設備中選擇RSLmxOPCServer:手工鍵入寄存器地址,地址的格式為:"[Topic名]變量別名”或叮opic名:變量寄存器地址氣單擊確認即可。ca威冬可典?a?抿趴a(3茲遮ca威冬可典?a?抿趴a(3茲遮o邸CC?igCC?2>CCW5同液卡客。仃服為熟&成為陸點.IT金至統(tǒng)配餐導滄fit芹發(fā)未.沆因遇宵溶行芹;布GL并切己母R歷史新富餡杲&隅2配笠e用戶配置疽打E溜洗□金加版3何笆理笠O表枷成U*記錄佐基本nRt生|抨幽定義|記錄知安全區(qū)|芙化3竣廠ffiAffiJEMfi廠丑小原炯債廠技大原擔(0}至援設備||R5LizOFCSw咨存徭|l力y]CrRL_踞煩頊H 二J二1讀多爆牲。詵寫G只徵r只寫[Tenofio^[loo-宗集獲隙 |ic乾段方式r例存金液r涅洛泡俏■3 2^'~開方g|r處許d眼訪同圖.74、附加的文檔,A-B提供的說明文件。PublicGroupsRSLinxdoesnotsupportpublicgroups.PublicgroupsareanoptionalpartoftheOPCspecifications.However,behindthescenes,iftwoclientsrequestthesameinformationfromasingleinstanceofRSLinx,RSLinxwillnotreadthedatatwicefromthetargetprocessor.Itwillprovidethesamedatatobothclients,whichissimilarineffecttopublicgroups.Asofv2.31,RSLinxdoesnotsupportOPCwithinthe.NETframework.ThecurrentAutomationInterfaceconformstotheVisualBasicautomationinterfacestandardsusedinpreviousversionsofVisualBasic.VB.NETusesdifferentunderlyingtechnology.Futuredevelopmentisplanned,butRockwellAutomation,likeotherOPCservers,mustwaitforanOPC.NETinterfacespecificationfromtheOPCFoundation.ThisdocumentwillprovideacomparisonbetweenRSDataandtheRSLinxOPCAutomationinterfaceandisintendedtoprovideguidelinesforconvertinganexistingapplication.Forthepurposeofthisdocument,thePokeNRequestexamplewasconvertedfromanRSDataapplicationtoanRSLinxOPCAutomationApplication.Bothapplicationsareattachedtothistechnoteforyourreviewandareprovidedas-isfordemonstrationpurposesonly.Thisdocumentappliestothefollowingsoftwareversions.Theremaybeslightdifferencesinfunctionalitywithotherrevisions.RSData1.60.01RSJunctionBox1.60.01RSLinxSDK2.30.02(Build79)VisualBASIC6.0withServicePack5PLEASENOTE:RSLinxSDK(9355WABCENE)providesdocumentationonhowtousetheAutomationInterface,developmentsupport,andsamples.AllotherflavorsofRSLinxprovidetheAutomationinterfaceas-is(nodocumentation,nosupport,nosamples).AkeydifferencebetweenthetwoisthatRSData(andtheotherRSTools)isanActiveXcontrol,whichprovidesauserinterface,properties,methodsandevents.TheRSLinxOPCAutomationInterfaceisanObjectInterfacewhichprovidesproperties,methodsandeventsbutnouserinterface.TheRSToolsActiveXcontrolsarealsodata-boundcontrolswhichenableyoutolinkdirectlytoadatabasewithlittleornoadditionalcode.TheOPCAutomationInterfacedoesnothavethiscapability.Youwillneedtowritecodetolinktoadatabase.ThefollowingRSDataPropertiesareNOTSUPPORTEDwiththeRSLinxOPCAutomationInterface.DisplayRelatedPropertiesAutoColumnsCaptionTransparentGridOnScrollTopRowBackColorCaptionXGridWidthTabindexBackStyleCaptionYHeightTabStopBevelHeightCausesValidationHelpContextIDTag |BevelHighlightDecimalPlacesIndexToolTipTextBevelShadowDisplayCaptionLeftTopBevelStyleDisplayCaptionVerticalLeftBorderTopBordersBevelWidthDisplayPictureLinkTipTrailingZerosBorderColorDisplayValueLinkTipBackColorValueBackColorBorderlnnerDragiconLinkTipForeColorValueColorBorderlnnerColorDragModeLinkTipTextValuePadDownload

BorderStyleDrawDisabledShadowPictureValueShadowBorderWidthEnabledPicturePathValueShadowColorBottomBorderFlashEnabledPictureStretchValueTransparentCaptionFlashOnRightBorderValueX ICaptionBackColorFlashSpeedScreenPriorityValueYCaptionColorFlashTimeScrollColumnHeightVisible 」CaptionShadowFontScrollColumnWidthWhatsThisHelpIDCaptionShadowColorGridColorScrollFirstColumnWidthDatabaseRelatedPropertiesDataBindingsDataFormatDataSourceDataFieldDataMemberDataUpdateOtherUnsupportedPropertiesEndValueExpressionForReadWriteValueLinkErrorDisplayStartValueExpressionForWritePokeTypeSymbolUseStartEndValueThefollowingRSDataEventsareNOTSUPPORTEDwiththeRSLinxOPCAutomationInterface.DisplayRelatedEventsClickGotFocusLostFocusScrollPosChangedDbICIickKeyDownMouseDownValidateDragDropKeyPressMouseMoveDragOverKeyUpMousellpOtherUnsupportedEventsLinkErrorLinkltemSupportedLinkOutOfMemoryLinkltemNotSupportedLinkNotifyLinkServerDisconnectedLinkUnableToConnectToServerThefollowingRSDataMethodsareNOTSUPPORTEDwiththeRSLinxOPCAutomationInterface.DisplayRelatedMethodsAboutBoxMoveShowValuePadDragSetFocusShowWhatsThisThefollowingtableslisttheRSDataProperties,EventsandMethodsthathaveanequivalentintheRSLinxOPCAutomationInterface.Inthefollowingtable,theinformationinitalicsisacodesampleoftheProperty,EventorMethod.RSDataRSLinxOPCAutomationInterfaceEquivalentPropertiesLinkServerMyHSData.LinkServer="RSLinx"OPCServer.ConnectOpcServer.ConnectrtRSLinxOPCServer99

LinkTopicMyHSData.LinkTopic="MyTopic"ThesetwopropertiesarecombinedintheAdditemsMethodoftheOPCGroupobject.OpcGroup.OPCItems.Addltem”[PLC]S:23”,1LinkitemMyHSData.Linkltem=nS:23nLinkModeMyRSData.LinkMode=1,2,or3ThesethreepropertiesarecombinedintheIsSubscribedPropertyoftheOPCGroupobject.OPCGroup.IsSubscribedOpcGroup.lsSubscribed=TrueTheIsSubscribedpropertymustbesettotruetoenablecallbacksandthuseventsfortheOPCGroupobject.TheOPCGroupObjectmustbedeclared"WithEvents”aswell.IsSubscribed=TrueisequivalenttoLinkMode=1,CommunicationMode=AsynchronousandAllowChangeEvent=True.IsSubscribed=FalseisequivalenttoLinkMode=2,CommunicationMode=SynchronousandAllowChangeEvent=False.NOTE:LinkMode=3(LinkNotify)isnotsupportedwiththeRSLinxOPCAutomationInterface.Also,youcanperformSynchronousI/OwhenIsSubscribedissettoTrue.CommunicationModeMyRSData.CommunicationMode =Synchronous,AsynchronousAllowChangeEventMyRSdata.AllowChangeEvent=True,FalseRequestLengthMyRSData.RequestLength=6ThereisnoequivalentofthesepropertiesintheRSLinxOPCAutomationInterfacebutsomeparametersoftheOPCGroup'sSyncReadandAsyncReadMethodscanbeusedtoreplicatethisbehavior.Specifically:RequestLength=INumltemsparameterRequeststartindexandUselnRequest=arHandles(anArraycontainingtheItemHandlesforallItemsyouwishtoRead)NOTE:WiththeRSLinxOPCAutomationInterfaceyoumustreadandwriteallitemswithinthegroup.Thecodesnippetsbelowdemonstratethis.RequeststartindexMyRSData.Requeststartindex=0UselnRequestMyRSData.UselnRequest=True,FalsePokeLengthMyRSData.PokeLength=6ThereisnoequivalentofthesepropertiesintheRSLinxOPCAutomationInterfacebutsomeparametersoftheOPCGroup'sSyncWriteandAsyncWriteMethodscanbeusedtoreplicatethisPokeStartlndexMyRSData.PokeStartlndex=0

UselnPokeMyRSData.UseInPoke=True,Falsebehavior.Specifically:PokeLength=INumltemsparameterPokeStartlndexandUselnPoke=arHandles(anArraycontainingtheItemHandlesforallItemsyouwishtoWrite)NOTE:WiththeRSLinxOPCAutomationInterfaceyoumustreadandwriteallitemswithinthegroup.Thecodesnippetsbelowdemonstratethis.MethodsLinkPokeMyRSData.LinkPokeTheWritemethodoftheOPCItemObjectMyOPCItem.WritevalueDoPokeMyRSData(O).PokeStartlndex=0MyRSData(O).PokeLength=6Fori%=0To5MyRSDatafi%).UselnPoke=TrueNexti%MyRSData(O).DoPokeTheSyncWriteMethodoftheOPCGroupObject(UsethismethodifyouhavetheRSData.CommunicationModepropertysettoSynchronous)INumitems=MyOPCGroup.OPCItems.CountReDimarHandles(1ToINumitems)ReDimarValues(1ToINumitems)Fori=1ToINumitemsarHandles(i) =MyOPCGroup.OPCItems(i).ServerHandlearValues(i) =txtData(MyOPCGroup.OPCItems(i).ClientHandle).TextNextMyOPCGroup.SyncWrite INumitems,arHandles,arValues,arErrorsTheAsyncWriteMethodoftheOPCGroupObject(Usethismethodif youhave theRSData.CommunicationMode propertyset toAsynchronous)INumitems=MyOPCGroup.OPCItems.CountReDimarHandles(1ToINumitems)ReDimarData(1ToINumitems)Fori=1ToINumitemsarHandles(i) =MyOPCGroup.OPCItems(i).ServerHandlearData(i) =txtData(MyOPCGroup.OPCItems(i).ClientHandle).TextNext7MyOPCGroup.AsyncWriteINumitems,arHandles,arData,arErrors,ITransID,ICancellDLinkRequestMyRSData.LinkRequestTheReadmethodoftheOPCItemObjectMyOPCItem.ReadOPC_DS_CACHE,vValue,vQuality,vTimeStampDoRequestMyRSData(O).Requeststartindex=0TheSyncReadmethodoftheOPCGroupObject(Usethismethodifyouhavethe

MyRSData(O).RequestLength=6Fori%=0To5MyRSData(i%).UselnRequest=TrueNexti%MyRSData(O).DoRequestRSData.CommunicationModepropertysettoSynchronous)INumitems=MyOPCGroup.OPCItems.CountReDimarHandles(1ToINumitems)Fori=1ToINumitemsarHandles(i) =MyOPCGroup.OPCItems(i).ServerHandleNext77*ReadGroupdatafromCacheMyOPCGroup.SyncRead OPC_DS_CACHE,INumitems,arHandles,arValues,arErrors,arQualities,arTimeStampsTheAsyncReadMethodoftheOPCGroupObject(Usethismethodif youhave theRSData.CommunicationMode propertyset toAsynchronous)INumitems=MyOPCGroup.OPCItems.CountReDimarHandles(1ToINumitems)Fori=1ToINumitems"passinserverhandlesarHandles(i) =MyOPCGroup.OPCItems(i).ServerHandleNext7MyOPCGroup.AsyncReadINumitems,arHandles,arErrors,ITransID,ICancellDEventsChangePrivate SubMyRSData_Change(ByVaisValueAsString,ByVaiilndexAsInteger)'YouwouldwritecodeheretoparsethevaluesEndSubDataChangeEventoftheOPCGroupObjectPrivateSubMyOPCGroup_DataChange(ByValTransactionlDAsLong,ByVaiNumitemsAsLong,ClientHandlesf)AsLong,ltemValues()AsVariant,QualitiesQAsLong,TimeStamps()AsDate)'Youwouldwritecodeheretoevaluateanddisplaythevalues,qualities,andtimestampsofthedataEndSubPokeCompletedPrivate SubMyRSData_PokeCompleted(ByValiRetAsInteger)'Youwouldwritecodeherethatwasdependantonthepokecompleting.EndSubAsyncWriteCompleteEventoftheOPCGroupObjectPrivateSubMyOPCGroup^AsyncWriteComplete(TransactionlDAsLong,NumitemsAsLong,ClientHandlesf)AsLong,Errorsf)AsLong)'Youwouldwritecodeheretohandleanyerrorsthatoccuredduringthewritep

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論