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.

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

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

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

×
保存成功