Beckhoff ADS

TwinCATBeckhoff ADS - 图1 (opens new window) is a control technology developed by Beckhoff Automation. It is a software-based control system used in automation and control applications. TwinCAT is capable of running on a variety of platforms and supports various programming languages.

The Neuron ADS plugin enables users to connect to Beckhoff TwinCAT PLC over TCP/IP.

ADS protocol

ADSBeckhoff ADS - 图2 (opens new window) (Automation Device Specification) is the communication protocol of TwinCAT. It enables the data exchange and control of TwinCAT systems via media-independent serial or network connections. ADS was designed to provide a standardized interface for communication between the controller and the user interface in a TwinCAT system.

AMS Net ID

The AMS Net IDBeckhoff ADS - 图3 (opens new window) is the address of the local computer in the TwinCAT network. It consists of 6 bytes and is represented in a dot notation (e.g., “1.2.3.4.5.6”). The AMS Net IDs must be unique in the TwinCAT network to avoid communication conflicts. By default, TwinCAT generates an AMS Net ID by appending “.1.1” to the IP address of the system. For example, in a system with IP address “172.17.213.60”, the default generated AMS Net ID would be “172.17.213.60.1.1”.

AMS port

An ADS device in the TwinCAT network is identified by an AMS Net ID and a AMS port numberBeckhoff ADS - 图4 (opens new window). Each TwinCAT system typically uses specific port numbers designated as reserved for certain purposes. For example, port 801 is reserved for system communication and port 851 is reserved for event notification.

Index group/offset

ADS index group and index offsetBeckhoff ADS - 图5 (opens new window) are specifications used in the TwinCAT ADS system services for data exchange between devices or programs. All read and write operations take place on the PLC via the index group and index offset. The index group is of 16 bits and the index offset is of 32 bits. The index group is used to specify the category or type of data that is being accessed, while the index offset specifies the specific data element within that category or type.

Parameters

ParameterDescription
PLC IP AddressIP address of the remote device.
PLC PortTCP port of the remote device (default 48898).
Source AdsAmsNetIdAMS Net ID of the machine running neuron.
Source AdsPortNrAMS port number of the machine running neuron (default 851).
Target AdsAmsNetIdAMS Net ID of the target PLC.
Target AdsPortNrAMS port number of the target PLC (default 851).

Note that a ADS route corresponding to the parameter setting should be created in the target TwinCAT software, so that neuron could correctly communicate with the TwinCAT PLC.

Data types

  • BOOL
  • INT8
  • UINT8
  • INT16
  • UINT16
  • INT32
  • UINT32
  • INT64
  • UINT64
  • FLOAT
  • DOUBLE
  • STRING

Address format

In the context of the ADS plugin, a tag address consists of two components, INDEX_GROUP and INDEX_OFFSET, which represents the index group and the index offset respectively.

INDEX_GROUP,INDEX_OFFSET

Both INDEX_GROUP and INDEX_OFFSET could be in decimal or hexadecimal format.

Address Examples

AddressData TypeDescription
0x4040,0x7d01cboolindex_group 0x4040, index_offset 0x7d01c
16448,51029uint8index_group 0x4040, index_offset 0x7d01d
0x4040,512896.5stringindex_group 0x4040, index_offset 0x7d380, string length 5