版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
1、TwinCAT Total Windows Control and Automation TechnologyTwinCAT ADS,2020/8/1,Josef Papenfort,2,Definition Excursion: TwinCAT device concept a.) Identification of TwinCAT ADS devices b.) TwinCAT message router ADS a.) Introduction b.) Client-server relationship c.) Access types d.) Overview of methods
2、,Set values profiles,2020/8/1,Josef Papenfort,3,Definition ADS = Automation Device Specification - modular ADS devices e.g. PLC (each run time system), NC,. - message exchange by ADS via the message router,ADS (General),2020/8/1,Josef Papenfort,4,ADS server unambiguously identifiable by: AdsAmsServe
3、rPort Router unambiguously identifiable by: AdsAmsServerNetID,TwinCAT Device concept,2020/8/1,Josef Papenfort,5,- 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 identifie
4、s a message router, e.g. 172.1.2.16.1.1 - The last two figures can be freely selected.,Identification of ADS devices,2020/8/1,Josef Papenfort,6,The ADS servers of a message router are clearly identified by a number (- AdsAmsServerPort). The following AdsAmsServerPort numbers are already assigned: 80
5、1,811,821,831: TwinCAT PLC server, 1.-4. run-time system 500: TwinCAT NC server 100: TwinCAT logger,Identification of ADS devices,2020/8/1,Josef Papenfort,7,TwinCAT message router (I) Example: An ADS client sends an ADS message to an ADS server. The TwinCAT message router (transport layer 4) carries
6、 out: - acceptance of the request from the client - forwarding the message to an router if appropriate - provision of the messages to the ADS server,TwinCAT message router (I),2020/8/1,Josef Papenfort,8,Existing message router: On every TwinCAT PC On every Embedded PC CX1000, CX1001 On every bus con
7、troller BX1000 - On every bus controller (e.g. 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 c
8、ontroller in the fieldbus.,TwinCAT message router (II),2020/8/1,Josef Papenfort,9,The ADS interface permits: Standard: - communication with other ADS devices Client requests data or services, server answers automatically Special solutions: - implementation of an ADS server (device) PLC : Extension o
9、f the existing ADS server functions of the PLC with the PLC Library function blocks “Indication Response” Windows applications:TcSystem DLL (detailed information about ADS communication necessary,ADS - Interface,2020/8/1,Josef Papenfort,10,1.) Confirmed services 2.) Unconfirmed services ADS ClientAD
10、S Server RequestIndication ConfirmationResponse,Client-server relationship,2020/8/1,Josef Papenfort,11,Example (PLC runtime 1) requests data from PLC (runtime2) ADS-ClientPLC IADS-Server PLC II uses ADS FBProvides the data RequestIndication (FB call) ConfirmationResponse (Busy at FB),Client server r
11、elationship between 2 PLC devices,2020/8/1,Josef Papenfort,12,1.) By address Example: 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
12、PLC variable temperature.,Access types (I),2020/8/1,Josef Papenfort,13,Synchronous. - Client sends a request to server - Client waits until the result is existing - Synchronous to the program line“,Access types, time flow (I),2020/8/1,Josef Papenfort,14,Asynchronous - Client sends a query to the ser
13、ver - Client continues to work without waiting - Result of the server by callback Notification - Client 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),2020/8/1,Josef Papenfort,15,Defin
14、ition OCX: ActiveX-Control according to COM-(Component Object Model) Specification The OCX contains: - general ADS services - extended ADS services, that simplify the process (e.g. synchronous communication),ADS OCX Introduction,2020/8/1,Josef Papenfort,16,Asynchronous,ADS OCX Introduction methods (
15、I),Synchronous,AdsSyncxxyyReq - per Adresse,AdsSyncxxyyVarREQ -per Name,AdsReadIntegerReqAdsReadLongReqAdsReadSingleReqAdsReadDoubleReqAdsReadStringReq,Methods for request(= Req),AdsReadIntegerConfAdsReadLongConfAdsReadSingleConfAdsReadDoubleConfAdsReadStringConf,Events at data updating (= Conf),Ads
16、SyncReadBoolReqAdsSyncReadBoolVarReqAdsSyncReadIntegerReqAdsSyncReadIntegerVarReqAdsSyncReadLongReqAdsSyncReadLongVarReq,2020/8/1,Josef Papenfort,17,ADS OCX Introduction methods (II),Notification,ReadVarConnectExAdsReadConnectUpdateEx,AdsReadConnectUpdateEx,Method for apply Notification,Event after
17、data update,Method for sign off Notification,AdsDisconnectEx,Notification. Connect?. EX?,Notification is a term from the communication. 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. (- connectE
18、x is recommended),2020/8/1,Josef Papenfort,18,Notification Refresh,2020/8/1,Josef Papenfort,19,ADS OCX methods overview,2020/8/1,Josef Papenfort,20,Before communicating with an ADS device, the following properties of the communication partner must be specified once: - AdsAmsServerNetID (e.g. 172.1.2
19、.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 system e.g. ADS_OCX2 for NC server e.g. ADS_OCX3 for PLC server 2nd run-time system For communication between one
20、 PC and several BC (9)000 Controllers one 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 partner,2020/8/1,Josef Papenfort,21,ADS-OCX Examples: ADS-OCX in Visual Basic project ILinking
21、, simple data exchange IIExamples: Synchronous and Connect“ VBA IVBA with Graphworks synchronous data exchange VBA IIVBA with Graphworks data exchange with connect VBA IIIVAB with excel,ADS OCX Examples,2020/8/1,Josef Papenfort,22,TwinCAT.ADS.Dll Examples: TwinCAT.ADS.Dll with VisualS and C# Ads.Dll
22、 C# ILinking, simple data exchange Ads.Dll C# IIExamples: Synchronous and Connect“,TwinCAT.Ads.Dll Examples,2020/8/1,Josef Papenfort,23,5.1.b) Example Write a Variable Synchronously to the PLC,Example 1,2020/8/1,Josef Papenfort,24,Example 1,PLC: Create a PLC project, create the main program and decl
23、are a local variable iVbToPlc1,2020/8/1,Josef Papenfort,25,Example 1,Visual Basic: Create Visual Basic, (standard.exe), link ADSOCX,2020/8/1,Josef Papenfort,26,Example 1,Visual Basic: Create form, place control elements,2020/8/1,Josef Papenfort,27,Example 1,Visual Basic: Declare variable and handle
24、for the variable,2020/8/1,Josef Papenfort,28,MarketingMarketingULILAKERSchulungSchulungsfolienADSOCXscreenshots,Example 1,Visual Basic: In FORMLOAD event set PROPERTIES for ADSOCX1,2020/8/1,Josef Papenfort,29,Example I,At faulty completion of a message, a message dialog is generated automatically.In
25、 the development environment of VB can be jumped to the program line along with the cause.By using the VB instructions On Error Goto / Resume an own error handling can be programmed.C#: Try and Catch,2020/8/1,Josef Papenfort,30,Example 1,Visual Basic: Other possibility for error evaluation,2020/8/1,
26、Josef Papenfort,31,Example 1,Visual Basic: The handle is provided by the PLC and is known to the Visual Basic program. This handle can now be used to demand the variable from the PLC. The Click Event of the command button is selected as the trigger (event) for this action. First therefore read the t
27、ext field, and assign this value to the variable.,2020/8/1,Josef Papenfort,32,AdsOcx1.AdsSyncWriteIntegerVarReq, what is the meaning of this name?,As AdsOcx method is used,Synchronous writing (Synchronous is related to the processing of the Visual Basic program. Execution of the Visual Basic program
28、 only continues when execution of this method has been completed.),A value of type integer,This value is to be written via the name variable.,Example 1,Visual Basic: The handle is provided by the PLC and is known to the Visual Basic program. This handle can now be used to demand the variable from th
29、e PLC. The Click Event of the command button is selected as the trigger (event) for this action.,2020/8/1,Josef Papenfort,33,Example 1,Visual Basic: In the click event of the command button.,2020/8/1,Josef Papenfort,34,Example 1,Visual Basic: In the click event of the command button.,2020/8/1,Josef
30、Papenfort,35,Test: Start PLC, save Visual Basic application and start. If everything is in order, the value in the text window of the Visual Basic program can be changed (-32768.+32767). After clicking the command button, the variable in the PLC program must have taken on this value.,Example 1,Visua
31、l Basic: Summary: Click event,2020/8/1,Josef Papenfort,36,Synchronous access to bitlocated address, synchronous by name, by name and connect to several variables and write arrays synchronously. (Base project on training PC or disk) The controls are already placed on the form. A small editing possibi
32、lity has been programmed for the control Msflexgrid“. This example shows the pure using of the methods of ADS Ocx to access to the variables. The Enable Errorhandling“ is used to handle with errors.,Example 2,Visual Basic Example 2,2020/8/1,Josef Papenfort,37,Example 2,Visual Basic Example 2 Form,20
33、20/8/1,Josef Papenfort,38,Visual Basic Example 2 Form,Example 2,2020/8/1,Josef Papenfort,39,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,40,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,41,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,42,Example 2,
34、Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,43,Visual Basic Example 2 Form,Example 2,2020/8/1,Josef Papenfort,44,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,45,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,46,Example 2,Visual Basic Example 2 Form,2020/8/1
35、,Josef Papenfort,47,Visual Basic Example 2 Form,Example 2,2020/8/1,Josef Papenfort,48,Visual Basic Example 2 Form,Example 2,2020/8/1,Josef Papenfort,49,Example 2,Visual Basic Example 2 Form,2020/8/1,Josef Papenfort,50,Example AdsOcx with Genesis32 VBA Synchronous data exchange,Example VBA I,2020/8/1
36、,Josef Papenfort,51,Synchronized read,PLC program changes Poti1“,Synchronized write,Example VBA I: Synchronized write/read of PLC variables,2020/8/1,Josef Papenfort,52,Example VBA I: Graphworks32,2020/8/1,Josef Papenfort,53,Text,Example VBA I: Graphworks32,2020/8/1,Josef Papenfort,54,Process Point with located variable,Example VBA I: Graphworks32,2020/8/1,Josef Papenfort,55,Macros,GwxDemoReadByName_Main.DemoReadByName,Example VBA I: Graphworks32,2020/8/1,Josef Papenf
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 学习中小学教师违反职业道德行为处理办法心得体会
- 小区消防改造方案
- 物业小区保洁工具管理制度
- 人教版小学四年级下册《轴对称》教学设计
- 直播产品售后仓储对接管理手册
- 猪苗吃乳补饲护理指导手册
- 焊接工艺与质量检验手册
- 电气设备漏电防护与应急处理手册
- 个人技能提升补贴申请
- 供应链管理与物流配送优化指南
- 2026年领导干部任前廉政法规知识竞赛试题库及答案
- 2026年贵阳花溪资本运营管理有限公司社会公开招聘14人考试备考题库及答案详解
- 2026中国社会科学院招聘土木工程师5人(北京)笔试备考试题及答案详解
- 成都未来科技城发展服务局2026年社会招聘笔试题库附参考答案详解【模拟题】
- 烧结多孔砖生产施工方案及技术措施
- 矿泉水授权销售合同
- 山东能源定向委培考试题
- 2025广东省风力发电有限公司山西分公司招聘7人笔试历年难易错考点试卷带答案解析
- 2025~2026学年安徽合肥市第四十五中学九年级上学期期末考试化学试卷
- 惠州市广东惠州市生态环境局博罗分局和博罗县污染防治攻坚战总指挥部办公室招聘编笔试历年参考题库典型考点附带答案详解
- 2026年医学高数期末速刷150题附全部答案
评论
0/150
提交评论