Devices compatible with TwinCAT PLC/IO
- Name: TwinCAT
- Version 2.5.0.1
- Protocol: ADS
- Interface: TCP/IP
- Runtime: .NET 4.8 (Windows)
- Configuration:
- Devices / Protocols
Overview
TwinCAT supports Solution Import Tags Reference to setup automatically the mapping.
→ For more information go to Beckhoff TwinCAT Tag Importer.
The TwinCAT communication driver is supported only in Windows Solutions.
Nodes Configuration
Station Configuration
Stations syntax: <AmsNetID> ; <AmsSrvPort>
Where :
- <AmsNetID> = AmsNet ID of the PLC
- <AmsSrvPort> = Port number used for communication.
E.g.: 192.168.1.1.1.1; 801
Points Configuration
Address
The syntax for the TwinCAT communication points is:
- <DeviceTagName>
<DeviceTagName>: Tag Name in PLC.
E.g.: .TAGNAME
Address Prefixes
The software platform supports two specific prefixes in the Address field in the DevicePoints table: TEMPLATE: and DATE:. The TEMPLATE: prefix is used before the PLC address when the point references a UserType or an array. The DATE: prefix is used when the point represents a TwinCAT DATE or DATE_AND_TIME variable.
When working with arrays that contain DATE or DATE_AND_TIME types and are also part of a DataTemplate, both prefixes are combined in the following order:
TEMPLATE:DATE:<my_address>
In the RelativeAddress field of a UserType, used for tag template expansion, only the DATE: prefix is applied, without the TEMPLATE: prefix.
Arrays
If an array is not zero-indexed, the Address field in the DevicePoints table must include the array's starting index in brackets.
Example 1:
If the TwinCAT array is defined as intArray : ARRAY[2..5] OF INT,
then the value in the Address column should be:TEMPLATE:intArray[2]
Example 2:
If the TwinCAT array is defined as intMatrix : ARRAY[2..5, 0..3, 4..7] OF INT,
then the value in the Address column should be:TEMPLATE:intMatrix[2][0][4]
For zero-indexed arrays (e.g., ARRAY[0..N]), it is not necessary to specify the initial index in the address. In those cases, you can simply use the array name (e.g., intArray) in the Address column.
Arrays with Non-Zero-Based Indexing inside Structs
When defining a UserType for a TwinCAT struct that includes an array with a non-zero starting index, the initial index must be specified in the RelativeAddress column of the corresponding UserType member, following the same approach demonstrated in the examples above. The TwinCAT Tag Importer handles this automatically.
Connection Handling
ADS Router Restart Recovery
The TwinCAT communication driver reaches the PLC through the local ADS Router service. If the router restarts — for example after a TwinCAT runtime stop/start, a system update, or a manual TcSystemServiceUi reload — the existing ADS connection handles are invalidated and any in-flight request fails with an ADS error.
The driver detects the router-restart condition automatically. On the next read cycle after the router becomes responsive, the driver re-resolves the AmsNet ID, re-opens the ADS notification handles for all subscribed symbols, and resumes normal communication without any user action. The Communication Driver Status transitions through “Disconnected” while the router is down and back to “Running” once recovery completes. Tags retain their last good value during the outage; their quality changes to Bad until the first successful read after recovery.
No additional configuration is required to enable this behavior. To observe the recovery sequence, enable the TwinCAT and Debug checkboxes in the Trace Window settings — each router restart and the subsequent re-subscription is logged with timestamps.
Driver Revision History
TwinCAT Revision History | |
|---|---|
Version | Notes |
2.5.1.0 | Added automatic recovery after ADS Router restart: driver detects the router-down condition, re-resolves the AmsNet ID, and re-subscribes notification handles without user action. |
2.5.0.1 | Initial release on new documentation standards. |
In this section...