版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
组态王与ABPLC的连接。RockwellAutomation的A-BPLC是一个著名的可编程控制器产品。其产品体系基本上涵盖了工业控制产品的各个领域,并以产品的可靠而著称。在国内的PLC市场的占有率将近30%o由于A-B的PLC的种类繁多,且各种类型的PLC支持的通信协议不尽相同,使得第三方的HMI软件都不能很好的与A-BPLC进行连接。RSLhix软件是A-BPLC通用的通信配置软件(2.2以上的版本支持对以太网的网关配置),目前主要有以下几个版本:RSLhixOEM.RSLnixProfessional、RSLnixGateway>RSLnixSDK四个版本。且均支持0?(3服务(2.3版以上支持OPC2.0版)。组态王软件己内嵌了OPC服务功能,支持OPC客户端和OPC服务器的工作方式。这样组态王就可以很方便的与A-BPLC进行通信。具体的配置方法如下:在组态王与A-BPLC进行OPC的配置是必须要有A-BPLC及相关的通讯附件。1、 安装A-BPLC、通讯卡、相关的软件,并作物理连接2、 使用RSLuix连接A-BPLC的通讯网络。配置通讯卡(参加图-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配置(可参照附带的安装手册),配置成功后将显示所配置的设备的运行状态。使用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命令成功的执行后,将在设备列表中列出与本机连接的所有硬设备。使用TopicConfigoration来进行OPC服务的配置(参见图.4)。在DateSource配置框中配置Topic,选择一个物理设备(PLC),按New按钮即可建立一个Topic,单击Done即可(参见图.5)。图・图・53、在组态王中建立y与OPC设备的连接。添加OPC设备。在组态王的工程器中选择设备3OPC服务器3新建,则弹出如下的窗I1(参见图-6)。在OPC服务器列表中选择RSLinxOPCServer—选择确定即可。OPC新建…-0表&史诺咤充词也电站艮并污陀敏陀肥陀肾血体而分方3;主佝揖客V.1财V-5巴童OPC新建…-0表&史诺咤充词也电站艮并污陀敏陀肥陀肾血体而分方3;主佝揖客V.1财V-5巴童-CJ衍沔«黄幽史沽尸卬向将聚命史非廊5{散报EcacaDIIteOFCFJxflie.技报历用用打-C5*葩皆§日迥第由张帽>>如3IE1譬%sw£、翌afuKftsreBBs&ui参见图-6在数据字典里加入IO点(参见图-7)在组态王的工程器中选择数据库今数据字典3新建。确定变量名、变量类型等变量属性,在连接设备中选择RSLmxOPCServer:手工键入寄存器地址,地址的格式为:"[Topic名]变量别名”或叮opic名:变量寄存器地址气单击确认即可。ca威冬可典•a•抿趴a(3兹遮ca威冬可典•a•抿趴a(3兹遮o邸CC«igCC«2>CCW5同液卡客。仃服为熟&成为陆点.IT金至统配餐导沧fit芹发未.沆因遇宵溶行芹;布GL并切己母R历史新富馅杲&隅2配笠e用户配置疽打E溜洗□金加版3何笆理笠O表枷成U*记录佐基本nRt生|抨幽定义|记录知安全区|芙化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. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 二零二五年度模特时尚品牌代言聘用合同-@-15
- 2025年度事业单位网络安全管理员劳动合同范本3篇
- 二零二五年度内墙涂料研发生产与品牌营销承包合同
- 2025年度智能晾晒系统配套个人木工装修合同3篇
- 2025年度个人闲置物品转让合同范本3篇
- 2025年度个人投资理财咨询服务合同范本8篇
- 2025年度个人住房贷款质押合同标准文本及贷款逾期处理规定3篇
- 2025年度个人房地产抵押借款合同电子签名版
- 二零二五年度农家乐民宿设施使用权转让合同4篇
- 2025年度个人股权收购与转让合同(资产重组版)3篇
- 射频在疼痛治疗中的应用
- 和平精英电竞赛事
- 四年级数学竖式计算100道文档
- “新零售”模式下生鲜电商的营销策略研究-以盒马鲜生为例
- 项痹病辨证施护
- 职业安全健康工作总结(2篇)
- 怀化市数字经济产业发展概况及未来投资可行性研究报告
- 07FD02 防空地下室电气设备安装
- 教师高中化学大单元教学培训心得体会
- 弹簧分离问题经典题目
- 部编版高中历史中外历史纲要(下)世界史导言课课件
评论
0/150
提交评论