1. TwinCAT ADS Overview
|The Automation Device Specification (ADS) describes a device-independent and fieldbus-independent interface governing the type of access to ADS devices. This guide describes how to connect ADS TwinCAT2 and ADS TwinCAT3 compatible devices to Edge One™.|
The Beckhoff TwinCAT software system turns almost any compatible PC into a real-time controller with a multi-PLC system, NC axis control, programming environment and operating station. TwinCAT replaces conventional PLC and NC/CNC controllers as well as operating devices with:
- open, compatible PC hardware
- embedded IEC 61131-3 software PLC, software NC and software CNC in Windows NT/2000/XP/Vista, Windows 7, NT/XP Embedded, CE
- programming and run-time systems optionally together on one PC or separated
- connection to all common fieldbuses
- PC interfaces support
- data communication with user interfaces and other programs by means of open Microsoft standards (OPC, OCX, DLL, etc.)
This guide describes the general architecture and features of TwinCAT ADS.
TwinCAT consists of run-time systems that execute control programs in real-time and the development environments for programming, diagnostics and configuration. The TwinCAT system architecture allows the individual modules of the software (e.g. TwinCAT PLC, TwinCAT NC, …) to be treated as independent devices: For every task there is a software module (“Server” or “Client”).
The CloudPlugs Edge One™ ADS module implements a TwinCAT ADS client that supports the TwinCAT2 and TwinCAT3 protocols.
The messages between these objects are exchanged through a consistent ADS interface by the “message router”. This manages and distributes all the messages in the system and over the TCP/IP connections. TwinCAT message routers exist on every TwinCAT PC and on every Beckhoff BCxxxx Bus Controller.
This allows all TwinCAT server and client programs to exchange commands and data.
The following diagram outlines the TwinCAT ADS solution architecture:
TwinCAT offers a precise timebase in which programs are executed with the highest deterministic features, independently of other processor tasks. The real-time load on a PC is set with TwinCAT; defined operating behaviour is achieved in this way. TwinCAT indicates the system load for programs that are running. A load threshold can be set in order to assure a defined computing capacity for the operating programs and for Windows NT/2000/XP/Vista. If this threshold is exceeded, a system message is generated.
The general use of hardware and software from the open PC world requires some checking: Unsuitable components can upset the PC system. Beckhoff has integrated a practical indicator of the real-time jitter, giving administrators an easy way to evaluate the hardware and software. A system message during operation can draw attention to incorrect states.
Depending on the setting, TwinCAT is started and stopped manually or automatically. Since TwinCAT is integrated into Windows NT/2000/XP/Vista and Windows 7as a service, an operator is not needed to start the system: switching on is enough.
When a program is started or restarted, TwinCAT loads programs and remanent data. To back up data and to shut down Windows NT/2000/XP/Vista and Windows 7 correctly, a UPS (uninterruptible power supply) is of great value.
The TwinCAT system can be configured such that real-time capability is maintained in the event of a BSOD (Blue Screen of Death) operating system crash. Real-time tasks such as PLC and NC can therefore continue to run and bring the controlled process into a safe state. Ultimately, it is the decision of the programmer whether or not to utilise this feature, bearing in mind that data or programs may already have been destroyed by the BSOD.
According to the requirement for operating resources, the TwinCAT software devices can be distributed: TwinCAT PLC programs can run on the PCs or on Beckhoff Bus Terminal Controllers. A “message router” manages and distributes all the messages, both in the system and via TCP/IP connections. PC systems can be connected with each other via TCP/IP; Bus Terminal Controllers are integrated via serial interfaces and fieldbuses (EtherCAT, Lightbus, PROFIBUS DP, CANopen, RS232, RS485, Ethernet TCP/IP).
Since standard TCP/IP services of NT/2000/XP/Vista/CE and Windows 7 can be used, this data can be exchanged across the world. The system offers scalable communication capacity and timeout periods for the supervision of communications. OPC provides a standardised means for accessing many different SCADA/MES/ERP packets.
The unique identification of ADS devices is implemented with the aid of two identifiers:
(Note: In terms of a telecommunications analogy, the AdsAmsNetId corresponds to the “STD code” and the ADS-PortNr to the "subscriber number ".)
The ADS devices in a TwinCAT message router are uniquely identified by a number referred to as the ADS-PortNr. For ADS devices this has a fixed specification, whereas pure ADS client applications (e.g., a visualisation system) are allocated a variable ADS port number when they first access the message router. TwinCAT modules on a single PC can exchange data using the ADS-PortNr.
The following ADS port numbers are already assigned:
|ADS-PortNr||ADS device description|
|100||Logger (only NT-Log)|
|301||additional Task 1|
|302||additional Task 2|
|801||PLC RuntimeSystem 1|
|811||PLC RuntimeSystem 2|
|821||PLC RuntimeSystem 3|
|831||PLC RuntimeSystem 4|
TwinCAT also allows the exchange of data between multiple TwinCAT PC’s on the network.
When the services of an ADS device in the network are called on, its message router, or, more precisely, its AMSNetId, must be known. This is achieved through the configuration of the target PC, as a result of which TwinCAT can establish the connection between the TCP/IP address of the target PC and the AMSNetId of the target message router address.
Given that every PC on the network can be uniquely identified by a TCP/IP address, such as “18.104.22.168”, the AdsAmsNetId is an extension of the TCP/IP address and identifies a TwinCAT message router, e.g., “22.214.171.124.1.1”. TwinCAT message routers exist on every TwinCAT PC, and on every Beckhoff BCxxxx bus controller (e.g. BC3100, BC8100, BC9000, …).
By default, the TwinCAT installation constructs the AMSNetId from the TCP/IP address of the PC with an extension of “.1.1” (as if it were a “sub-net mask” for field busses, target bus controllers,…).
However, the AMSNetId can be freely chosen, but is recommended that it is used as a TCP/IP address followed by “”.x.y" where x and y are numbers between 0-255.