beckhoff · 61 pp.
Beckhoff TwinCAT 2 ADS Java DLL EN Manual PDF Download
Related manuals
Contents
Document text
Manual | EN TX1000 TwinCAT 2 | ADS Java DLL 2022-10-06 | Version: 1.1
Table of contents
Table of contents Table of contents 1 Foreword.................................................................................................................................................... 5 1.1 Notes on the documentation ............................................................................................................. 5 1.2 Safety instructions............................................................................................................................. 6 1.3 Notes on information security............................................................................................................
7 2 Introduction ............................................................................................................................................... 8 3 Implementing in Eclipse Galileo .............................................................................................................. 9 4 Implementing in Netbeans 6.7.1 ............................................................................................................ 11 5 API ............................................................................................................................................................
13 5.1 Functions......................................................................................................................................... 13 5.1.1 adsGetDllVersion ............................................................................................................. 13 5.1.2 adsPortOpen.................................................................................................................... 13 5.1.3 adsPortClose.................................................................................................................... 13 5.1.4 adsGetLocalAddress........................................................................................................
13 5.1.5 adsSyncWriteReq ............................................................................................................ 14 5.1.6 adsSyncWriteReqArray.................................................................................................... 14 5.1.7 adsSyncReadReq ............................................................................................................ 14 5.1.8 adsSyncReadReqEx........................................................................................................ 15 5.1.9 adsSyncReadWriteReq....................................................................................................
15 5.1.10 adsSyncReadWriteReqEx................................................................................................ 16 5.1.11 adsSyncReadDeviceInfoReq ........................................................................................... 16 5.1.12 adsSyncWriteControlReq................................................................................................. 17 5.1.13 adsSyncReadStateReq.................................................................................................... 17 5.1.14 adsSyncAddDeviceNotificationReq..................................................................................
18 5.1.15 adsSyncDelDeviceNotificationReq................................................................................... 18 5.1.16 adsSyncSetTimeout......................................................................................................... 19 5.1.17 adsSyncGetTimeout......................................................................................................... 19 5.1.18 adsAmsRegisterRouterNotification .................................................................................. 19 5.1.19 adsAmsUnRegisterRouterNotification..............................................................................
19 5.1.20 adsAmsPortEnabled ........................................................................................................ 20 5.2 Extended functionalities .................................................................................................................. 20 5.1.21 getAdsCallbackObject...................................................................................................... 20 5.2.1 adsPortOpenEx................................................................................................................ 20 5.2.2 adsPortCloseEx ...............................................................................................................
21 5.2.3 adsGetLocalAddressEx.................................................................................................... 21 5.2.4 adsSyncWriteReqEx ........................................................................................................ 21 5.2.5 adsSyncWriteReqExArray................................................................................................ 22 5.2.6 adsSyncReadReqEx2...................................................................................................... 22 5.2.7 adsSyncReadWriteReqEx2..............................................................................................
23 5.2.8 adsSyncReadDeviceInfoReqEx....................................................................................... 23 5.2.9 adsSyncWriteControlReqEx............................................................................................. 24 5.2.10 adsSyncReadStateReqEx................................................................................................ 24 5.2.11 adsSyncAddDeviceNotificationReqEx ............................................................................. 25 5.2.12 adsSyncDelDeviceNotificationReqEx .............................................................................. 25 TX1000 3 Version: 1.1
Table of contents
Table of contents 5.2.13 adsSyncSetTimeoutEx..................................................................................................... 26 5.2.14 adsSyncGetTimeoutEx .................................................................................................... 26 5.2.15 adsAmsPortEnabledEx .................................................................................................... 26 6 Samples: TcJavaToAds..........................................................................................................................
28 6.1 Using AdsToJava.dll ....................................................................................................................... 28 6.2 Access by variable name ................................................................................................................ 32 6.3 Accessing an array in the PLC........................................................................................................ 33 6.4 Transmitting structures to the PLC.................................................................................................. 34 6.5 Reading out the PLC variable declaration of a single variable........................................................
35 6.6 Write flag synchronously into the PLC ............................................................................................ 39 6.7 Read flag synchronously from the PLC........................................................................................... 39 6.8 Delete handle of a PLC variable ..................................................................................................... 40 6.9 Event driven reading ....................................................................................................................... 42 6.10 Reading SMB values from the TwinCAT I/O driver.........................................................................
44 6.11 Event-Driven Detection of Changes to the Symbol Table............................................................... 47 6.12 ADS sum command: fetch and release multiple handles................................................................ 48 6.13 ADS sum command: read and write multiple variables................................................................... 52 7 ADS Return Codes .................................................................................................................................. 56 TX1000 4 Version: 1.1
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.1