组态王与ABPLC的连接。RockwellAutomation的A-BPLC是一个著名的可编程控制器产品。其产品体系基本上涵盖了工业控制产品的各个领域,并以产品的可靠而著称。在国内的PLC市场的占有率将近30%。由于A-B的PLC的种类繁多,且各种类型的PLC支持的通信协议不尽相同,使得第三方的HMI软件都不能很好的与A-BPLC进行连接。RSLinx软件是A-BPLC通用的通信配置软件(2.2以上的版本支持对以太网的网关配置),目前主要有以下几个版本:RSLinxOEM、RSLinxProfessional、RSLinxGateway、RSLinxSDK四个版本。且均支持OPC服务(2.3版以上支持OPC2.0版)。组态王软件已内嵌了OPC服务功能,支持OPC客户端和OPC服务器的工作方式。这样组态王就可以很方便的与A-BPLC进行通信。具体的配置方法如下:在组态王与A-BPLC进行OPC的配置是必须要有A-BPLC及相关的通讯附件。1、安装A-BPLC、通讯卡、相关的软件,并作物理连接2、使用RSLinx连接A-BPLC的通讯网络。配置通讯卡(参加图-1),选择ConFigureDrivers。图-1弹出入下的配置窗口(参见图-2)。图-2选择对应的通讯卡,并进行端口配置(可参照附带的安装手册),配置成功后将显示所配置的设备的运行状态。使用RSWho命令查找连接的PLC设备(参见图-3)。参见图-3RSWho命令成功的执行后,将在设备列表中列出与本机连接的所有硬设备。使用TopicConfigoration来进行OPC服务的配置(参见图-4)。图-4在DateSource配置框中配置Topic,选择一个物理设备(PLC),按New按钮即可建立一个Topic,单击Done即可(参见图-5)。图-53、在组态王中建立y与OPC设备的连接。添加OPC设备。在组态王的工程器中选择设备OPC服务器新建,则弹出如下的窗口(参见图-6)。在OPC服务器列表中选择RSLinxOPCServer选择确定即可。参见图-6在数据字典里加入IO点(参见图-7)在组态王的工程器中选择数据库数据字典新建。确定变量名、变量类型等变量属性,在连接设备中选择RSLinxOPCServer;手工键入寄存器地址,地址的格式为:”[Topic名]变量别名”或”Topic名:变量寄存器地址”。单击确认即可。图-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.DisplayRelatedPropertiesAutoColumnsCaptionTransparentGridOnScrollTopRowBackColorCaptionXGridWidthTabIndexBackStyleCaptionYHeightTabStopBevelHeightCausesValidationHelpContextIDTagBevelHighlightDecimalPlacesIndexToolTipTextBevelShadowDisplayCaptionLeftTopBevelStyleDisplayCaptionVerticalLeftBorderTopBordersBevelWidthDisplayPictureLinkTipTrailingZerosBorderColorDisplayValueLinkTipBackColorValueBackColorBorderInnerDragIconLinkTipForeColorValueColorBorderInnerColorDragModeLinkTipTextValuePadDownloadBorderStyleDrawDisabledShadowPictureValueShadowBorderWidthEnabledPicturePathValueShadowColorBottomBorderFlashEnabledPictureStretchValueTransparentCaptionFlashOnRightBorderValueXCaptionBackColorFlashSpeedScreenPriorityValueYCaptionColorFlashTimeScrollColumnHeightVisibleCaptionShadowFontScrollColumnWidthWhatsThisHelpIDCaptionShadowColorGridColorScrollFirstColumnWidthDatabaseRelatedPropertiesDataBindingsDataFormatDataSourceDataFieldDataMemberDataUpdateOtherUnsupportedPropertiesEndValueExpressionForReadWriteValueLinkErrorDisplayStartValueExpressionForWritePokeTypeSymbolUseStartEndValueThefollowingRSDataEventsareNOTSUPPORTEDwiththeRSLinxOPCAutomationInterface.DisplayRelatedEventsClickGotFocusLostFocusScrollPosChangedDblClickKeyDownMouseDownValidateDragDropKeyPressMouseMoveDragOverKeyUpMouseUpOtherUnsupportedEventsLinkErrorLinkItemSupportedLinkOutOfMemoryLinkItemNotSupportedLinkNotifyLinkServerDisconnectedLinkUnableToConnectToServerThefollowingRSDataMethodsareNOTSUPPORTEDwiththeRSLinxOPCAutomationInterface.DisplayRelatedMethodsAboutBoxMoveShowValuePadDragSetFocusShowWhatsThisThefollowingtableslisttheRSDataProperties,EventsandMethodsthathaveanequivalentintheRSLinxOPCAutomationInterface.Inthefollowingtable,theinformationinitalicsisacodesampleoftheProperty,EventorMethod.RSDataRSLinxOPCAutomationInterfaceEquivalentPropertiesLinkServerMyRSData.LinkServer=RSLinxOPCServer.ConnectOpcServer.ConnectRSLinxOPCServerLinkTopicMyRSData.LinkTopic=MyTopicThesetwopropertiesarecombinedintheAddItemsM