beckhoff · TwinCAT 2 ADS WebService · 98 pp.
Beckhoff TwinCAT 2 ADS WebService Manual (TX1000) – Installation & Configuration Guide
Руководство описывает установку и конфигурацию TwinCAT ADS Webservice (IIS, SSL/TLS, NTLM), а также библиотеку TcAdsWebService.js и примеры ADS-коммуникации через HTTP.
Related manuals
Contents
Document text
Manual | EN TX1000 TwinCAT 2 | ADS WebService 2023-08-11 | Version: 1.2
Table of contents
Table of contents Table of contents 1 Foreword.................................................................................................................................................... 5 1.1 Notes on the documentation ............................................................................................................. 5 1.2 For your safety .................................................................................................................................. 6 1.3 Notes on information security............................................................................................................
7 2 Introduction ............................................................................................................................................... 8 3 Installation ................................................................................................................................................. 9 3.1 Install TwinCAT ADS Webservice on a PC (here: Windows 7)......................................................... 9 3.2 Configuration of the TwinCAT ADS WebServices on a PC (in this example: Windows XP)........... 13 3.3 Configuration of the TwinCAT ADS WebServices on Windows CE................................................
19 3.4 Add virtual directory ........................................................................................................................ 20 4 Encryption/Authentification ................................................................................................................... 22 4.1 Configuration of SSL/TLS and NTLM Authentification for the TwinCAT ADS WebServices on Win- dows 7.............................................................................................................................................
22 4.2 Configuration of SSL/TLS and NTLM Authentification for the TwinCAT ADS WebServices on Win- dows CE ......................................................................................................................................... 29 4.3 SSLCert.exe.................................................................................................................................... 30 5 TcAdsWebService.js............................................................................................................................... 32 5.1 AdsConnection................................................................................................................................
32 5.1.1 readwrite .......................................................................................................................... 34 5.1.2 readwriteAsync................................................................................................................. 34 5.1.3 readState.......................................................................................................................... 35 5.1.4 readStateAsync................................................................................................................ 35 5.1.5 writeControl......................................................................................................................
35 5.1.6 writeControlAsync ............................................................................................................ 36 5.1.7 write.................................................................................................................................. 36 5.1.8 writeAsync........................................................................................................................ 37 5.1.9 read..................................................................................................................................
37 5.1.10 readAsync ........................................................................................................................ 38 5.1.11 getTypeString................................................................................................................... 38 5.2 Client ............................................................................................................................................... 38 5.2.1 readwrite ..........................................................................................................................
39 5.2.2 readState.......................................................................................................................... 40 5.2.3 writeControl...................................................................................................................... 41 5.2.4 write.................................................................................................................................. 42 5.2.5 read..................................................................................................................................
42 5.2.6 getTypeString................................................................................................................... 43 5.3 DataReader..................................................................................................................................... 43 5.3.1 readSINT.......................................................................................................................... 44 5.3.2 readINT ............................................................................................................................
44 5.3.3 readDINT.......................................................................................................................... 45 5.3.4 readBYTE......................................................................................................................... 45 5.3.5 readWORD....................................................................................................................... 45 5.3.6 readDWORD.................................................................................................................... 45 5.3.7 readBOOL........................................................................................................................
45 TX1000 3 Version: 1.2
Table of contents
Table of contents 5.3.8 readString......................................................................................................................... 45 5.3.9 readStringZero ................................................................................................................. 46 5.3.10 readREAL......................................................................................................................... 46 5.3.11 readLREAL.......................................................................................................................
46 5.3.12 getByteLength.................................................................................................................. 46 5.3.13 getTypeString................................................................................................................... 46 5.4 DataWriter ....................................................................................................................................... 47 5.4.1 getBase64EncodedData .................................................................................................. 47 5.4.2 writeSINT .........................................................................................................................
47 5.4.3 writeINT............................................................................................................................ 47 5.4.4 writeDINT ......................................................................................................................... 48 5.4.5 writeBYTE ........................................................................................................................ 48 5.4.6 writeWORD ...................................................................................................................... 48 5.4.7 writeDWORD....................................................................................................................
48 5.4.8 writeBOOL........................................................................................................................ 49 5.4.9 writeString ........................................................................................................................ 49 5.4.10 writeREAL ........................................................................................................................ 49 5.4.11 writeLREAL ......................................................................................................................
49 5.5 Response ........................................................................................................................................ 50 5.4.12 getTypeString................................................................................................................... 49 5.5.1 getTypeString................................................................................................................... 50 5.6 Error ................................................................................................................................................
51 5.6.1 getTypeString................................................................................................................... 51 5.7 RequestError................................................................................................................................... 51 5.7.1 getTypeString................................................................................................................... 52 5.8 AdsState..........................................................................................................................................
52 5.9 TcAdsWebServiceDataTypes ......................................................................................................... 53 5.10 TcAdsReservedIndexGroups .......................................................................................................... 53 6 Samples ................................................................................................................................................... 55 6.1 Samples: ADS Web Service ........................................................................................................... 55 6.1.1 Consumer in C# to read and write PLC variables............................................................
55 6.1.2 Consumer in C++ to read and write PLC variables.......................................................... 63 6.1.3 Consumer in Delphi 8 for .NET to read and write PLC variables..................................... 66 6.1.4 Consumer in Java to read and write PLC variables......................................................... 71 6.1.5 ASP.NET 2.0 AJAX.......................................................................................................... 73 6.2 Samples: TcAdsWebService.js .......................................................................................................
78 6.2.1 Cyclic reading of multiple variables with sumcommando................................................. 79 6.2.2 Writing multiple variables with sumcommando ................................................................ 84 6.2.3 Example: Maschine.pro with HTML5, SVG, JavaScript................................................... 88 TX1000 4 Version: 1.2
1.1 Notes on the documentation
Foreword 1 Foreword 1.1 Notes on the documentation This description is only intended for the use of trained specialists in control and automation engineering who are familiar with applicable national standards. It is essential that the documentation and the following notes and explanations are followed when installing and commissioning the components. It is the duty of the technical personnel to use the documentation published at the respective time of each installation and commissioning. The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.
Disclaimer The documentation has been prepared with care. The products described are, however, constantly under development. We reserve the right to revise and change the documentation at any time and without prior announcement. No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation. Trademarks Beckhoff ® , TwinCAT ® , TwinCAT/BSD ® , TC/BSD ® , EtherCAT ® , EtherCAT G ® , EtherCAT G10 ® , EtherCAT P ® , Safety over EtherCAT ® , TwinSAFE ® , XFC ® , XTS ® and XPlanar ® are registered trademarks of and licensed by Beckhoff Automation GmbH.
Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners. Patent Pending The EtherCAT Technology is covered, including but not limited to the following patent applications and patents: EP1590927, EP1789857, EP1456722, EP2137893, DE102015105702 with corresponding applications or registrations in various other countries. EtherCAT ® is a registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany Copyright © Beckhoff Automation GmbH & Co. KG, Germany.
The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited. Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design. TX1000 5 Version: 1.2