4000-通讯-VB-ADS通讯.ppt
- 【下载声明】
1. 本站全部试题类文档,若标题没写含答案,则无答案;标题注明含答案的文档,主观题也可能无答案。请谨慎下单,一旦售出,不予退换。
2. 本站全部PPT文档均不含视频和音频,PPT中出现的音频或视频标识(或文字)仅表示流程,实际无音频或视频文件。请谨慎下单,一旦售出,不予退换。
3. 本页资料《4000-通讯-VB-ADS通讯.ppt》由用户(淡淡的紫竹语嫣)主动上传,其收益全归该用户。163文库仅提供信息存储空间,仅对该用户上传内容的表现方式做保护处理,对上传内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知163文库(点击联系客服),我们立即给予删除!
4. 请根据预览情况,自愿下载本文。本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
5. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007及以上版本和PDF阅读器,压缩文件请下载最新的WinRAR软件解压。
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 4000 通讯 _VB_ADS
- 资源描述:
-
1、TwinCAT Total Windows Control and Automation TechnologyTwinCAT ADS2022-1-24Josef Papenfort2DefinitionExcursion: TwinCAT device concept a.) Identification of TwinCAT ADS devices b.) TwinCAT message router ADSa.) Introductionb.) Client-server relationshipc.) Access typesd.) Overview of methodsSet valu
2、es profiles2022-1-24Josef Papenfort3DefinitionADS = Automation Device Specification- modular ADS devices e.g. PLC (each run time system), NC,.- message exchange by ADS via the message routerADS (General)2022-1-24Josef Papenfort4ADS server unambiguously identifiable by:AdsAmsServerPortRouter unambigu
3、ously identifiable by:AdsAmsServerNetIDTwinCAT Device concept2022-1-24Josef Papenfort5- Every (TwinCAT) PC in the network can be uniquely identified by means of a TCP/IP address such as 172.1.2.16.- The AdsAmsServerNetID is an extension of the TCP/IP address, and identifies a message router, e.g. 17
4、2.1.2.16.1.1- The last two figures can be freely selected.Identification of ADS devices2022-1-24Josef Papenfort6The ADS servers of a message router are clearly identified by a number (- AdsAmsServerPort). The following AdsAmsServerPort numbers are already assigned:801,811,821,831: TwinCAT PLC server
5、, 1.-4. run-time system500: TwinCAT NC server100: TwinCAT loggerIdentification of ADS devices 2022-1-24Josef Papenfort7TwinCAT message router (I)Example:An ADS client sends an ADS message to an ADS server.The TwinCAT message router (transport layer 4) carries out: - acceptance of the request from th
6、e client- forwarding the message to an router if appropriate- provision of the messages to the ADS serverTwinCAT message router (I)2022-1-24Josef Papenfort8Existing message router:- On every TwinCAT PC- On every Embedded PC CX1000, CX1001- On every bus controller BX1000- On every bus controller (e.g
7、. BC3100, BC8100, ., BCxxxx)Possible communication paths:- Network (TCP/IP)A PLC run-time system sends data to another PLC on another TwinCAT PC in the network.- Fieldbus (Lightbus / Profibus)A PLC run-time system sends data to another PLC on a bus controller in the fieldbus.TwinCAT message router (
8、II)2022-1-24Josef Papenfort9The ADS interface permits:Standard:- communication with other ADS devices Client requests data or services, server answers automaticallySpecial solutions:- implementation of an ADS server (device) PLC : Extension of the existing ADS server functions of the PLC with the PL
9、C Library function blocks “Indication Response”Windows applications:TcSystem DLL(detailed information about ADS communication necessaryADS - Interface2022-1-24Josef Papenfort101.) Confirmed services2.) Unconfirmed servicesADS ClientADS ServerRequestIndicationConfirmationResponseClient-server relatio
10、nship2022-1-24Josef Papenfort11Example (PLC runtime 1) requests data from PLC (runtime2)ADS-ClientPLC IADS-Server PLC IIuses ADS FBProvides the dataRequestIndication(FB call)ConfirmationResponse(Busy at FB)Client server relationship between 2 PLC devices2022-1-24Josef Papenfort121.) By addressExampl
11、e:Read / write a total of 100 bytes starting from byte offset 20 of the input/output process image in the PLC server or of the flags area. (Often used in process visualisation)2.) By name“Example:Read / write the PLC variable temperature.Access types (I)2022-1-24Josef Papenfort13Synchronous. - Clien
12、t sends a request to server- Client waits until the result is existing- Synchronous to the program line“Access types, time flow (I)2022-1-24Josef Papenfort14Asynchronous- Client sends a query to the server- Client continues to work without waiting- Result of the server by callbackNotification- Clien
13、t registers itself at the server- Server serves the client autonomously by callback (until the client signs off from the server again)Access types, time flow (II)2022-1-24Josef Papenfort15Definition OCX:ActiveX-Control according to COM-(Component Object Model) SpecificationThe OCX contains:- general
14、 ADS services- extended ADS services, that simplify the process (e.g. synchronous communication)ADS OCX Introduction2022-1-24Josef Papenfort16AsynchronousADS OCX Introduction methods (I)SynchronousAdsSyncxxyyReq - per AdresseAdsSyncxxyyVarREQ -per NameAdsReadIntegerReqAdsReadLongReqAdsReadSingleReqA
15、dsReadDoubleReqAdsReadStringReqMethods for request(= Req)AdsReadIntegerConfAdsReadLongConfAdsReadSingleConfAdsReadDoubleConfAdsReadStringConfEvents at data updating (= Conf)AdsSyncReadBoolReqAdsSyncReadBoolVarReqAdsSyncReadIntegerReqAdsSyncReadIntegerVarReqAdsSyncReadLongReqAdsSyncReadLongVarReq2022
16、-1-24Josef Papenfort17ADS OCX Introduction methods (II)NotificationReadVarConnectExAdsReadConnectUpdateExAdsReadConnectUpdateExMethod for apply NotificationEvent after data updateMethod for sign off Notification AdsDisconnectExNotification. Connect?. EX?Notification is a term from the communication.
17、Connect is a term of the ADS Ocx method.EX: means Extended. It is the extended method of the old connect method. The difference is the easier handling. (- connectEx is recommended)2022-1-24Josef Papenfort18Notification Refresh Client (ADS Ocx) writes / reads data with own cycle.Client Cycle(e.g.) PL
18、C send only if variables changesServer on Change(e.g. PLC send with every cycle)Server Cycle2022-1-24Josef Papenfort19 Variable types Access Advantage Disadvantage Comment Synchro-nous All By address By name Easy handling in the Visual Basic Program The user must de-termine the event himself. (Disad
19、vantage when reading) If the answer pages are long, the VB program can slow down Local communication, fast networks, communication initiated at need Asynchro-nous All except BOOL Generally only by address. But (with more effort, i.e. using index group/index offset) also by name The Visual Basic Prog
20、ram does not wait for an answer, but continues to operate More administra-tive overhead in the Visual Basic program, since the answer requires reaction to an event. Slow communication (networks) large data packets Connect All By name By address Updating, takes place on the server (PLC) Unnecessarily
21、 high data traffic with many connect connections Specify sensible refresh times, clear connections that are not needed ADS OCX methods overview2022-1-24Josef Papenfort20Before communicating with an ADS device, the following properties of the communication partner must be specified once:- AdsAmsServe
22、rNetID (e.g. 172.1.2.16.1.1) and- AdsAmsServerPort (e.g. 801 PLC server, 1st run-time system)A separate ADS-OCX should be used for each ADS communication partner:e.g. ADS_OCX1 for PLC server 1st run-time systeme.g. ADS_OCX2 for NC servere.g. ADS_OCX3 for PLC server 2nd run-time systemFor communicati
23、on between one PC and several BC (9)000 Controllersone OCX and e.g. one additional I/O task can be used. The IO task “collects”all data from the BCs and the ADS OCX access to this area.Specifying the ADS communication partner2022-1-24Josef Papenfort21ADS-OCX Examples:ADS-OCX in Visual Basic projectI
24、Linking, simple data exchangeIIExamples: Synchronous and Connect“VBA IVBA with Graphworks synchronous data exchangeVBA IIVBA with Graphworks data exchange with connectVBA III VAB with excelADS OCX Examples2022-1-24Josef Papenfort22TwinCAT.ADS.Dll Examples:TwinCAT.ADS.Dll with VisualS and C#Ads.Dll C
展开阅读全文