您好,欢迎访问三七文档
当前位置:首页 > 建筑/环境 > 电气安装工程 > 4000_通讯_VB_ADS通讯
TwinCATTotalWindowsControlandAutomationTechnologyTwinCATADS2020/5/23JosefPapenfort2DefinitionExcursion:TwinCATdeviceconcepta.)IdentificationofTwinCATADSdevicesb.)TwinCATmessagerouterADSa.)Introductionb.)Client-serverrelationshipc.)Accesstypesd.)OverviewofmethodsSetvaluesprofiles2020/5/23JosefPapenfort3DefinitionADS=AutomationDeviceSpecification-modularADSdevicese.g.PLC(eachruntimesystem),NC,...-messageexchangebyADSviathemessagerouterADS(General)2020/5/23JosefPapenfort4ADSserverunambiguouslyidentifiableby:AdsAmsServerPortRouterunambiguouslyidentifiableby:AdsAmsServerNetIDTwinCATDeviceconcept2020/5/23JosefPapenfort5-Every(TwinCAT)PCinthenetworkcanbeuniquelyidentifiedbymeansofaTCP/IPaddresssuchas172.1.2.16.-TheAdsAmsServerNetIDisanextensionoftheTCP/IPaddress,andidentifiesamessagerouter,e.g.172.1.2.16.1.1-Thelasttwofigurescanbefreelyselected.IdentificationofADSdevices2020/5/23JosefPapenfort6TheADSserversofamessagerouterareclearlyidentifiedbyanumber(-AdsAmsServerPort).ThefollowingAdsAmsServerPortnumbersarealreadyassigned:801,811,821,831:TwinCATPLCserver,1.-4.run-timesystem500:TwinCATNCserver100:TwinCATloggerIdentificationofADSdevices2020/5/23JosefPapenfort7TwinCATmessagerouter(I)Example:AnADSclientsendsanADSmessagetoanADSserver.TheTwinCATmessagerouter(transportlayer4)carriesout:-acceptanceoftherequestfromtheclient-forwardingthemessagetoanrouterifappropriate-provisionofthemessagestotheADSserverTwinCATmessagerouter(I)2020/5/23JosefPapenfort8Existingmessagerouter:-OneveryTwinCATPC-OneveryEmbeddedPCCX1000,CX1001-OneverybuscontrollerBX1000-Oneverybuscontroller(e.g.BC3100,BC8100,...,BCxxxx)Possiblecommunicationpaths:-Network(TCP/IP)APLCrun-timesystemsendsdatatoanotherPLConanotherTwinCATPCinthenetwork.-Fieldbus(Lightbus/Profibus)APLCrun-timesystemsendsdatatoanotherPLConabuscontrollerinthefieldbus.TwinCATmessagerouter(II)2020/5/23JosefPapenfort9TheADSinterfacepermits:Standard:-communicationwithotherADSdevicesClientrequestsdataorservices,serveranswersautomaticallySpecialsolutions:-implementationofanADSserver(device)PLC:ExtensionoftheexistingADSserverfunctionsofthePLCwiththePLCLibraryfunctionblocks“IndicationResponse”Windowsapplications:TcSystemDLL(detailedinformationaboutADScommunicationnecessaryADS-Interface2020/5/23JosefPapenfort101.)Confirmedservices2.)UnconfirmedservicesADSClientADSServerRequestIndicationConfirmationResponseClient-serverrelationship2020/5/23JosefPapenfort11Example(PLCruntime1)requestsdatafromPLC(runtime2)ADS-ClientPLCIADS-ServerPLCIIusesADSFBProvidesthedataRequestIndication(FBcall)ConfirmationResponse(BusyatFB)Client–serverrelationshipbetween2PLCdevices2020/5/23JosefPapenfort121.)ByaddressExample:Read/writeatotalof100bytesstartingfrombyteoffset20oftheinput/outputprocessimageinthePLCserveroroftheflagsarea.(Oftenusedinprocessvisualisation)2.)Byname“Example:Read/writethePLCvariabletemperature.Accesstypes(I)2020/5/23JosefPapenfort13Synchronous.-Clientsendsarequesttoserver-Clientwaitsuntiltheresultisexisting-„Synchronoustotheprogramline“Accesstypes,timeflow(I)2020/5/23JosefPapenfort14Asynchronous-Clientsendsaquerytotheserver-Clientcontinuestoworkwithoutwaiting-ResultoftheserverbycallbackNotification-Clientregistersitselfattheserver-Serverservestheclientautonomouslybycallback(untiltheclientsignsofffromtheserveragain)Accesstypes,timeflow(II)2020/5/23JosefPapenfort15DefinitionOCX:ActiveX-ControlaccordingtoCOM-(ComponentObjectModel)SpecificationTheOCXcontains:-generalADSservices-extendedADSservices,thatsimplifytheprocess(e.g.synchronouscommunication)ADSOCXIntroduction2020/5/23JosefPapenfort16AsynchronousADSOCXIntroductionmethods(I)SynchronousAdsSyncxxyyReq-perAdresseAdsSyncxxyyVarREQ-perNameAdsReadIntegerReqAdsReadLongReqAdsReadSingleReqAdsReadDoubleReqAdsReadStringReqMethodsforrequest(=Req)AdsReadIntegerConfAdsReadLongConfAdsReadSingleConfAdsReadDoubleConfAdsReadStringConfEventsatdataupdating(=Conf)AdsSyncReadBoolReqAdsSyncReadBoolVarReqAdsSyncReadIntegerReqAdsSyncReadIntegerVarReqAdsSyncReadLongReqAdsSyncReadLongVarReq2020/5/23JosefPapenfort17ADSOCXIntroductionmethods(II)NotificationReadVarConnectExAdsReadConnectUpdateExAdsReadConnectUpdateExMethodforapplyNotificationEventafterdataupdateMethodforsignoffNotificationAdsDisconnectExNotification...Connect?....EX?Notificationisatermfromthecommunication.ConnectisatermoftheADSOcxmethod.EX:meansExtended.Itistheextendedmethodoftheoldconnectmethod.Thedifferenceistheeasierhandling.(-connectExisrecommended)2020/5/23JosefPapenfort18NotificationRefreshClient(ADSOcx)writes/readsdatawithowncycle.ClientCycle(e.g.)PLCsendonlyifvariableschangesServeronChange(e.g.PLCsendwitheverycycle)ServerCycle2020/5/23JosefPapenfort19VariabletypesAccessAdvantageDisadvantageCommentSynchro-nousAllByaddressBynameEasyhandlingintheVisualBasicProgramTheusermustde-terminetheeventhimself.(Disadvantagewhenreading)Iftheanswerpagesarelong,theVBprogramcanslowdownLocalcommunication,fastnetworks,communicationinitiatedatneedAsynchro-nousAllexceptBOOLGenerallyonlybyaddress.But(withmoreeffort,i.
本文标题:4000_通讯_VB_ADS通讯
链接地址:https://www.777doc.com/doc-5524858 .html