0% found this document useful (0 votes)
199 views240 pages

TwinCAT 3 Grundlagen en

The document is a manual for TwinCAT 3, version 1.1.0, detailing its functionalities, safety guidelines, and real-time operation principles. It covers topics such as target systems, type systems, and support services, aimed at trained specialists in control and automation technology. The manual emphasizes the importance of adhering to safety regulations and maintaining up-to-date security measures for optimal operation.

Uploaded by

Alex Socias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
199 views240 pages

TwinCAT 3 Grundlagen en

The document is a manual for TwinCAT 3, version 1.1.0, detailing its functionalities, safety guidelines, and real-time operation principles. It covers topics such as target systems, type systems, and support services, aimed at trained specialists in control and automation technology. The manual emphasizes the importance of adhering to safety regulations and maintaining up-to-date security measures for optimal operation.

Uploaded by

Alex Socias
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 240

Manual | EN

TwinCAT 3
Basics

2025-02-03 | Version: 1.1.0


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 Real-Time ................................................................................................................................................... 8

3 Target systems ........................................................................................................................................ 13


3.1 Routing ............................................................................................................................................ 13
3.1.1 ADS.................................................................................................................................. 13
3.1.2 AmsNAT......................................................................................................................... 169
3.1.3 ADS-over-MQTT ............................................................................................................ 173
3.1.4 Secure ADS ................................................................................................................... 184
3.2 Folder and file types ...................................................................................................................... 195
3.2.1 TwinCAT PLC project files ............................................................................................. 195
3.2.2 TwinCAT C++ project files ............................................................................................. 200
3.2.3 TwinCAT project files ..................................................................................................... 202
3.2.4 PLC HMI files ................................................................................................................. 202
3.2.5 PLC HMI files (Target Visualization) .............................................................................. 203
3.2.6 PLC HMI Web files......................................................................................................... 203
3.3 Machine update at file level........................................................................................................... 204
3.3.1 Overview ........................................................................................................................ 204
3.3.2 Performing a PLC update............................................................................................... 205
3.3.3 Performing a C++ Update .............................................................................................. 205
3.3.4 Performing an update of the complete machine ............................................................ 205
3.3.5 Cloning a machine ......................................................................................................... 206
3.4 Starting the program automatically ............................................................................................... 206
3.5 Corrected time stamps .................................................................................................................. 207
3.5.1 Overview ........................................................................................................................ 207
3.5.2 System requirements ..................................................................................................... 208
3.5.3 Limitations ...................................................................................................................... 208
3.5.4 Technical introduction .................................................................................................... 208
3.5.5 Real-time API ................................................................................................................. 217
3.5.6 ADS API ......................................................................................................................... 221
3.5.7 Samples ......................................................................................................................... 222
3.5.8 FAQ................................................................................................................................ 225
3.6 TcRTeInstall .................................................................................................................................. 226

4 Type system .......................................................................................................................................... 231


4.1 Project-based type system ............................................................................................................ 231
4.2 Data types ..................................................................................................................................... 231
4.3 Handling of data types .................................................................................................................. 232
4.4 Management and identification of data types................................................................................ 234
4.5 Alignment of data types................................................................................................................. 235
4.6 Files in connection with the type system ....................................................................................... 236

5 Support and Service ............................................................................................................................. 238

TwinCAT 3 Version: 1.1.0 3


Table of contents

4 Version: 1.1.0 TwinCAT 3


Foreword

1 Foreword

1.1 Notes on the documentation


This description is intended exclusively for trained specialists in control and automation technology who are
familiar with the applicable national standards.
The documentation and the following notes and explanations must be complied with when installing and
commissioning the components.
The trained specialists must always use the current valid documentation.

The trained specialists must ensure that the application and use of the products described is in line with all
safety requirements, including all relevant laws, regulations, guidelines, and standards.

Disclaimer

The documentation has been compiled 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 notice.
Claims to modify products that have already been supplied may not 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 and licensed trademarks of
Beckhoff Automation GmbH.
If third parties make use of the designations or trademarks contained in this publication for their own
purposes, this could infringe upon the rights of the owners of the said designations.

EtherCAT® is a registered trademark and patented technology, licensed by Beckhoff Automation GmbH,
Germany

Copyright

© Beckhoff Automation GmbH & Co. KG, Germany.


The distribution and reproduction of this document, as well as the use and communication of its contents
without express authorization, are prohibited.
Offenders will be held liable for the payment of damages. All rights reserved in the event that a patent, utility
model, or design are registered.

Third-party trademarks

Trademarks of third parties may be used in this documentation. You can find the trademark notices here:
https://www.beckhoff.com/trademarks.

TwinCAT 3 Version: 1.1.0 5


Foreword

1.2 For your safety


Safety regulations

Read the following explanations for your safety.


Always observe and follow product-specific safety instructions, which you may find at the appropriate places
in this document.

Exclusion of liability

All the components are supplied in particular hardware and software configurations which are appropriate for
the application. Modifications to hardware or software configurations other than those described in the
documentation are not permitted, and nullify the liability of Beckhoff Automation GmbH & Co. KG.

Personnel qualification

This description is only intended for trained specialists in control, automation, and drive technology who are
familiar with the applicable national standards.

Signal words

The signal words used in the documentation are classified below. In order to prevent injury and damage to
persons and property, read and follow the safety and warning notices.

Personal injury warnings

DANGER
Hazard with high risk of death or serious injury.

WARNING
Hazard with medium risk of death or serious injury.

CAUTION
There is a low-risk hazard that could result in medium or minor injury.

Warning of damage to property or environment

NOTICE
The environment, equipment, or data may be damaged.

Information on handling the product

This information includes, for example:


recommendations for action, assistance or further information on the product.

6 Version: 1.1.0 TwinCAT 3


Foreword

1.3 Notes on information security


The products of Beckhoff Automation GmbH & Co. KG (Beckhoff), insofar as they can be accessed online,
are equipped with security functions that support the secure operation of plants, systems, machines and
networks. Despite the security functions, the creation, implementation and constant updating of a holistic
security concept for the operation are necessary to protect the respective plant, system, machine and
networks against cyber threats. The products sold by Beckhoff are only part of the overall security concept.
The customer is responsible for preventing unauthorized access by third parties to its equipment, systems,
machines and networks. The latter should be connected to the corporate network or the Internet only if
appropriate protective measures have been set up.

In addition, the recommendations from Beckhoff regarding appropriate protective measures should be
observed. Further information regarding information security and industrial security can be found in our
https://www.beckhoff.com/secguide.

Beckhoff products and solutions undergo continuous further development. This also applies to security
functions. In light of this continuous further development, Beckhoff expressly recommends that the products
are kept up to date at all times and that updates are installed for the products once they have been made
available. Using outdated or unsupported product versions can increase the risk of cyber threats.

To stay informed about information security for Beckhoff products, subscribe to the RSS feed at https://
www.beckhoff.com/secinfo.

TwinCAT 3 Version: 1.1.0 7


Real-Time

2 Real-Time
According to the DIN 44300 standard, real-time, or rather real-time operation, is defined as follows:
"Real-time operation is an operating mode of a computing system in which programs for processing data are
continuously operational in such a way that the processing results are available within a specified period of
time."
In other words, the output values of an application program (calculated based on the inner state and input
values) are made available within a defined and guaranteed time. This defined time is also referred to as
cycle time.

The application program itself can consist of several program blocks, which in turn call other programs or
function blocks etc. (see also IEC 61131-3 standard). The program blocks can be assigned to real-time
tasks, which in turn call them with a cycle time to be defined and a defined priority.

TwinCAT 3 Real-Time is a real-time extension that can be used in the current TwinCAT 3.1 version under
Microsoft Windows operating systems from Windows 7 and under TwinCAT/BSD. TwinCAT 3 Real-Time
supports the following features in order to meet the requirements described for the control of industrial
processes:
• Real-time capable scheduling
• Parallel execution of processes
• Direct hardware access

In addition, TwinCAT 3 Real-Time also offers multi-core support to meet the ever-increasing demands for
high-performance and flexible/expandable control platforms. The available cores can either be used
exclusively for TwinCAT or shared with Windows. In the following sections, the cores are therefore referred
to as "isolated" or "shared.

Real-time capable scheduling

TwinCAT 3 Real-Time works with the double-tick method. This means that both switching to real-time mode
and switching back is triggered by an interrupt. The interrupt when switching to the real-time mode also
starts the scheduling at the same time. After an adjustable period of time, at the latest after 90% of the set
cycle time, TwinCAT switches back to "shared" cores in non-real-time mode, so that the guest operating
system has sufficient computing time available to comply with the response times required for hardware
functions etc. The isolated cores are an exception.

Scheduling refers to the (system) process that determines the processing order and the processing time of
the individual tasks, based on the defined cycle time and the defined priority. Strict adherence to the
processing time ensures that the real-time compliance described above is guaranteed.

Triggered by a synchronous basic tick on all real-time kernels, the scheduling for each real-time kernel is
calculated independently in TwinCAT 3 Real-Time. This guarantees that real-time tasks running on different
cores do not interfere with each other. Unless this has been explicitly programmed in the user program by
using interlocks.

Scheduling in which the priority of a task is derived from its cycle time is also known as rate-monotonic
scheduling. The TwinCAT 3 Real-Time automatically activates the "Automatic Priority Management" option.
Since this is not always the best solution for every application, the priorities can be adjusted manually.

8 Version: 1.1.0 TwinCAT 3


Real-Time

Exemplary representation of the call of a PLC task

The figure shows the call of a PLC task. After the real-time tick has occurred, the PLC task is called by the
scheduler. This makes the current input values available to the PLC application (input update), followed by
processing of the application program (cycle update). Finally the results are written to the outputs (output
update). Once this has been completed, the device switches to non-real-time mode (double-tick). As shown
in the figure, the execution time of the user program may vary depending on which code is executed based
on the internal state of the program. Thus the time when the outputs are written also varies. Depending on
which task a bus system is driven, this can cause the sending of the bus telegrams to vary to the same
extent.

Sample call of a task with "I/O at task start“

By using the "I/O at task start" option, the processing order within a task can be changed so that after
reading the inputs, the outputs (of the previous cycle) are written directly before the application program is
executed. Although the outputs are not written until the next cycle, this setting has the advantage that the
time at which the outputs are written to the process/bus is exactly the same in each cycle.

Preemptive multitasking

Preemptive multitasking means that the current state of a process (the CPU and floating-point registers) is
saved in the event of an interrupt (e.g. by higher-priority processes), and the current process is paused. If
this happens, the scheduler determines the (new) process to be executed, based on the task priorities. Once
the process to be interrupted is complete, the process context is restored and the "old" process continues.

TwinCAT 3 Version: 1.1.0 9


Real-Time

Direct hardware access

In order to achieve deterministic (reproducible) real-time behavior, TwinCAT 3 Real-Time requires direct
hardware access. For this to be possible, TwinCAT 3 Real-Time must be executed in Windows kernel mode.
This makes it possible, among other things, for TwinCAT Real-Time to access the network ports directly and
send and receive real-time Ethernet telegrams (e.g. EtherCAT).

Schematic representation of the TwinCAT 3 runtime environment

The following figure illustrates the structure of the TwinCAT 3.1 runtime environment in relation to
scheduling. The TwinCAT 3 runtime environment enables user modules to be executed in real-time. An
essential part of the TwinCAT 3 runtime environment therefore is the real-time driver, which is executed on
the cores that are activated for TwinCAT and handles the scheduling there. The latter takes place
independently on the individual cores.

Isolated cores

As described under real-time scheduling [} 8], TwinCAT uses a double-tick procedure to switch back to non-
real-time mode at a specified point in time. When switching between real-time mode and non-real-time
mode, the preceding process state is restored, as described under Preemptive multitasking [} 9]. The
restoration takes some time, depending on how intensively the real-time and non-real-time programs use the
memory and in particular the cache. In order to eliminate these temporal effects, TwinCAT 3.1 Real-Time
allows cores to be isolated from the guest operating system. This eliminates the need to switch back,
resulting in more computing time for the real-time user program and better real-time quality (less jitter) by
avoiding the time effects associated with restoring the "old" process state.

10 Version: 1.1.0 TwinCAT 3


Real-Time

Behavior when the cycle time is exceeded

If the defined cycle time of a task is exceeded, processing of the "old" cycle continues in the next cycle. In
addition, the task exceed counter is incremented. Once processing of the old / previous cycle is complete,
the system immediately tries to start processing the tasks of the current cycle. If this is completed within the
current cycle, further processing is carried out as shown above.

If the second cycle that follows directly is also exceeded (in this case it is irrelevant whether the system is still
processing the first cycle or whether the second cycle has commenced), the current processing task is
completed, and processing of the next task does not commence until the next possible scheduled cycle start.
This means that several cycles may be lost. The exceed counter is incremented accordingly.

Differences in execution between PLC and "TcCom" runtime modules

Processing of a TwinCAT task, in relation to the execution of runtime modules, is based on the following
sequence:

TwinCAT 3 Version: 1.1.0 11


Real-Time

1. Copying of the inputs to the process images of the runtime modules called by the task.
2. Executing the modules according to the sort order (in ascending order).
3. Output update, which makes the outputs available accordingly. If this task drives an EtherCAT
fieldbus, the frame is provided and sent during the output process image.
4. Post-cycle update: This is used, among other things, to trigger a cycle update when the "I/O at task
start" option is active.

If runtime modules are added to a task, they "log on" to the respective calls of the task. The only exceptions
are PLC runtime modules. For reasons of compatibility with TwinCAT 2, the PLC runtime modules directly
update the inputs and outputs. The difference between the two behaviors is shown in the following figure:

Four runtime modules can be seen in each case. Standard TwinCAT 3 runtime modules log on to the
corresponding method calls of the task. This means that all input updates (yellow) and output updates (red)
are triggered by the task and take place one after the other directly at the start or end of task processing. If
two of these modules communicate with each other via a mapping, they do not receive the current values
until the next cycle.

The PLC runtime modules independently perform an input and output update. If two PLC runtimes
communicate with each other, the runtime module that is executed second directly receives the current
values from the first runtime module. Thus, there is no cycle offset in the communication direction from first
runtime module to second runtime module, but there such an offset does exist in the other direction.

12 Version: 1.1.0 TwinCAT 3


Target systems

3 Target systems
The controller that is currently being programmed with a TwinCAT development environment (TwinCAT
XAE) is referred to as the target system. In this chapter, important basics for handling target systems will be
explained. These are also needed to understand the documentation based on them in the chapter TE1000
XAE.

First, a connection between the development environment and the controller must be created in order to be
able to program a controller. Various channels can be used for this purpose. The individual options are
explained in more detail in the chapter Routing [} 13].

If a controller is already programmed and in the field and you want to update the machine without using the
programming environment, it is necessary to know which files and folders exist, what they are needed for
and how you can best exchange them. The chapters Folder and file types [} 195] and Machine update at file
level [} 204] are devoted to these topics.

Additional programs may also need to be started automatically when TwinCAT is restarted (e.g. an external
HMi). This is explained in the chapter Starting the program automatically [} 206].

If several controllers in a network are working on the same process, it is necessary to correct the timestamps
of the individual controllers when collecting and evaluating data so that the collected data adheres to the
exact time sequence. To achieve this, you can correct the timestamps of the individual controllers
accordingly. This is described in the chapter Corrected time stamps [} 207].

3.1 Routing
As already described in the Philosophy chapter, TwinCAT 3 consists of an engineering environment (XAE)
and a runtime environment (XAR). The engineering environment is used to configure and program the
runtime environments in the field. The runtime environments (target systems) then execute the control
programs in hard real time. The connection between the two environments that do not necessarily run on the
same PC/IPC is established via the ADS protocol (see ADS [} 13] chapter). A route must be entered so that
an engineering environment can communicate with a target system. This means that the other participant is
entered as known on both sides (engineering environment and runtime environment).

In order to take current technical trends and requirements in terms of security and connectivity into account,
you can secure the ADS connection accordingly or tunnel via current transport protocols. See Secure ADS
[} 184] or ADS-over-MQTT [} 173] chapters.

3.1.1 ADS

3.1.1.1 ADS introduction

ADS Definition

The Automation Device Specification describes a device-independent and fieldbus-independent interface


governing the type of access to ADS devices.

The ADS interface permits:


• communication with other ADS devices
• implementation of an ADS device

Communicating ADS Devices

In order to allow participation in ADS communication (as an ADS client or, possibly, as an ADS server) the
following software objects are made available:

TwinCAT 3 Version: 1.1.0 13


Target systems

• ADS-DLL
for use under e.g. C/C++

• ADS.NET [} 5] component
for use under e.g. VB.NET, Visual C#

3.1.1.2 ADS device concept


The TwinCAT system architecture allows the individual modules of the software (e.g. TwinCAT PLC, User
HMI, ...) to be treated as independent devices: For every task there is a software module ("Server" or
"Client"). The servers in the system are the executing working "devices" in the form of software, whose
operating behaviour is exactly like that of a hardware device. For this reason we can speak of "virtual"
devices implemented in the software. The "clients" are programs which request the services of the "servers",
e.g. a visualisation, or even a "programming device" in the form of a program. It is thus possible for TwinCAT
to grow, since there can always be new servers and clients for tasks such as camshaft controllers,
oscilloscopes, PID controllers etc..

The messages between these objects are exchanged through a consistent ADS (Automation Device
Specification) 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 device.


This allows all TwinCAT server and client programs to exchange commands and data, to send messages,
transfer status information, etc..

The following picture shows the TwinCAT device concept, based on ADS:

3.1.1.3 ADS device identification


The unique identification of ADS devices is implemented with the aid of two identifiers:
• PortNr
• NetId

14 Version: 1.1.0 TwinCAT 3


Target systems

AMS ports

ADS devices in a TwinCAT message router are uniquely identified by a number, called the ADS port no. This
is specified and fixed for ADS devices, whereas pure ADS client applications (e.g. a HMI system) are
allocated a variable port number when they first access the message router.

The following AMS port numbers are already assigned:

TwinCAT 3 Version: 1.1.0 15


Target systems

AMS port Device


1 ADS router
2 AMS debugger
10 TCom server
11 TCom server task, RT context
12 TCom server, passive level
20 TwinCAT debugger
21 TwinCAT debugger task
30 License server
100 Logger
110 Event logger
120 Application for EtherCAT devices
130 Event logger user mode (V2)
131 Event logger real-time (V2)
132 Event logger publisher (V2)
200 Ring 0 real-time
290 Ring 0 trace
300 Ring 0 IO
400 Ring 0 PLC (legacy)
500 Ring 0 NC
501 Ring 0 NC SEC
511 Ring 0 NC SPP
520 NC instance
550 Ring ISG
600 Ring 0 CNC
700 Ring 0 line
800 Ring 0 TC2 PLC
801 TC2 PLC runtime system 1
811 TC2 PLC runtime system 2
821 TC2 PLC runtime system 3
831 TC2 PLC runtime system 4
850 Ring 0 TC3 PLC
851 TC3 PLC runtime system 1
852 TC3 PLC runtime system 2
853 TC3 PLC runtime system 3
854 - … TC3 PLC runtime system 4 - …
900 Cam controller
950 CAM tool
1000–1199 Ring 0 IO ports
2000 Ring 0 user
2500 Crestron server
10000 System service
10201 TCP/IP server
10300 System Manager
10400 SMS server
10500 Modbus server
10502 AMS logger
10600 XML data server
10700 Automatic configuration

16 Version: 1.1.0 TwinCAT 3


Target systems

AMS port Device


10800 PLC control
10900 FTP client
11000 NC control system
11500 NC interpreter
11600 GST interpreter
12000 Track control
13000 CAM control
14000 Scope server
14100 Condition monitoring
15000 Sine CH1
16000 CONTROL NET
17000 OPC server
17500 OPC client
18000 Mail server
19000 Virtual COM EL60xx
19100 Management server
19200 Miele@home server
19300 CP-Link 3
19310 Touch lock
19500 Vision service
19800 HMI server
21372 Database server
25000–25999 Reserved port range for ADS servers
25013 FIAS server
25014 Bang&Olufsen server
26000–26999 Private port range for customers
32768–65535 Reserved port range for ADS clients

AMS NetId

Each TwinCAT device in the network is identified by the AMS NetId. The AMS NetId consists of six octets.
The first four octets can be freely selected. The last two octets (usually .1.1) serve as subnet mask for
fieldbuses or further devices. The AMS NetId must be unique for all communication partners.

Configuration:

The AMS NetId of a local or remote TwinCAT device can be set in SYSTEM\Routes\NetId Management of a
TC3 project.

Alternatively, the AMS NetId can be configured locally via the Router category in the TwinCAT SysTray
menu. The device must be restarted after changing the AMS NetId.

TwinCAT 3 Version: 1.1.0 17


Target systems

3.1.1.4 AMS/TCP Packet

3.1.1.4.1 Structure AMS/TCP Packet

Data array Size Description


AMS/TCP Header 6 bytes Contains the length of the data packet.
AMS Header 32 bytes The AMS/TCP-Header contains the addresses of the transmitter and
receiver. In addition the AMS error code , the ADS command Id and
some other information.
ADS Data n bytes The ADS data range contains the parameter of the single ADS
commands. The structure of the data array depends on the ADS
command. Some ADS commands require no additional data.

3.1.1.4.2 AMS/TCP Header

Data array Size Description


reserved 2 bytes These bytes must be set to 0.
Length 4 bytes This array contains the length of the data packet. It consists of the
AMS-Header and the enclosed ADS data. The unit is bytes.

18 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.4.3 AMS Header

Data array Size Description


AMSNetId Target 6 bytes This is the AMSNetId of the station, for which the packet is intended.
Remarks see below [} 19].
AMSPort Target 2 bytes This is the AMSPort of the station, for which the packet is intended.
AMSNetId Source 6 bytes This contains the AMSNetId of the station, from which the packet
was sent.
AMSPort Source 2 bytes This contains the AMSPort of the station, from which the packet was
sent.
Command Id 2 bytes see below [} 20].
State Flags 2 bytes see below [} 20].
Data Length 4 bytes Size of the data range. The unit is byte.
Error Code 4 bytes AMS error number. See ADS Return Codes.
Invoke Id 4 bytes Free usable 32 bit array. Usually this array serves to send an Id. This
Id makes is possible to assign a received response to a request,
which was sent before.
Data n bytes Data range. The data range contains the parameter of the
considering ADS commands.

AMS Net Id

The AMSNetId consists of 6 bytes and addresses the transmitter or receiver. One possible AMSNetId would
be e.g.. 172.16.17.10.1.1. The storage arrangement in this example is as follows:

The AMSNetId is purely logical and has usually no relation to the IP address. The AMSNetId is configurated
at the target system. At the PC for this the TwinCAT System Control is used. If you use other hardware, see
the considering documentation for notes about settings of the AMS NetId.

TwinCAT 3 Version: 1.1.0 19


Target systems

Command Id

Cmd Description
0x0000 Invalid
0x0001 ADS Read Device Info [} 21]
0x0002 ADS Read [} 21]
0x0003 ADS Write [} 22]
0x0004 ADS Read State [} 22]
0x0005 ADS Write Control [} 23]
0x0006 ADS Add Device Notification [} 23]
0x0007 ADS Delete Device Notification [} 24]
0x0008 ADS Device Notification [} 25]
0x0009 ADS Read Write [} 26]

Other commands are not defined or are used internally. Therefore the Command Id is only allowed to
contain the above enumerated values!

State Flags

Flag Description
0x0001 0: Request / 1: Response
0x0004 ADS command

The first bit marks, whether it´s a request or response. The third bit must be set to 1, to exchange data with
ADS commands. The other bits are not defined or were used for other internal purposes.

Therefore the other bits must be set to 0!

Flag Description
0x000x TCP Protocol
0x004x UDP Protocol

Bit number 7 marks, if it should be transferred with TCP or UDP.

3.1.1.4.4 ADS Commands

3.1.1.4.4.1 Command Overview


Command Description
ADS Read Device Info [} 21] Reads the name and the version number of the ADS device.
ADS Read [} 21] With ADS Read data can be read from an ADS device
ADS Write [} 22] With ADS Write data can be written to an ADS device.
ADS Read State [} 22] Reads the ADS status and the device status of an ADS device.
ADS Write Control [} 23] Changes the ADS status and the device status of an ADS device.
ADS Add Device Notification [} 23] A notification is created in an ADS device.
ADS Delete Device Notification [} 24] One before defined notification is deleted in an ADS device.
ADS Device Notification [} 25] Data will carry forward independently from an ADS device to a
Client
ADS Read Write [} 26] With ADS ReadWrite data will be written to an ADS device.
Additionally, data can be read from the ADS device.

20 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.4.4.2 ADS Read Device Info


Reads the name and the version number of the ADS device.

Request

No additional data required

Response

Data array Size Description


Result 4 bytes ADS error number.
Major Version 1 byte Major version number
Minor Version 1 byte Minor version number
Version Build 2 bytes Build number
Device Name 16 bytes Name of ADS device

3.1.1.4.4.3 ADS Read


With ADS Read data can be read from an ADS device. The data are addressed by the Index Group and the
Index Offset

Request

Data array Size Description


Index Group 4 bytes Index Group of the data which should be read.
Index Offset 4 bytes Index Offset of the data which should be read.
Length 4 bytes Length of the data (in bytes) which should be read.

Response

TwinCAT 3 Version: 1.1.0 21


Target systems

Data array Size Description


Result 4 bytes ADS error number
Length 4 bytes Length of data which are supplied back.
Data n bytes Data which are supplied back.

3.1.1.4.4.4 ADS Write


With ADS Write data can be written to an ADS device. The data are addressed by the Index Group and the
Index Offset

Request

Data array Size Description


Index Group 4 bytes Index Group in which the data should be written
Index Offset 4 bytes Index Offset, in which the data should be written
Length 4 bytes Length of data in bytes which are written
Data n bytes Data which are written in the ADS device.

Response

Data array Size Description


Result 4 bytes ADS error number

3.1.1.4.4.5 ADS Read State


Reads the ADS status and the device status of an ADS device.

Request

No additional data required

Response

22 Version: 1.1.0 TwinCAT 3


Target systems

Data array Size Description


Result 4 bytes ADS error number.
ADS State 2 bytes ADS status (see data type ADSSTATE of the ADS-DLL).
Device State 2 bytes Device status

3.1.1.4.4.6 ADS Write Control


Changes the ADS status and the device status of an ADS device. Additionally it is possible to send data to
the ADS device to transfer further information. These data were not analyzed from the current ADS devices
(PLC, NC, ...)

Request

Data array Size Description


ADS State 2 bytes New ADS status (see data type ADSSTATE of the ADS-DLL).
Device State 2 bytes New device status.
Length 4 bytes Length of data in byte.
Data n bytes Additional data which are sent to the ADS device

Response

Data array Size Description


Result 4 bytes ADS error number.

3.1.1.4.4.7 ADS Add Device Notification


A notification is created in an ADS device.

Note: We recommend to announce not more than 550 notifications per device. Otherwise increase the
payload by working with structures or use sum commands.

TwinCAT 3 Version: 1.1.0 23


Target systems

Request

Data array Size Description


Index Group 4 bytes Index Group of the data, which should be sent per notification.
Index Offset 4 bytes Index Offset of the data, which should be sent per notification.
Length 4 bytes Length of data in bytes, which should be sent per notification.
Transmission Mode 4 bytes See description of the structure ADSTRANSMODE at the ADS-
DLL.
Max Delay 4 bytes At the latest after this time, the ADS Device Notification is called.
The unit is 1ms.
Cycle Time 4 bytes The ADS server checks if the value changes in this time slice.
The unit is 1ms
reserved 16bytes Must be set to 0

Response

Data array Size Description


Result 4 bytes ADS error number
Notification Handle 4 bytes Handle of notification

3.1.1.4.4.8 ADS Delete Device Notification


One before defined notification is deleted in an ADS device.

Request

Data array Size Description


Notification Handle 4 bytes Handle of notification. The handle is created by the ADS command
Add Device Notification

24 Version: 1.1.0 TwinCAT 3


Target systems

Response

Data array Size Description


Result 4 bytes ADS error number

3.1.1.4.4.9 ADS Device Notification


Data will carry forward independently from an ADS device to a Client.

Request

The data which are transferred at the Device Notification are multiple nested into one another. The
Notification Stream contains an array with elements of type AdsStampHeader. This array again contains
elements of type AdsNotificationSample.

AdsNotificationStream

Data array Size Description


Length 4 bytes Size of data in byte.
Stamps 4 bytes Number of elements of type AdsStampHeader [} 25]
AdsStampHeader n bytes Array with elements of type AdsStampHeader [} 25]

AdsStampHeader

Data array Size Description


TimeStamp 8 bytes The timestamp is coded after the Windows FILETIME format.
I.e. the value contains the number of the 100-nanosecond
intervals, which passed since 1.1.1601. In addition, the local
time change is not considered. Thus the time stamp is present
as universal Coordinated time (UTC).
Samples 4 bytes Number of elements of type AdsNotificationSample [} 26]
AdsNotificationSample n bytes Array with elements of type AdsNotificationSample [} 26]

TwinCAT 3 Version: 1.1.0 25


Target systems

AdsNotificationSample

Data array Size Description


Notification Handle 4 Bytes Handle of notification.
Sample Size 4 Bytes Size of data range in bytes.
Data n Bytes Data

If your handle becomes invalid, one notification without data will be send once as advice.

3.1.1.4.4.10 ADS Read Write


With ADS ReadWrite data will be written to an ADS device. Additionally, data can be read from the ADS
device.

The data which can be read are addressed by the Index Group and the Index Offset

Request

Data array Size Description


Index Group 4 bytes Index Group, in which the data should be written.
Index Offset 4 bytes Index Offset, in which the data should be written
Read Length 4 bytes Length of data in bytes, which should be read.
Write Length 4 bytes Length of data in bytes, which should be written
Data n bytes Data which are written in the ADS device.

Response

Data array Size Description


Result 4 bytes ADS error number
Length 4 bytes Length of data which are supplied back.
Data n bytes Data which are supplied back.

26 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5 Specification for ADS devices

3.1.1.5.1 General
The PLC software can be described as a virtual field unit (Automation Device), since it is a pure software
PLC. It therefore provides a Beckhoff ADS (Automation Device Specification) interface for other
communication partners (e.g. other virtual field units or Windows programs), via which it can be
parameterised or interrogated. Use of the ADS standardises access to the PLC and incorporates it into the
range of available virtual field units.

The READ and WRITE operations take place on the PLC interface (as defined by ADS) via two numbers: the
index group (16 bit) and the index offset (32 bit). The ADS interface of the PLC will be described in more
detail in the following pages with regard to the group and offset indices.

Specification "Index-Group" of the PLC

The four global ranges of an ADS unit are shown as follows for the PLC as four sections in the index groups:

Index-Group (0x = hex) Index Group description


0x00000000 0x00000FFF reserved
0x00001000 PLC ADS parameter range
0x00002000 PLC ADS status range
0x00003000 PLC ADS unit function range
0x00004000 PLC ADS services ( includes services to access PLC
memory range (%M field) ) [} 27]
0x00006000 0x0000EFFF reserved for PLC ADS extension
0x0000F000 0x0000FFFF general TwinCAT ADS system services ( includes
services to access PLC process diagram of the
physical inputs and outputs ) [} 28]

3.1.1.5.2 Specification of the PLC services


This section includes services to access the PLC memory range (%M field).

Index Group Index Offset Access Data type Description Remarks


0x00004020 0x00000000- R/W UINT8[n] READ_M - WRITE_M PLC memory
0x0000FFFF range(%M field).Offset is byte offset.
0x00004021 0x00000000- R/W UINT8 READ_MX - WRITE_MX PLC
0xFFFFFFFF memory range (%MX field).The low
word of the index offset is the byte
offset. The index offset contains the
bit address calculated from the byte
number *8 + bit number
0x00004025 0x00000000 R ULONG PLCADS_IGR_RMSIZE
Byte length of the process diagram
of the memory range
0x00004030 0x00000000- R/W UINT8 PLCADS_IGR_RWRB
0xFFFFFFFF Retain data range. The index offset
is byte offset
0x00004035 0x00000000 R ULONG PLCADS_IGR_RRSIZE
Byte length of the retain range
0x00004040 0x00000000- R/W UINT8 PLCADS_IGR_RWDB
0xFFFFFFFF Data range. The index offset is byte
offset.
0x00004045 0x00000000 R ULONG PLCADS_IGR_RDSIZE
Byte length of the data range

TwinCAT 3 Version: 1.1.0 27


Target systems

3.1.1.5.3 Specification of the ADS system services


This section covers those ADS services which have identical meanings and effects with every TwinCAT ADS
unit. In this section are also included services to access the PLC process diagram of the physical inputs and
outputs.

28 Version: 1.1.0 TwinCAT 3


Target systems

Index Index Access Data type Description


Group Offset
0x0000F003 0x00000000 R&W W: UINT8[n] R: UINT32 GET_SYMHANDLE_BYNAME
A handle (code word) is
assigned to the name
contained in the write data and
is returned to the caller as a
result.
0x0000F004 0x00000000 Reserved.
0x0000F005 0x00000000- R/W UINT8[n] READ_/
0xFFFFFFFF=sym WRITE_SYMVAL_BYHANDL
Handle E Reads the value of the
variable identified by ‚symHdl'
or assigns a value to the
variable. The ‚symHdl' must
first have been determined by
the
GET_SYMHANDLE_BYNAME
services.
0x0000F006 0x00000000 W UINT32 RELEASE_SYMHANDLE The
code (handle) contained in the
write data for an interrogated,
named PLC variable is
released.
0x0000F020 0x0001F400- R/W UINT8[n] READ_I - WRITE_I PLC
0xFFFFFFFF process diagram of the
physical inputs (%I field).
Offset is byte offset.
0x0000F021 0x000FA000- R/W UINT8 READ_IX - WRITE_IX PLC
0xFFFFFFFF process diagram of the
physical inputs (%IX field). The
index offset contains the bit
address which is calculated
from base offset (0xFA000) +
byte number +8 + bit number
0x0000F025 0x00000000 R ULONG ADSIGRP_IOIMAGE_RISIZEB
yte length of the PLC process
diagram of the physical inputs.
0x0000F030 0x0003E800- R/W UINT8[n] READ_Q - WRITE_Q PLC
0xFFFFFFFF process diagram of the
physical outputs (%Q field).
Offset is byte offset.
0x0000F031 0x001F4000- R/W UINT8 READ_QX - WRITE_QX PLC
0xFFFFFFFF process diagram of the
physical outputs(%QX field).
The index offset contains the
bit address which is calculated
from the base offset
(0x1F4000) + byte number *8 +
bit number.
0x0000F035 0x00000000 R ULONG ADSIGRP_IOIMAGE_ROSIZE
Byte length of the PLC process
diagram of the physical
outputs.

TwinCAT 3 Version: 1.1.0 29


Target systems

Index Index Access Data type Description


Group Offset
0x0000F080 0x00000000- R&W W: ADSIGRP_SUMUP_READ
0xFFFFFFFF= n n * ULONG[3] := The write-data contains a list of
(number of internal IG1, IO1, Len1, multiple, separate
sub- IG2, IO2, Len2, AdsReadReq(IG, IO, Len,
commands)n(max) ..., Data) sub-commands. The
= 500 IG(n), IO(n), Len(n) read-data contains a list of
return codes followed by the
R: requested data.
n * ULONG
+ UINT8[Len1]
+ UINT8[Len2]
+ ...,
+ UINT8[Len(n)] :=
Result1, Result2, ..., Result(n),
Data1, Data2, ..., Data(n)

0x0000F081 0x00000000- R&W W: ADSIGRP_SUMUP_WRITE


0xFFFFFFFF= n (n * ULONG[3]) The write-data contains a list of
(number of internal + UINT8[Len1] multiple, separate
sub- + UINT8[Len2] AdsWriteReq(IG, IO, Len,
commands)n(max) + ..., Data) sub-commands.
= 500 + UINT8[Len(n)] := The read-data contains a list of
IG1, IO1, Len1, return codes.
IG2, IO2, Len2,
...,
IG(n), IO(n), Len(n),
Data1, Data2, ..., Data(n)

R:
n * ULONG :=
Result1, Result2, ...,
Result(n)

30 Version: 1.1.0 TwinCAT 3


Target systems

Index Index Access Data type Description


Group Offset
0x0000F082 0x00000000- R&W W: ADSIGRP_SUMUP_READWR
0xFFFFFFFF= n (n * ULONG[4]) ITE The write-data contains a
(number of internal + UINT8[WriteLen1] list of multiple, separate
sub- + UINT8[WriteLen2] AdsReadWriteReq(IG, IO,
commands)n(max) + ..., readLen, writeLen, Data) sub-
= 500 + UINT8[WriteLen(n)] := commands.
IG1, IO1, ReadLen1, The read-data contains a list of
WriteLen1, return codes and return data
IG2, IO2, ReadLen2, length followed by the
WriteLen2, requested data.
...,
IG(n), IO(n), ReadLen(n), ...,
WriteLen(n),
WriteData1, WriteData2, ...,
WriteData(n)

R:
(n * ULONG[2])
+ UINT8[ReturnLen1]
+ UINT8[ReturnLen2]
+ ...,
+ UINT8[ReturnLen(n)] :=
Result1, ReturnLen1,
Result2, ReturnLen2,
...,
Result(n), ReturnLen(n),
ReadData1, ReadData2, ...,
ReadData(n)

0x0000F083 0x00000000- R&W W: ADSIGRP_SUMUP_READEX


0xFFFFFFFF= n n * ULONG[3] := The write-data contains a list of
(number of internal IG1, IO1, Len1, multiple, separate
sub- IG2, IO2, Len2, AdsReadReq(IG, IO, Len,
commands)n(max) ..., Data) sub-commands.The
= 500 IG(n), IO(n), Len(n) read-data contains a list of
return codes followed by the
R: requested data.
n * ULONG
+ UINT8[Len1]
+ UINT8[Len2]
+ ...,
+ UINT8[Len(n)] :=
Result1, Result2, ..., Result(n),
Data1, Data2, ..., Data(n)

TwinCAT 3 Version: 1.1.0 31


Target systems

Index Index Access Data type Description


Group Offset
0x0000F084 0x00000000- R&W W: ADSIGRP_SUMUP_READEX
0xFFFFFFFF= n n * ULONG[3] := 2 The write-data contains a list
(number of internal IG1, IO1, Len1, of multiple, separate
sub- IG2, IO2, Len2, AdsReadReq(IG, IO, Len,
commands)n(max) ..., Data) sub-commands.The
= 500 IG(n), IO(n), Len(n) read-data contains a list of
return codes followed by the
R: requested data.
n * ULONG
+ UINT8[Len1]
+ UINT8[Len2]
+ ...,
+ UINT8[Len(n)] :=
Result1, Result2, ..., Result(n),
Data1, Data2, ..., Data(n)

0x0000F085 0x00000000- R&W W: ADSIGRP_SUMUP_ADDDEV


0xFFFFFFFF= n (n * ULONG[3]) := NOTE The write-data contains
(number of internal IG1, IO1, Len1, a list of multiple, separate
sub- IG2, IO2, Len2, AdsAddDeviceNotifications(IG,
commands)n(max) ..., IO, Len, Data) sub-
= 500 IG(n), IO(n), Len(n) commands.The read-data
contains a list of return codes
followed by the requested
R: notification handles.
(n * ULONG)
+ UINT8[Len1]
+ UINT8[Len2]
+ ...,
+ UINT8[Len(n)] :=
Result1, Result2, ...,
Result(n),
Handle1, Handle2,...,
Handle(n)

0x0000F086 0x00000000- R&W W: ADSIGRP_SUMUP_DELDEV


0xFFFFFFFF= n Handle1, Handle2,..., NOTE The write-data contains
(number of internal Handle(n) a list of multiple handles.The
sub- read-data contains a list of
commands)n(max) return codes.
= 500 R:
(n * ULONG)
+ UINT8[Len1]
+ UINT8[Len2]
+ ...,
+ UINT8[Len(n)] :=
Result1, Result2, ...,
Result(n)

3.1.1.5.4 Specification of the NC


This documentation contains all TwinCAT 3 specific modifications and new features.

32 Version: 1.1.0 TwinCAT 3


Target systems

Index-Group Description Remarks


(Hex)
0x1000 Ring-0-Manager: Parameter [} 35] Optional!
0x1100 Ring-0-Manager: State [} 36] Optional!
0x1200 Ring-0-Manager: Functions [} 36] Optional!
0x1300 Ring-0-Manager: Cyclic process data Not implemented!

0x2000 + ID Channel with corresponding ID: parameters [} 37]


0x2100 + ID Channel with corresponding ID: state [} 40]
0x2200 + ID Channel with corresponding ID: functions [} 43]
0x2300 + ID Channel with corresponding ID: cyclic process data [} 46]

0x3000 + ID Group with corresponding ID: parameters [} 47] Optional!


0x3100 + ID Group with corresponding ID: state [} 52] Optional!
0x3200 + ID Group with corresponding ID: functions [} 58] Optional!
0x3300 + ID Group with corresponding ID: cyclic process data Not implemented!

0x4000 + ID Axis with corresponding ID: parameters [} 64]


0x4100 + ID Axis with corresponding ID: state [} 77]
0x4200 + ID Axis with corresponding ID: functions [} 87]
0x4300 + ID Axis with corresponding ID: cyclic process data [} 109]

0x5000 + ID Encoder with corresponding ID: parameters [} 114] Optional!


0x5100 + ID Encoder with corresponding ID: state [} 119] Optional!
0x5200 + ID Encoder with corresponding ID: functions [} 124] Optional!
0x5300 + ID Encoder with corresponding ID: cyclic process data [} 127] Optional!

0x6000 + ID Controller with corresponding ID: Parameter [} 131] Optional!


0x6100 + ID Controller with corresponding ID: State [} 135] Optional!
0x6200 + ID Controller with corresponding ID: Functions [} 138] Optional!
0x6300 + ID Controller with corresponding ID: cyclic process data Not implemented!

0x7000 + ID Drive with corr. ID: parameters [} 139] Optional!


0x7100 + ID Drive with corr. ID: state [} 143] Optional!
0x7200 + ID Drive with corr. ID: functions [} 145] Optional!
0x7300 + ID Drive with corr. ID: cyclic process data [} 146] Optional!

0x0A000 + ID Tables (n x m) with corresponding ID: parameters [} 149] Maximum number of


0x0A000+ID for table ID [1..255] tables extended to 4095
0x1A000+ID for table ID [256..4095] (from TC3.1 B4021)
...
0xFA000+ID for table ID [3840..4095]
0x0A100 + ID Tables (n x m) with corresponding ID: state [} 153]
0x0000A100+IDLowByte for table ID [1..255]
0x0001A100+IdLowByte for table ID [256..4095] …
0x000FA100+IdLowByte for table ID [3840..4095]
0x000nA100+IdLowByte for table ID [1..4095]
(TabID = n * 256 + IdLowByte)

TwinCAT 3 Version: 1.1.0 33


Target systems

Index-Group Description Remarks


(Hex)
0x0A200 + ID Tables (n x m) with corresponding ID: functions [} 154]
0x0000A100+IDLowByte for table ID [1..255]
0x0001A100+IdLowByte for table ID [256..4095] …
0x000FA100+IdLowByte for table ID [3840..4095]
0x000nA100+IdLowByte for table ID [1..4095]
(TabID = n * 256 + IdLowByte)
0x0A300 + ID Tables (n x m) with corresponding ID: cyclic process data Not implemented!
0x0000A100+IDLowByte for table ID [1..255]
0x0001A100+IdLowByte for table ID [256..4095] …
0x000FA100+IdLowByte for table ID [3840..4095]
0x000nA100+IdLowByte for table ID [1..4095]
(TabID = n * 256 + IdLowByte)

0xF000 ... reserved area (TwinCAT system area)


0xFFFF
IndexGroup: IndexOffset:
0xF081 0x00000000 ... ADSIGRP_SUMUP_WRITE
0xFFFFFFFF The Read-Write-command contains a list in
(n elements) the Write-data of multiple separate ADS-
Write-commands (like a group request).
Structure of the Write-Data:
[ IdxGrp(1), IdxOff(1), WriteLen(1), ...,
IdxGrp(n), IdxOff(n), WriteLen(n),
WriteData(1), ..., WriteData(n) ]
Structure of the Read-Data:
[ Error(1), ..., Error(n) ]
0xF082 0x00000000 ... ADSIGRP_SUMUP_READWRITE
0xFFFFFFFF The Read-Write-command contains a list in
(n elements) the Write-data of multiple separate ADS-
Read-Write-commands (like a group request).
Structure of the Write-Data:
[ IdxGrp(1), IdxOff(1),ReadLen(1),
WriteLen(1), ..., IdxGrp(n), IdxGrp(n),
ReadLen(n), WriteLen(n),
WriteData(1), ..., WriteData(n) ]
Structure of the Read-Data:
[ Error(1), ReadLen(1), ..., Error(n),
ReadLen(n), ReadData(1), ..., ReadData(n) ]
0xF084 0x00000000 ... ADSIGRP_SUMUP_READ (READEX2)
0xFFFFFFFF The Read-Write-command contains a list in
(n elements) the Write-data of multiple separate ADS-
Read-commands (like a group request).
Structure of the Write-Data:
[ IdxGrp(1), IdxOff(1), ReadLen(1), ...,
IdxGrp(n), IdxGrp(n), ReadLen(n) ]
Structure of the Read-Data:
[ Error(1), ReadLen(1), ..., Error(n),
ReadLen(n),
ReadData(1), ..., ReadData(n) ]

34 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.1 Specification Ring-0-Manager

3.1.1.5.4.1.1 "Index offset" specification for Ring-0 parameter (Index group


0x1000)
Index offset Access Ring-0-Man- Data type Phys. Definition Description Remarks
(Hex) ager unit range
0x00000010 Read every UINT32 100 ns Cycle time SAF task
0x00000012 Read every UINT32 100 ns Cycle time SVB task
0x00000014 Read every INT32 ns Global Time
Compensation Shift (for
SAF Task)

0x00000020 Read/Write every UINT16 1 0/1 Cyclic data consistence


check and correction of
the NC setpoint values

TwinCAT 3 Version: 1.1.0 35


Target systems

3.1.1.5.4.1.2 "Index offset" specification for Ring-0 state (Index group 0x1100)
Index offset Access Ring-0-Man- Data type Phys. Definition Description Remarks
(Hex) ager unit range
0x00000001 Read every UINT32 1 0, 1...255 Quantity of Channel
0x00000002 Read every UINT32 1 0, 1...255 Quantity of group
0x00000003 Read every UINT32 1 0, 1...255 Quantity of Axis
0x00000004 Read every UINT32 1 0, 1...255 Quantity of Encoder
0x00000005 Read every UINT32 1 0, 1...255 Quantity of controller
0x00000006 Read every UINT32 1 0, 1...255 Quantity of Drives
0x0000000A Read every UINT32 1 0, 1...255 Quantity of table (n x m)

0x00000010 Read every UINT32 1 Cycle time error counter Reserved!


SAF task (not scopeable)
0x00000014 Read every UINT32 1 IO-cycle time error Reserved!
counter SAF task (not
scopeable)

0x00000020 Read every UINT32 s Computing time SAF task Reserved!


(not scopeable)

0x00000031 Read every UINT32[n] 1 0, 1...255 Supplies the channel IDs


for all channels in the
system
0x00000032 Read every UINT32[n] 1 0, 1...255 Supplies the group IDs
for all groups in the
system
0x00000033 Read every UINT32[n] 1 0, 1...255 Supplies the axis IDs for
all axes in the system
0x00000034 Read every UINT32[n] 1 0, 1...255 Supplies the encoder IDs
for all encoders in the
system
0x00000035 Read every UINT32[n] 1 0, 1...255 Supplies the controller
IDs for all controllers in
the system
0x00000036 Read every UINT32[n] 1 0, 1...255 Supplies the drive IDs for
all drives in the system
0x0000003A Read every UINT32[n] 1 0, 1...255 Supplies the table IDs for
all tables in the system

0x000001nn Read every UINT32 1 0, 1...255 Supplies for the encoder Reserved!
ID the appropriate axis
IDnn = Encoder ID
0x000002nn Read every UINT32 1 0, 1...255 Supplies for the controller Reserved!
ID the appropriate axis
IDnn = Controller ID
0x000003nn Read every UINT32 1 0, 1...255 Supplies for the drive ID Reserved!
the appropriate axis IDnn
= Drive ID

3.1.1.5.4.1.3 "Index offset" specification for Ring-0 functions (Index group


0x1200)
Index offset Access Ring-0-Man- Data type Phys. Definition Description Remarks
(Hex) ager unit range
0x00000020 Write every VOID 1 Clear cycle time error Reserved!
counter SAF & SVB

36 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.2 Specification Channels

3.1.1.5.4.2.1 "Index offset" specification for channel parameter (Index group


0x2000 + ID)

TwinCAT 3 Version: 1.1.0 37


Target systems

Index-Offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Read every UINT32 1 Channel ID
0x00000002 Read every UINT8[30+1] 1 Channel name
0x00000003 Read every UINT32 1 ENUM Channel type [} 154]
0x00000004 Read every UINT32 1 ENUM Interpreter type
[} 154]
0x00000005 Read every UINT32 1 Program load buffer
size in bytes
0x00000006 Read every UINT32 1 Program no. according
to job list
0x00000007 Read/Write every UINT32 1 ENUM Set load log mode
[} 155]
0x00000008 Read/Write every UINT32 1 ENUM Set trace mode [} 155]
0x00000009 Read/Write every UINT32 1 RESERVED
0x0000000A Read/Write every UINT32 1 0/1 Records all feeder
entries in a log file
named "TcNci.log"
0x0000000B Read/Write every UINT32 1 0/1 Channel specific level
for NC logger
messages
0: errors only
1: all NC messages

0x00000010 ReadWrite every Write


{
UINT32 1 0..159 Start index of M
function
UINT32 1 1..160 Number of M functions
to be read
}
Read [n]
{
UINT8 1 0..159 Rule bit mask of the M
function
INT32[10] 1 -1..159 Number of M functions
to be cleared
}
0x00000011 Write Interpolation Write M function Only used
description internally!
0x00000012 Read/Write Interpolation LREAL64 1 Factor for G70
0x00000013 Read/Write Interpolation LREAL64 1 Factor for G71
0x00000014 Write Interpolation { Axes user symbols not yet released
char[32] User symbol (null-
terminated)
char[10] System symbol (null-
terminated)
}
0x00000015 Read/Write Interpolation UINT16 resp. 1 0/1 default: Activation of default G- NEW from
UINT32 FALSE code TC3.1 B4014

0x00000021 Read every UINT32 1 Group ID (only explicit


for 3D and FIFO
channel)

0x00000031 Read/Write Interpolation UINT16 1 Standard output port Reserved


of the interpreter function,
no standard!
0x00000032 Read/Write Interpolation UINT16 1 0/1 Cartesian tool offset Reserved
entry function,
no standard!

38 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000040 Read/Write Interpolation { Target address of Reserved
interpreter hooks function,
char[6] Ams Net ID no standard!
UINT16 Port
UINT32 Index group
UINT32 Index offset
}
0x00000050 Read/Write Interpolation UINT32 1 ENUM Reaction if at the
radius compensation a
bottle neck is
recognized
0: Error and abort
1: Note & trouble
shooting
2: Only note, without
outline modulation
0x00000051 Read/Write Interpolation UINT32 1 1..24 Look ahead for
bottleneck detection
0x00000052 Read/Write Interpolation UINT32 1 0/1 Chamfer on/off reserved
function,
no standard!
0x00000053 Read/Write Interpolation UINT32 1 Activation for reading
the currently effective
interpolation rules,
zero shifts and rotation
0: off 1: on
0x00000054 Read/Write Interpolation UINT32 1 0/1 Retrace on/off Reserved
function,
no standard!
0x00000055 Read/Write Interpolation UINT32[4] 1 Configuration of the
cyclic channel
interface for UINT32;
up to 4 index offsets
can be configured.
0x00000056 Read/Write Interpolation UINT32[4] 1 Configuration of the
cyclic channel
interface for LREAL;
up to 4 index offsets
can be configured.

0x00010K0L Read/Write every REAL64 e.g. mm ±MAX REAL64 Value for zero shift
(NPV)
[1..3] Axis index
K=1 → X
K=2 → Y
K=3 → Z
[1..0xA] L=1 → G54F
L=2 → G54G
L=3 → G55F ...
0x0002ww00 Read/Write every UINT16 Tool number: values
for tool compensation
0x0003ww00 Read/Write every UINT16 [1...50] Tool type:
ww = tool 1...50
0x0004wwnn Read/Write every REAL64 [1...14] Parameter:
nn = Index 1...14
0x000500gg Read/Write every REAL64 e.g. mm ≥ 0 (value) Radius of the
[1...9] (g) tolerance sphere gg =
channel group
(default: 1)

TwinCAT 3 Version: 1.1.0 39


Target systems

3.1.1.5.4.2.2 "Index offset" specification for channel state (Index group 0x2100 +
ID)

40 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Read every INT32 1 ENUM Error code Channel
0x00000002 Read every UINT32 1 Number of groups in
the Channel
0x00000003 Read every UINT32 1 ENUM Interpreter status Cannot be
[} 155] traced by
oscilloscope!
0x00000004 Read every UINT32 1 ENUM Interpreter/channel
operation mode
[} 155]
0x00000005 Read every UINT32 1 Currently loaded
program
0x00000007 Read every UINT8[...] 1 Program name of Max. 100
currently loaded characters, null-
program terminated
(100 characters, null-
terminated)
0x00000008 Read Interpreter UINT32 1 [0,1] Interpreter simulation Cannot be
mode traced by
oscilloscope!
0: off (default)
1: on
0x00000010 Read Interpreter UINT32 1 Text index Cannot be
traced by
If the interpreter is in
oscilloscope!
the aborted state, the
current text index can
be read out here
0x00000011 ReadWrite Interpreter Write Cannot be
UINT32 1 Text index traced by
oscilloscope!
Read
UINT8[..] 1 Line of the NC part
program from the text
index
0x00000012 Read Interpreter {
UINT32 1 Current display for
1: SAF
2: Interpreter
3: Error offset
UINT32 1 File offset
UINT8[260] 1 Path + program name
}
0x00000013 Read Interpreter UINT32[18] Display for currently The technology
effective G-code data must first
be activated.
0x00000014 Read Interpreter { Determines the The technology
currently effective zero data must first
shift be activated.
UINT32 1 Block counter
UINT32 Dummy
LREAL[3] 1 Zero shift G54..G57
LREAL[3] 1 Zero shift G58
LREAL[3] 1 Zero shift G59
}
0x00000015 Read Interpreter { Determines the The technology
currently effective data must first
rotation be activated.
UINT32 1 Block counter
UINT32 1 Dummy
LREAL[3] 1 Rotation of X, Y & Z in
degrees
}
0x00000016 Read Interpreter UINT32 1 [0,1] Feeder Info Only used
internally! Not
standard

TwinCAT 3 Version: 1.1.0 41


Target systems

Index-Offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000100 Read every UINT32 [n] 1 [0, 1...255] Returns the respective Cannot be
axis IDs in the channel traced by
number: [1...255] axis oscilloscope!
ID's: [0, 1...255]

42 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.2.3 "Index offset" specification for channel functions (Index group


0x2200 + ID)

TwinCAT 3 Version: 1.1.0 43


Target systems

Index offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Write every UINT32 1 Load NC program with
program number
0x00000002 Write every VOID Start Interpreter
0x00000003 Write every VOID RESERVED
0x00000004 Write every UINT8[...] Load NC program by
name. The standard NC
path does not have to be
given although it may.
Other paths are also
permitted.
0x00000005 Write every UINT16 ENUM cf. appendix Set the interpreter/
interpreter channel operation mode
operation
mode [} 155]
0x00000006 Write Interpreter UINT8[...] Set path for subroutines
0x00000008 Write Interpreter UINT32 1 Interpreter simulation Not yet
mode: released
0: off (default)
1: on
0x0000000F Write every VOID RESERVED

0x00000010 Write every VOID "Reset" Channel


0x00000011 Write every VOID "Stop" Channel
0x00000012 Write every VOID "Retry" Channel (restart
Channel )
0x00000013 Write every VOID "Skip" Channel (skip task/
block)
0x00000014/0 Write every { "Enable Reserved
x00000015 Retrace" /"Disable function,
Retrace" no standard!
UINT32 1 >0 Feeder directiion:
1: forward
2: backward
UINT32 1 ≥0 Entry index
REAL64[3] mm ±∞ Pos. of the main axes X,
Y, Z
REAL64[5] mm ±∞ Pos. of the auxiliary axes
Q1, ..., Q5
}

0x00000020 Write every VOID "Save" zero offset shift


(NPV)
0x00000021 Write every VOID "Load" zero offset shift
(NPV)
0x00000022 Write every VOID "Save" tool
compensations
0x00000023 Write every VOID "Load" tool
compensations
0x00000024 Write Interpolation { Saves snapshot of the
interpreter in a given file
char[32] Filename in
TwinCAT\CNC-folder
UINT32 1 0..1 Mask:
0x1: R-Parameters
0x2: Zeroshifts
0x4: Tool Desc
}

44 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000025 Write Interpolation { Reads snapshot of a
given file to the
interpreter
char[32] Filename in
TwinCAT\CNC-folder
UINT32 1 0..1 Mask:
0x1: R-Parameters
0x2: Zeroshifts
0x4: Tool Desc
}
0x00000026 Write Interpolation VOID Set all tool parameters
(incl. type & number) to
null
0x00000027 Write Interpolation VOID Set all zero offset shifts to
null

0x00000030 Write every VOID Restart (Go Ahead) of the


Interpreter after
programmed Interpreter
stop
0x00000040 Write every VOID Triggerevent for deletion
of any remaining travel in
the NCI
0x00000041 Write every RESERVED for fair
events

0x00000050 Write Interpolation VOID 1 Set ExecIdleInfoin the Reserved


interpreter function,
no standard!
0x00000051 Write Interpolation UINT32 1 Set block skip mask in Reserved
the interpreter parameter: function,
SkippingMask no standard!
0x00000052 Write Intepolation UINT32 1 Set ItpOperationMode in Reserved
the interpreter parameter: function,
OperationMode mask no standard!
0x00000053 Write Interpolation VOID Set ScanningFlag in the Reserved
NC device function,
no standard!
0x00000054 Write Interpolation Scan position Reserved
double[8] position function,
no standard!
0x00000055 Write Interpolation Reserved
0x00000056 Write Interpolation VOID Set Interpreter in the Reserved
Aborted state function,
no standard!
0x00000060 Write Interppolation UINT16 1 0..159 Manual reset of a fast M
Function

TwinCAT 3 Version: 1.1.0 45


Target systems

3.1.1.5.4.2.4 "Index offset" specification for cyclic channel process data (Index
group 0x2300 + ID)
Index offset Access Channel type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000000 Read every {128 Byte} STRUCT s. CHANNEL STRUCTURE Current PLC
(PLC→NC) Channel (PLC→NC) structure:
interface
Remark: Size and NciChannelFro
alignment changed. mPlc
PLCTONC_NCI
CHANNEL_RE
F
0x00000001 Read every UINT8[...] 1 Interpreter program Cannot be
min. 30 Byte display traced by
oscilloscope!
0x00000002 Read/Write every UINT32 % [0...1000000] Speed override channel 1000000 =
(PLC→NC) (Axis in the Channel ) 100%
0x00000003 Read/Write every UINT32 % [0...1000000] Speed override spindle 1000000 =
(PLC→NC) 100%

0x00000080 Read every {160 Byte} STRUCT s. CHANNEL STRUCTURE Current PLC
(NC→PLC) Channel (NC→PLC) structure:
interface
Remark: Size and NciChannelToP
alignment changed. lc
NCTOPLC_NCI
CHANNEL_RE
F

0x10000000 Read/Write every REAL64 1 [0...999] R parameter of the Cannot be


+RegIndex Interpreter traced by
oscilloscope!

0x20000001 Read every UINT8[...] 1 [1...9] Program display of group Cannot be


min. 30 Byte attention handling (SAF) traced by
oscilloscope!

46 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.3 Specification Groups

3.1.1.5.4.3.1 "Index offset" specification for group parameter (Index group


0x3000 + ID)

TwinCAT 3 Version: 1.1.0 47


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Read every UINT32 1 Group ID
0x00000002 Read every UINT8[30+1] 1 Group name
0x00000003 Read every UINT32 1 ENUM Group type [} 155]
0x00000004 Read every UINT32 µs SAF cycle time group
0x00000005 Read every UINT32 µs SVB cycle time group
0x00000006 Read/Write every UINT16 1 0/1 Single block operation
mode?
0x0000000B Read every UINT32 1 Size of the SVB table
(max. number of SVB
entries
0x0000000C Read every UINT32 1 Size of the SAF table
(max. number of SAF
entries

0x00000010 Read/Write every UINT32 1 [1,2...32] Internal SAF cycle e.g. for DXD
time divisor (divides group
Default: 1
the internal SAF cycle
time by this factor)

0x00000021 Read Channel: every UINT32 1 Channel ID


0x00000022 Read Channel: every UINT8[30+1] 1 Channel name
0x00000023 Read Channel: every UINT32 1 ENUM Channel type [} 154]
0x00000024 Read Channel: every UINT32 1 >0 Number in the
Channel

0x00000500 Read/Write DXD group INT32 ENUM [0, 1] Cornering velocity


reduction method
[} 155]
0: Coulomb-Scattering
1: Cosinus law
2: VeloJump
0x00000501 Read/Write DXD group REAL64 1 [0.0...1.0] Velocity reduction
factor C0 transition
(continuous, but
neither once nor twice
continuously
differentiable)
0x00000502 Read/Write DXD group REAL64 1 [0.0...1.0] Velocity reduction
factor C1 transition
(continuous and
continuously
differentiable once)
0x00000503 Read/Write DXD group REAL64 degree [0.0...180.0] Critical angle at
segment transition
"Low" (must be strictly
less than or equal to
the velocity reduction
angle C0)
0x00000504 Read/Write DXD group REAL64 degree [0.0...180.0] Critical angle at
segment transition
"High" (must be strictly
less than or equal to
the velocity reduction
angle C0)
0x00000505 Read/Write DXD group REAL64 mm/s ≥0 Minimum velocity, Attention:
which must not be Parameter is
undershot at segment not saved in the
transitions, despite solution and is
possible velocity not transferred
reduction. as NC boot
parameter!
0x00000506 Read/Write DXD group REAL64 e.g. mm [0.0...1000.0] Radius of the Not
tolerance sphere for implemented!
blending
0x00000507 Read/Write DXD group REAL64 1 Velocity reduction
factor C2 transition

48 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000508 Read/Write DXD group UINT16 1 0/1 Enables calculation of NEW from
the total remaining TC3.1
path length B4020.40
0x00000509 Read/Write DXD group UINT16 1 0/1 General activation of
the software limit
Default: 1
position monitoring for
the main axes (X, Y,
Z)
(see encoder
parameters)
0x0000050A Read/Write DXD group UINT32 1 0/1 NCI Overridetype
0: related to internal
reduced velocity
(without iteration)
1: related to original
external
(programmed) velocity
2: Relative to the
internally reduced
velocity (0 ... >100%)
0x0000050C Read DXD group UINT32 1 [128 ... 1024] User-defined NEW from
maximum number of TC3.1 B4014
Default: 128
the NCI SAF tables boot
entries parameters

0x00000510 Read/Write DXD group REAL64 1 ≥0 For reduction method Not


VeloJump implemented!
Reductionfactor for C0
transitions: X axis
0x00000511 Read/Write DXD group REAL64 1 ≥0 For reduction method Not
VeloJump implemented!
Reductionfactor for C0
transitions: Y axis
0x00000512 Read/Write DXD group REAL64 1 ≥0 For reduction method Not
VeloJump implemented!
Reductionfactor for C0
transitions: Z axis
0x00000513 Read/Write DXD group LREAL64 1 ]0.0..1.0[ Blending for auxiliary Not yet
axes: If the effective released
path velo is smaller
than the programmed
one multiplied with this
factor, then an
accurate stop is
inserted and the
tolerance ball is
deleted
0x00000514 Read/Write DXD group UINT32 1 [1 … 20] Maximum number of NEW from
transferred jobs per TC3.1
Default: 1
NC cycle (from SVB to B4020.40
SAF)

0x00000604 Read/Write Encoder group REAL64 e.g. mm/ [0.0...1000.0] Velocity window resp. Base Unit / s
s standstill window
0x00000605 Read/Write Encoder group REAL64 s [0.0...60.0] Filter time for standstill
window in seconds
0x00000606 Read/Write Encoder group REAL64 s [0.0...60.0] Dead time
compensation master/
slave coupling ("angle
pre-control")

0x00000701 Read FIFO group UINT32 1 [1...16] FIFO dimension (m = (n x m) FIFO


number of axes) boot data
Note: The FIFO
dimension was
increased to 16.

TwinCAT 3 Version: 1.1.0 49


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000702 Read FIFO group UINT32 1 [1...10000] FIFO size (length) (n = (n x m) FIFO
number of FIFO boot data
entries)
0x00000703 Read FIFO group UINT32 1 [0, 1, 4] Interpolation type for NEW from
FIFO setpoint TC3.1 B4020
generator
0:
INTERPOLATIONTYP
E_LINEAR (default)
1:
INTERPOLATIONTYP
E_4POINT
4:
INTERPOLATIONTYP
E_CUBICSPLINE
(with 6 points)
0x00000704 Read/Write FIFO group UINT32 1 [1, 2] Override type for FIFO
setpoint generator
Type 1:
OVERRIDETYPE_INS
TANTANEOUS
(default)
Type 2:
OVERRIDETYPE_PT
2
0x00000705 Read/Write FIFO group REAL64 s > 0.0 P-T2 time for override
change (T1=T2=T0)
0x00000706 Read/Write FIFO group REAL64 s ≥ 0.0 Time delta for two
sequenced FIFO
entries (FIFO entry
timebase)

0x00000801 ReadWrite Kinematic Write Calculation of the


group kinematic forward
transformation for the
positions (ACS ->
MCS)
{
REAL64[8] e.g. ±∞ ACS (Axis Coordinate
degree System) axis
positions, max.
dimension: 8
UINT32 1 ≥0 Reserve
UINT32 1 ≥0 Reserve
}
Read
{
REAL64[8] e.g. mm ±∞ MCS (Machine
Coordinate System)
axis positions, max.
dimension: 8
UINT32 1 ≥0 Reserve
UINT32 1 ≥0 Reserve
}

50 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000802 ReadWrite Kinematic Write Calculation of the
group kinematic inverse
transformation for the
positions (MCS ->
ACS)
{
REAL64[8] e.g. mm ±∞ MCS (Machine
Coordinate System)
axis positions, max.
dimension: 8
UINT32 1 ≥0 Reserve
UINT32 1 ≥0 Reserve
}
Read
{
REAL64[8] e.g. ±∞ ACS (Axis Coordinate
degree System) axis
positions, max.
dimension: 8
UINT32 1 ≥0 Reserve
UINT32 1 ≥0 Reserve
}

TwinCAT 3 Version: 1.1.0 51


Target systems

3.1.1.5.4.3.2 "Index offset" specification for group state (Index group 0x3100 +
ID)

52 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000001 Read every INT32 1 ENUM Error code group
0x00000002 Read every UINT32 1 Number of master
axes
0x00000003 Read every UINT32 1 Number of slave axes
0x00000004 Read every UINT32 1 s. ENUM SVB group state
(state)
0x00000005 Read every UINT32 1 s. ENUM SAF group state (main
state)
0x00000006 Read every UINT32 1 s. ENUM Moving state (state)
0x00000007 Read every UINT32 1 s. ENUM SAF sub-group state
(sub state)
0x00000008 Read every UINT32 1 s. ENUM Referencing state
(state)
0x00000009 Read every UINT32 1 s. ENUM Coupling state (state) Cannot be
traced by
oscilloscope!
0x0000000A Read every UINT32 1 ≥0 Coupling table index Cannot be
traced by
oscilloscope!
0x0000000B Read every UINT32 1 ≥0 current number of Symbolic
SVB entries/tasks access:
'SvbEntries'
(DXD)
0x0000000C Read every UINT32 1 ≥0 Current number of Symbolic
SAF entries/tasks access:
'SafEntries'
(DXD)
0x0000000D Read every UINT32 1 Current block number Symbolic
(only active for access:
interpolation group) 'BlockNumber'
(DXD)
0x0000000E Read every UINT32 1 ≥0 current number of free Cannot be
SVB entries/tasks traced by
oscilloscope!
0x0000000F Read every UINT32 1 ≥0 Current number of free Cannot be
SAF entries/tasks traced by
oscilloscope!
0x00000011 Read every UINT16 1 0/1 Emergency Stop (E- Cannot be
Stop) active? traced by
oscilloscope!

TwinCAT 3 Version: 1.1.0 53


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000110 Read PTP group { Internal NC Reserved!
information
(resolutions)
REAL64 e.g. mm ± ∞ ExternalEndPosition
REAL64 e.g. mm/ >0 ExternalTargetVelocity
s
REAL64 e.g. mm/ >0 ExternalAcceleration
s^2
REAL64 e.g. mm/ >0 ExternalDeceleration
s^2
REAL64 e.g. mm/ >0 ExternalJerk
s^3
UINT32 1 >0 ExternalOverrideType
REAL64 e.g. mm ± ∞ InternalEndPosition
REAL64 e.g. mm/ >0 InternalTargetVelocity
s (refers to 100 %)
REAL64 % [0 ... 100] InternalActualOverride
REAL64 e.g. mm/ >0 InternalAcceleration
s^2
REAL64 e.g. mm/ >0 InternalDeceleration
s^2
REAL64 e.g. mm/ >0 InternalJerk
s^3
REAL64 e.g. mm >0 PositionResolution
REAL64 e.g. mm/ ≥0 VelocityResolution
s
REAL64 e.g. mm/ ≥0 AccelerationResolutio
s^2 n
REAL64 e.g. mm/ ≥0 VelocityResolutionAtA
s ccelerationZero
}

0x00000500 Read DXD group REAL64 e.g. mm ≥ 0 Path rest way Symbolic
(remaining arc length) access:
on the current path 'SetPathRemLe
segment ngth'
0x00000501 Read DXD group REAL64 e.g. mm ≥ 0 Racked out arc length Symbolic
on the current path access:
segment 'SetPathLength'
0x00000502 Read DXD group REAL64 e.g. mm/ ≥ 0 Current path set Symbolic
s velocity access:
'SetPathVelo'
0x00000503 Read DXD group REAL64 e.g. mm/ ± ∞ Current path set Symbolic
s^2 acceleration access:
'SetPathAcc'
0x00000504 Read DXD group REAL64 e.g. mm/ ≥ 0 Amount of the current Symbolic
s^2 vectorial set access:
acceleration 'SetPathAbsAcc
'
0x00000505 Read DXD group REAL64 e.g. mm/ ≥ 0 Maximum segment Symbolic
s end path set velocity access:
'SetPathVeloEn
d'
0x00000506 Read DXD group REAL64 e.g. mm/ ≥ 0 Segment maximum Symbolic
s path set velocity access:
'SetPathVeloMa
x'
0x00000507 Read DXD group REAL64 e.g. mm ≥ 0 Current relative Symbolic
braking distance access:
based on the current 'SetPathStopDi
arc length st'
0x00000508 Read DXD group REAL64 e.g. mm ± ∞ Safety distance = Symbolic
segment arc length - access:
current arc length - 'SetPathSecurit
relative braking yDist'
distance

54 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000509 Read DXD group REAL64 1 0/1 Segment transition Symbolic
access:
'SetPathSegme
ntChange'
0x0000050A Read DXD group REAL64 % [0 ... 100] Path velocity override Symbolic
access:
'SetPathOverrid
e'

0x00000511 Read DXD group REAL64 e.g. mm/ ≥ 0 Component of the Symbolic
s actual path velocity access:
'ActPathAbsVel
o'
0x00000512 Read DXD group REAL64 e.g. mm/ ± ∞ Actual path Symbolic
s^2 acceleration on the access:
current segment 'ActPathAcc'
0x00000513 Read DXD group REAL64 e.g. mm/ ≥ 0 Component of the Symbolic
s^2 actual path access:
acceleration on the 'ActPathAbsAcc
current segment '
0x00000514 Read DXD group REAL64 e.g. mm ± ∞ Position error on the Symbolic
path in tangential access:
direction (signed to 'PathDiffTangen
indicate leading and tial'
lagging)
0x00000515 Read DXD group REAL64 e.g. mm ≥ 0 Position error on the Symbolic
path in orthogonal access:'PathDiff
direction Orthogonal'
0x00000520 Read DXD group REAL64 1 ≥0 Covered arc length of
the current segment,
normalized to 1.0
0x00000521 Read DXD group REAL64 1 0/1 Change of partial
segment (radius of
tolerance ball)
0x00000522 Read DXD group REAL64 1 ≥0 Total remaining path
length to the last
geometry entry or the
next accurate stop.
Refers to group
parameter 0x508.
0x00000523 Read DXD group REAL64 1 ≥0 Programmed velocity
of the current segment
0x00000524 Read DXD group REAL64 e.g. mm ≥ 0 Path distance (arc from TC 3.1
length) travelled since B4022.31
the program start from TC 3.1
B4024.0
0x00000530 Read DXD group { Current or last MCS-
target position of the
main axes X, Y and Z
REAL64 e.g. mm ± ∞ Target position X-axis
REAL64 e.g. mm ± ∞ Target position Y-axis
REAL64 e.g. mm ± ∞ Target position Z-axis
}
0x00000531 Read DXD group { Current or last MCS-
target position of the
auxiliary axes Q1 to
Q5
REAL64[5] e.g. mm ± ∞ Target position of axis
Q1 to Q5
}

TwinCAT 3 Version: 1.1.0 55


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000532 Read DXD group { Reads path length, H not generally
parameter and Entry released
ID of the next 11
segments in relation to
the current DC time
UINT32 DC Time
UINT32 Reserved
PreViewTab[11] 11*24 Bytes
}

PreViewTab
{
REAL64 e.g. mm Segment length
UINT32 1 block number
UINT32 1 H-Parmeter
UINT32 1 Entry ID
UINT32 1 Reserved
}
0x0000054n Read DXD group REAL64 1 0/1 Within the tolerance
ball of the auxiliary
axis
n = 1..5
Number of the
auxiliary axis (not axis
ID)
0x00000546 Read DXD group REAL64[8] e.g. mm ± ∞ Set position array of from TC3.1
the (3+5) axes of the B4022.17
3D group
0x00000547 Read DXD group REAL64[8] e.g. mm ± ∞ Actual position array from TC3.1
of the (3+5) axes of B4022.17
the 3D group
0x00000548 Read DXD group REAL64[8] e.g. mm ± ∞ Position difference from TC3.1
(set/actual) or lag error B4022.17
as array of the (3+5)
axes of the 3D group

0x00000550 Read DXD group { Reads the axis IDs


within a 3D group:
UINT32 1 [0, 1...255] X axis ID
UINT32 1 [0, 1...255] Y axis ID
UINT32 1 [0, 1...255] Z axis ID
}
0x00000552 Read DXD group { UINT32[m] 1 [0, 1...255] Axis allocation of the
FIFO group } group:
Kinematic
1st axis ID – mth axis
group
ID
m: Dimension of the
3D group with main
and auxiliary axes (X,
Y, Z, Q1, Q2, Q3, Q4,
Q5) or the FIFO group
or the ACS axes of the
kinematic group
0x00000553 Read Kinematic { Reading the axis
group allocation (ID's) inside
the kinematic group:
UINT32[8] 1 [0, 1...255] MCS axis IDs
(machine coordinate
system)
UINT32[8] 1 [0, 1...255] ACS axis IDs (axis
coordinate system)
UINT32 1 ≥0 Reserve
UINT32 1 ≥0 Reserve (NEW)
}

56 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x0000056n Read DXD group REAL64 1 ±∞ Current position error
of the auxiliary axis
within the tolerance
ball (set value side
only)
Only for auxiliary axes
n = 1..5
Number of the
auxiliary axis (not axis
ID)

TwinCAT 3 Version: 1.1.0 57


Target systems

3.1.1.5.4.3.3 "Index offset" specification for group functions (Index group


0x3200 + ID)

58 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Write every VOID Reset group
0x00000002 Write every VOID Stop group
0x00000003 Write every VOID Clear group (buffer/
task)
0x00000004 Write PTP group, 3D { Emergency stop (E-
group stop) (emergency stop
with controlled ramp)
REAL64 e.g. mm/ ≥ 0.0 Deceleration (must be
s^2 greater than or equal
to the original
deceleration)
REAL64 e.g. mm/ ≥ 0.0 Jerk (must greater
s^3 than or equal to the
original jerk)
}
0x00000005 Write PTP group { Parameterizable stop Reserved
(with controlled ramp) function,
REAL64 e.g. mm/ ≥ 0.0 Deceleration no standard!
s^2
REAL64 e.g. mm/ ≥ 0.0 Jerk
s^3
}
0x00000006 Write PTP group, 3D VOID "Step on" after
group Emergency Stop (E-
Stop)

0x00000050 Write PTP group, 3D { Axis allocation of the


group group:
UINT32 1 [0, 1...255] X axis ID
UINT32 1 [0, 1...255] Y axis ID
UINT32 1 [0, 1...255] Z axis ID
}
0x00000051 Write PTP group, 3D { axis allocation of the
group group:
FIFO group UINT32 1 [1...255] Axis ID
UINT32 1 [0 ... (m-1)] Place index of the axis
in the group m: group
dimension (PTP:
1;DXD: 3, FIFO: 16)
}
0x00000052 Write 3D group FIFO { UINT32[m] 1 [0, 1...255] Axis allocation of the
group } group:
First axis ID, ... , m.
axis ID
m: dimension of the
3D group (X, Y, Z, Q1,
Q2, Q3, Q4, Q5) resp.
FIFO group
0x00000053 Write 3D group VOID Delete the 3D axis
FIFO group allocation, FIFO axis
Kinematic allocation or Kinematic
group axis allocation and
return of the axes to
their own PTP groups
0x00000054 Write Kinematic { Axis allocation of the
group kinematic group:
UINT32[8] 1 [0, 1...255] MCS axis IDs
(Machine Coordinate
System)
UINT32[8] 1 [0, 1...255] ACS axis IDs (Axis
Coordinate System)
UINT32 1 ≥0 Reserved
UINT32 1 ≥0 Reserved (NEW)
}

TwinCAT 3 Version: 1.1.0 59


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000060 ReadWrite 3D group 1 Internal "feed group" Execute
command ("Feeder") command!
0x00000061 ReadWrite 3D group 1 Internal "feed group" Execute
command ("Feeder") command!

0x00000110 Write 1D group VOID Reference 1D group


("calibration")
0x00000111 Write 1D group { New end position 1D
group
UINT32 ENUM s. appendix End position type
[} 157] (s. appendix)
REAL64 e.g. mm ±∞ New end position
(target position)
}
0x0000011A Write 1D group { Set actual position 1D Caution by
group using! Always
UINT32 ENUM s. appendix to SAF Port
Actual position type
501!
[} 157] (s. appendix)
REAL64 e.g. mm ±∞ Actual position for axis
}
0x0000011B Write 1D group UINT32 1 0/1 Set reference flag Caution by
("calibrate flag") using!

0x00000120 Write 1D group { Start 1D group


(standard start):
UINT32 ENUM s. appendix Start type [} 156] (s.
appendix)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 mm/s ≥ 0.0 Required velocity
}
0x00000121 Write 1D group { Start 1D group
(SERVO) (extended start):
UINT32 ENUM s. appendix Start type [} 156] (s.
appendix)
REAL64 e.g.mm ±∞ End position (target
position)
REAL64 mm/s ≥0.0 Required velocity
UINT32 1 0/1 Standard
acceleration?
REAL64 mm/s^2 ≥ 0.0 Acceleration
UINT32 1 0/1 Standard
deceleration?
REAL64 mm/s^2 ≥ 0.0 Deceleration
UINT32 1 0/1 Standard jerk?
REAL64 mm/s^3 ≥ 0.0 Jerk
}

60 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000122 Write 1D group (MW { Start 1D group Reserved start
servo) (special start): function, no
UINT32 ENUM s. appendix standard!
Start type [} 156] (s.
appendix)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 mm/s ≥0.0 required start velocity
REAL64 e.g. mm ±∞ Position for a new
velocity level
REAL64 mm/s ≥0.0 new end velocity level
UINT32 1 0/1 Standard
acceleration?
REAL64 mm/s^2 ≥0.0 Acceleration
UINT32 1 0/1 Standard
deceleration?
REAL64 mm/s^2 ≥0.0 deceleration
UINT32 1 0/1 Standard jerk?
REAL64 mm/s^3 ≥0.0 Jerk
}
0x00000126 Write 1D group { Start drive output:
UINT32 ENUM s. appendix Output type [} 164] (s.
appendix)
REAL64 e.g. % ±∞ Required output value
(e.g. %)
}
0x00000127 Write 1D group VOID Stop drive output
0x00000128 Write 1D group { Change the drive
output:
UINT32 ENUM s. appendix Output type [} 164] (s.
appendix)
REAL64 e.g. % ±∞ Required output value
(e.g. %)
}

0x00000130 Write 1D group { 1D section


(SERVO) compensation
(SERVO):
UINT32 ENUM s. appendix Compensation type
[} 157] (s. appendix)
REAL64 mm/s/s ≥ 0.0 Max. acceleration
increase
REAL64 mm/s/s ≥ 0.0 Max. deceleration
increase
REAL64 mm/s ≥ 0.0 Max. increase velocity
REAL64 mm/s ≥ 0.0 Base velocity for the
process
REAL64 e.g. mm ±∞ Path difference to be
compensated
REAL64 e.g. mm ≥ 0.0 Path distance for
compensation
}
0x00000131 Write 1D group VOID Stop section
SERVO compensation
(SERVO)

TwinCAT 3 Version: 1.1.0 61


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000140 Write Master/Slave { Master/slave coupling Extension for
(0x00n00140) coupling: 1D (SERVO): "flying saw"!
group(SERVO) UINT32 ENUM s. appendix angle >0.0 and
Slave type/coupling
<= 90.0
type [} 158] (s. degrees(paralle
appendix) l saw: 90.0
UINT32 1 [1...255] Axis ID of the master degrees)
axis/group
UINT32 1 [0...8] Subindex n of the
master axis (default
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default
value: 0)
REAL64 1 [±1000000.0] Parameter 1: linear:
Gearing factor
FlySawVelo: Reserve
FlySaw: Abs.
synchronous position
master [mm]
REAL64 1 [±1000000.0] Parameter 2: linear:
Reserve
FlySawVelo: Reserve
FlySawPos: Abs.
synchronous position
slave [mm]
REAL64 1 [±1000000.0] Parameter 3: linear:
Reserve
FlySawVelo: Angle of
inclination in
[DEGREE]
FlySawPos: angle of
inclination in
[DEGREE]
REAL64 1 [±1000000.0] Parameter 4: linear:
Reserve
FlySawVelo: Gearing
factor
FlySawPos: Gearing
factor
}
0x00000141 Write Master/Slave VOID Master/slave
decoupling: 1D decoupling (SERVO)
group(SERVO)
0x00000142 Write Master / slave { Change of the
parameter 1D coupling parameters
group(servo) (SERVO):
REAL64 1 [±1000000.0] Parameter 1: linear:
Gearing factor
REAL64 1 [±1000000.0] Parameter 2: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 3: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 4: Linear:
Reserve
}
0x00000144 Write Slave stop 1D VOID Stop the "flying saw" Only for "flying
group (SERVO) (SERVO) saw"
0x00000149 Write Slave tables 1D REAL64 1 ±∞ set the slave table Only for Solo
group (SERVO) scaling of a solo table table slave
coupling (SERVO)

0x00000150 Write 1D group VOID Deactivate complete


1D group/axis
(disable)

62 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000151 Write 1D group VOID Activate complete 1D
group / axis (enable)

0x00000160 Write 1D group VOID Deactivate drive


output of the 1D group
(disable)
0x00000161 Write 1D group VOID Activate drive output
of the 1D group
(enable)

0x00000362 Write High/low speed UINT16 1 0/1 Release parking


group brake?
0: automatic activation
(default)
1: mandatorily always
released!

0x00000701 Write FIFO group VOID Start FIFO group (n*m)-FIFO


(FIFO table must have
been filled in advance)

0x00000710 Write FIFO group { REAL64[x*m]} e.g. mm ±∞ Write x FIFO entries Only possible
(lines): on a line-by-line
basis! (integer
(x*m)-values (one or
multiple)
more lines)
n: FIFO length
(number of lines)
m: FIFO dimension
(number of columns)
range of values x: [1 ...
n]
0x00000711 Write FIFO group { REAL64[x*m]} e.g. mm ±∞ Overwrite the last x Only possible
FIFO entries (lines): on a line-by-line
basis! (integer
(x*m)-values (one or
multiple)
more lines)
n: FIFO length
(number of lines)
m: FIFO dimension
(number of columns)
range of values x: [1 ...
n]

0x00000801 Write Kinematic VOID Start kinematic group Reserved


group function, no
standard!

TwinCAT 3 Version: 1.1.0 63


Target systems

3.1.1.5.4.4 Specification Axes

3.1.1.5.4.4.1 "Index offset" specification for axis parameter (Index group 0x4000
+ ID)

64 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n00000 Read every { General AXIS Modified from
(Structure for all PARAMETER TC3
axis STRUCTURE (NC/
parameters) CNC),
also contains the sub-
elements such as
encoder, controller
and drive
(s.
MC_ReadParameterS
et in TcMc2.lib)
Note: Size and
alignment changed.
UINT32 1 Axis ID
STRING[30+1] 1 Axis name
UINT32 1 ENUM Axis type [} 155]
... ... ... ...
} 1024 bytes (instead of
512 bytes)
0x00000001 Read every UINT32 1 Axis ID
0x00000002 Read every STRING[30+1] 1 Axis name Any number of
characters from
UINT8[. . .] TC3.1 Build
4022.32 or
4024.6
0x00000003 Read every UINT32 1 ENUM Axis type [} 155]
0x00000004 Read every UINT32 µs Cycle time axis (SEC)
0x00000005 Read every STRING[10+1] 1 Physical unit
0x00000006 Read/Write every REAL64 e.g. mm/ Ref. velocity in cam
s direction
0x00000007 Read/Write every REAL64 e.g. mm/ Ref. velocity in sync
s direction
0x00000008 Read/Write every REAL64 e.g. mm/ Velocity hand slow
s
0x00000009 Read/Write every REAL64 e.g. mm/ Velocity hand fast
s
0x0000000A Read/Write every REAL64 e.g. mm/ [0.0...1.0E20] Velocity rapid traverse
s
0x0000000F Read/Write every UINT16 1 0/1 Position range
monitoring?
0x00000010 Read/Write every REAL64 e.g. mm [0.0...1.0E6] Position range window
0x00000011 Read/Write every UINT16 1 0/1 Motion monitoring?
0x00000012 Read/Write every REAL64 s [0.0...600] Motion monitoring time
0x00000013 Read/Write every UINT16 1 0/1 Loop?
0x00000014 Read/Write every REAL64 e.g. mm Looping distance (±)
0x00000015 Read/Write every UINT16 1 0/1 Target position
monitoring?
0x00000016 Read/Write every REAL64 e.g. mm [0.0...1.0E6] Target position
window
0x00000017 Read/Write every REAL64 s [0.0...600] Target position
monitoring time
0x00000018 Read/Write every REAL64 e.g. mm Pulse way in pos.
direction
0x00000019 Read/Write every REAL64 e.g. mm Pulse way in neg.
direction
0x0000001A Read/Write every UINT32 1 ENUM (≥0) Error reaction mode:
0: instantaneous
(default)
1: delayed
(e.g. for Master/Slave-
coupling)
0x0000001B Read/Write every REAL64 s [0...1000] Error delay time
(if delayed error
reaction is selected)

TwinCAT 3 Version: 1.1.0 65


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x0000001C Read/Write every UINT16 1 0/1 Couple slaves via
actual values if not
ready to operate?
0x0000001D Read/Write every REAL64 e.g. mm/ [0, Acceleration for fading
s^2 0.01...1.0E10] profile when switching
from set to actual
values:
Default: 0 (in this case
the minimum from the
axis acceleration is
used, i.e. MIN(Acc,
Dec))
0x0000001E Read/Write every UINT32 1 ENUM (≥0) Fast Axis Stop Signal
Type:
Selection of the signal
type that triggers a fast
axis stop (see bit 7 in
Drive->nStatus4)
"0 (SignalType_OFF)",
"1
(SignalType_RisingEd
ge)","2
(SignalType_FallingEd
ge)","3
(SignalType_BothEdg
es)","4
(SignalType_HighActiv
e)","5
(SignalType_LowActiv
e)"
0x00000020 Read/Write every UINT16 1 0/1 Allow motion
commands for slave
axis?
Default: FALSE
0x00000021 Read/Write every UINT16 1 0/1 Allow motion
commands for axes
with active external
setpoint generator?
Default: FALSE

0x00000026 Read/Write every UINT32 1 Interpretation of the See encoder!


units (position, Bit array
velocity, time)
Bit 0: Velocity in x/min
instead of x/s
Bit 1: Position in
thousandths of the
base unit
Bit 2: Modulo position
display
0x00000027 Read/Write every REAL64 e.g. mm/ [>0...1.0E20] Max. allowed velocity
s
0x00000028 Read/Write every REAL64 e.g. mm [0.0...1.0E6] Motion monitoring
window
0x00000029 Read/Write every UINT16 1 0/1 PEH time monitoring? Position end
and accurate
stop
0x0000002A Read/Write every REAL64 s [0.0...600] PEH monitoring time
0x0000002C Read/Write every REAL64 e.g. mm [-1000.0 Backlash
...1000.0]

0x00000030 Read every UINT16 1 [0,1] Persistent data e.g. for Boot
actual position and parameters,
reference state of the cannot be
encoder? changed online.

66 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00000031 Read every { AmsAdd 1 Read the hardware
UINT8[6] r: AMS address
UINT16 AmsNetI (AMS Net ID and AMS
UINT16 d, Port No) and the
} 10 bytes AmsPort EtherCAT channel
No. number
Channel (communication
No channel 0,1,2,3…)
0x00000031 Read every { AmsAdd 1 Read the hardware NEW from TC3
UINT8[6] r: AMS address
DriveObjectId
UINT16 AmsNetI (AMS Net ID and
and
UINT16 d, devices AMS Port No)
EncObjectId
// AmsPort and the EtherCAT
from NC build
UINT16 No. channel number
4437
UINT32 Channel (communication
UINT32 No channel 0,1,2,3…)
UINT32 Reservie
Supplemented by
UINT32 rt
additional NC
UINT32 NcDriveI
information such as
UINT32 D
NcDriveID,
UINT32 NcDriveI
NcDriveType (see
UINT32 ndex
appendix) etc..
UINT32 NcDrive
UINT32 Type
UINT32[3] NcEncID
} 64 bytes NcEncIn
dex
NcEncT
ype
NcAxisI
D
NcAxisT
ype
TcDrive
ObjectId
TcEncO
bjectId
reserved
0x00000033 Read every { General Changed in
UINT16 0/1 APPLICATION TC3
ApplRequestBit ≥0 REQUEST
UINT16 1 >0 STRUCTURE (NC/
ApplRequestTy ≥0 NCI),
pe e.g. for
UINT32 1 ApplicationHoming
ApplCmdNo request
UINT32 Not (see
ApplCmdVersio impleme MC_ReadApplicationR
n nted equest in TcMc2.lib)
...
Application request
} 1024 bytes 1
types:
0: NONE (IDLE)
1: HOMING

0x00000051 Read Channel: every UINT32 Channel ID


0x00000052 Read Channel: every STRING[30+1] Channel name
0x00000053 Read Channel: every UINT32 1 ENUM Channel type [} 154]
0x00000054 Read Group: every UINT32 Group ID
0x00000055 Read Group: every STRING[30+1] Group name
0x00000056 Read Group: every UINT32 1 ENUM Group type [} 155]
0x00000057 Read every UINT32 Number of encoders
0x00000058 Read every UINT32 Number of controllers
0x00000059 Read every UINT32 Number of drives
0x0000005A Read every { Read all sub-elements
of an axis:
UINT32[ 9 ] 1 [0, 1...255] Axis encoder IDs
UINT32[ 9 ] 1 [0, 1...255] Axis controller IDs
UINT32[ 9 ] 1 [0, 1...255] Axis drive IDs
} 108 bytes

TwinCAT 3 Version: 1.1.0 67


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range

0x000000F1 Read/Write every REAL64 e.g. mm/ Default: 1.0E5 Maximum permitted NEW from TC
s^2 acceleration 3.2
0x000000F2 Read/Write every REAL64 e.g. mm/ Default: 1.0E6 Maximum permitted NEW from TC
s^2 deceleration 3.2

0x00000101 Read/Write Servo REAL64 e.g. mm/ [0.01...1.0E20] Acceleration (default


s^2 data set)
0x00000102 Read/Write Servo REAL64 e.g. mm/ [0.01...1.0E20] Deceleration (default
s^2 data set)
0x00000103 Read/Write Servo REAL64 e.g. mm/ [0.1...1.0E30] Jerk (default data set)
s^3
0x00000104 Read/Write Servo REAL64 s [0.0 ... 1.0] Deceleration time
Default: 0.0 s between velocity and
position values of the
setpoint generator in
seconds
0x00000105 Read/Write Servo UINT32 1 ENUM Override type [} 156]
Default: type 1 for velocity:
1: Related to internal
reduced velocity
(without iteration)
2: Related to original
external start velocity
(without iteration)
3: Related to internal
reduced velocity
(optimization by
means of iteration)
4: Related to original
external start velocity
(optimization by
means of iteration)
0x00000106 Read/Write Servo REAL64 1 [0.0 ... 1.0E6] Maximum permitted
Default: 0.0 step change in velocity
for dynamic reduction
DV = factor *min(A+,
A-) * DT
0x00000107 Read/Write Servo UINT16 1 [0.1] Activates acceleration
Default: 1 and jerk limitation for
the auxiliary axis (Q1
to Q5)
Read/Write Servo REAL64 e.g. mm [0.0..1000.0] Radius of the
tolerance sphere for
the auxiliary axes
Read/Write Servo REAL64 e.g. mm [0.0..10000.0] Maximum allowed
position deviation if the
tolerance sphere is
reduced
Only for auxiliary axes
0x0000010A Read/Write Servo REAL64 e.g. mm/ [0.01 ... 1.0E20] Fast Axis Stop:
s^2 Acceleration
(s.a. Fast Axis Stop
Signal Type)
0x0000010B Read/Write Servo REAL64 e.g. mm/ [0.01 ... 1.0E20] Fast Axis Stop:
s^2 Deceleration
(s.a. Fast Axis Stop
Signal Type)
0x0000010C Read/Write Servo REAL64 e.g. mm/ [0.1 ... 1.0E30] Fast Axis Stop: Jerk
s^3
(s.a. Fast Axis Stop
Signal Type)

68 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x0000010D Read/Write Servo UINT32 1 Index offset of the axis
state that is passed in
the cyclic interface as
"UserData".
0x00000000:
deactivated
0x00010012: Encoder
position with position
bias voltage (without
position correction and
without dead time
compensation)
0x00010014:
DriveActVelo
0x00010017:
MC_SetPosition
offsets

0x00000201 Read/Write Stepper motor UINT32 1 ENUM Operation mode


stepper motor
0x00000202 Read/Write Stepper motor REAL64 e.g. mm/ [1.0E-6 ... Distance scaling of a
STEP 1000.0] motor step
0x00000203 Read/Write Stepper motor REAL64 e.g. mm/ [0.0 ... 1000.0] Minimum velocity for
s velocity profile
0x00000204 Read/Write Stepper motor UINT32 1 [0 ... 100] Number of steps per
frequency/velocity step
0x00000205 Read/Write Stepper motor UINT32 1 Motor mask as sync Not
pulse implemented!

0x00000301 Read/Write high/low REAL64 e.g. mm [0.0 ... Creep distance in pos.
100000.0] direction
0x00000302 Read/Write high/low REAL64 e.g. mm [0.0 ... Creep distance in neg.
100000.0] direction
0x00000303 Read/Write high/low REAL64 e.g. mm [0.0 ... Braking distance in
100000.0] pos. direction
0x00000304 Read/Write high/low REAL64 e.g. mm [0.0 ... Braking distance in
100000.0] neg. direction
0x00000305 Read/Write high/low REAL64 s [0.0 ... 60.0] Braking deceleration in
pos. direction
0x00000306 Read/Write high/low REAL64 s [0.0 ... 60.0] Braking deceleration in
neg. direction
0x00000307 Read/Write high/low REAL64 s [0.0 ... 60.0] Switching time from
high to low velocity
0x00000308 Read/Write high/low REAL64 e.g. mm [0.0 ... Creep distance stop
100000.0]
0x00000309 Read/Write high/low REAL64 s [0.0 ... 60.0] Delay time to release
brake
0x0000030A Read/Write high/low REAL64 s [0.0 ... 60.0] Pulse time in pos.
direction
0x0000030B Read/Write high/low REAL64 s [0.0 ... 60.0] Pulse time in neg.
direction

ENCODER
0x00n10001 Read Encoder: every UINT32 1 [1 ... 255] Encoder ID n = 0:
standard encoder of
the axes > 0: nth
encoder of the axis
(optional)
0x00n10002 Read Encoder: every STRING[30+1] 1 30 characters Encoder name
0x00n10003 Read Encoder: every UINT32 1 ENUM (>0) Encoder type [} 160]
0x00n10004 Read/Write Encoder: every UINT32 1 Byteoffset Input address offset (I/ Change I/O
O-Input-Image) address
0x00n10005 Read/Write Encoder: every UINT32 1 Byteoffset Output address offset Change I/O
(I/O-Output-Image) address

TwinCAT 3 Version: 1.1.0 69


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n10006 Read/Write Encoder: every REAL64 e.g. mm/ [1.0E-12 ... Resulting scaling Writing is not
INC 1.0E+30] factor (numerator / allowed if the
denominator) controller
enable has
Note: from TC3 the
been issued.
scaling factor consists
of two components –
numerator and
denominator (default:
1.0).
0x00n10007 Read/Write Encoder: every REAL64 e.g. mm [±1.0E+9] Position offset Writing is not
allowed if the
controller
enable has
been issued.
0x00n10008 Read/Write Encoder: every UINT16 1 [0,1] Encoder count Writing is not
direction allowed if the
controller
enable has
been issued.
0x00n10009 Read/Write Encoder: every REAL64 e.g. mm [0.001 ... Modulo factor
1.0E+9]
0x00n1000A Read/Write Encoder: every UINT32 1 s. ENUM (>0) Encoder mode [} 161]
0x00n1000B Read/Write Encoder: every UINT16 1 0/1 Soft end min.
monitoring?
0x00n1000C Read/Write Encoder: every UINT16 1 0/1 Soft end max.
monitoring?
0x00n1000D Read/Write Encoder: every REAL64 mm Soft end position min.
0x00n1000E Read/Write Encoder: every REAL64 mm Soft end position max.
0x00n1000F Read/Write Encoder: every UINT32 1 s. ENUM (≥0) Encoder evaluation
in the appendix direction [} 161]
(enable for log.
counting direction)
0x00n10010 Read/Write Encoder: every REAL64 s [0.0...60.0] Filter time for actual
position value in
seconds (P-T1)
0x00n10011 Read/Write Encoder: every REAL64 s [0.0...60.0] Filter time for actual
velocity value in
seconds (P-T1)
0x00n10012 Read/Write Encoder: every REAL64 s [0.0...60.0] Filter time for actual
acceleration value in
seconds (P-T1)
0x00n10013 Read/Write Encoder: every STRING[10+1] 1 Physical unit Not
implemented!
0x00n10014 Read/Write Encoder: every UINT32 1 Interpretation of the Not
units (position, implemented!
velocity, time)
Bit array
Bit 0: Velocity in x/min
instead of x/s
Bit 1: Position in
thousandths of the
base unit
0x00n10015 Read Encoder: every UINT32 INC [0x0... Encoder mask Read-only
0xFFFFFFFF] (maximum value of the parameter
encoder actual value
see also
in increments
"Encoder Sub
Note: The encoder Mask"
mask may be any parameter
numerical value (e.g.
3600000). Unlike in
the past, it no longer
has to correspond to a
continuous series off
binary one's (2n-1).
0x00n10016 Read/Write Encoder: every UINT16 1 0/1 Actual position
correction
(measurement system
error correction)?

70 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n10017 Read/Write Encoder: every REAL64 s [0.0...60.0] Filter time for actual
position correction in
seconds (P-T1)
0x00n10019 Read/Write Encoder: every UINT32 1 ENUM (>0) Encoder absolute Writing is not
dimensioning system allowed if the
controller
[} 161]
enable has
been issued.
0x00n1001A Read Encoder: every UINT32 1 ENUM (>0) Encoder position Not
initialization implemented!
0x00n1001B Read/Write Encoder: every REAL64 e.g. mm [≥0, modulo Tolerance window for
factor/2] modulo-start
0x00n1001C Read Encoder: every UINT32 1 ENUM (>0) Encoder sign
interpretation [} 161]
(data type)
0x00n1001D Read Encoder: every UINT16 1 0/1 Incremental or
absolute encoder ?
0: Incremental
encoder type
1: Absolute encoder
type
0x00n10023 Read/Write Encoder: every REAL64 e.g. mm/ [1.0E-12 ... Component of the NEW from TC3
INC 1.0E+30] scaling factor:
Writing is not
numerator
allowed if the
(=> scaling factor controller
numerator / scaling enable has
factor denominator) been issued.
0x00n10024 Read/Write Encoder: every REAL64 1 [1.0E-12 ... Component of the NEW from TC3
1.0E+30] scaling factor:
Writing is not
denominator
allowed if the
(=> scaling factor controller
numerator / scaling enable has
factor denominator) been issued.
Default: 1.0
0x00n10025 Read/Write Encoder: every { e.g. mm/ [1.0E-12 ... Component of the NEW from TC3
REAL64 INC 1.0E+30] scaling factor:
REAL64 1 [1.0E-12 ... numerator
} 1.0E+30]
Component of the
scaling factor:
denominator
(=> scaling factor
numerator / scaling
factor denominator)

0x00n10030 Read/Write Encoder: every UINT32 1 Internal encoder NEW from TC3
control double word for
specifying the
operation modes and
properties

0x00n10101 Read/Write E: INC UINT16 1 [0,1] Inverse search


direction for ref.cam?
0x00n10102 Read/Write E: INC UINT16 1 [0,1] inverse search
direction for sync
pulse?
0x00n10103 Read/Write E: INC REAL64 e.g. mm [±1000000.0] Reference position
0x00n10104 Read/Write E: INC UINT16 1 [0,1] Distance monitoring Not
between Ref. cams implemented!
and sync pulse active?
0x00n10105 Read/Write E: INC UINT32 INC [0 ... 65536] Minimum gap between Not
Ref. cams and sync implemented!
pulse in increments
0x00n10106 Read/Write E: INC UINT16 1 [0,1] External sync pulse?
0x00n10107 Read/Write E: INC UINT32 1 s. ENUM (>0) Reference mode
[} 162]

TwinCAT 3 Version: 1.1.0 71


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n10108 Read/Write E: INC UINT32 1 [0x0000000F... Encoder Sub Mask see also
0xFFFFFFFF]bi (maximum value of the "Encoder Mask"
nary mask: (2n - absolute range of the parameter
1) encoder actual value
in increments)
Used, for example, as
a reference mark for
the referencing mode
"Software Sync" and
for the NC Retain Data
"ABSOLUTE
(MODULO)",
"INCREMENTAL
(SINGLETURN
ABSOLUTE)".
Note 1: The Encoder
Sub Mask must be
smaller than or equal
to the Encoder Mask.
Note 2: The Encoder
Mask must be an
integer multiple of the
Encoder Sub Mask.
Note 3: The Encoder
Sub Mask must be a
continuous sequence
of binary ones (2n-1),
e.g. 0x000FFFFF.

0x00n10110 Read/Write E: INC REAL64 1 [0.0 ... Scaling/weight of the


(encoder 1000000.0] noise part for the
simulation) simulation encoder

CONTROLLER
0x00n20001 Read Controller: UINT32 1 [1 ... 255] Controller ID
every
n = 0: standard
controller of the axes >
0: nth controller of the
axis (optional)
0x00n20002 Read Controller: STRING[30+1] 1 30 characters Controller name
every
0x00n20003 Read Controller: UINT32 1 ENUM (>0) Controller type [} 159]
every
0x00n2000A Read/Write Controller: 1 ENUM (>0) Controller mode
every
0x00n2000B Read/Write Controller: REAL64 % [0.0 ... 1.0] Weighting of the
every velocity pre-control
(default value: 1.0 =
100 %)

0x00n20010 Read/Write Controller: UINT16 1 0/1 Position lag monitoring


every Pos.?
0x00n20011 Read/Write Controller: UINT16 1 0/1 Position lag monitoring
every Velocity?
0x00n20012 Read/Write Controller: REAL64 e.g. mm Max. lag error position
every
0x00n20013 Read/Write Controller: REAL64 s Max. lag error filter
every time position
0x00n20014 Read/Write Controller: REAL64 e.g. mm/ Max. lag error velocity
every s
0x00n20015 Read/Write Controller: REAL64 s Max. lag error filter
every time velocity

0x00n20100 Read/Write P/PID (pos., REAL64 1 [0.0...1.0] Maximum output (default value:
(veloc.) limitation (±) for 0.5 == 50%)
controller total output

72 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n20102 Read/Write P/PID (pos.) REAL64 e.g. mm/ [0.0...1000.0] Proportional gain kp or Position control
s/ mm kv
Unit: Base Unit / s /
Base Unit
0x00n20103 Read/Write PID (pos.) REAL64 s [0.0 ... 60.0] Integral action time Tn Position control
0x00n20104 Read/Write PID (pos.) REAL64 s [0.0 ... 60.0] Derivative action time Position control
Tv
0x00n20105 Read/Write PID (pos.) REAL64 s [0.0 ... 60.0] Damping time Td Position control
0x00n20106 Read/Write PP (Pos.) REAL64 e.g. mm/ [0.0...1000.0] Additional proportional Position control
s/ mm gain, kp or kv
respectively, that
applies above a
limiting velocity in
percent.
Unit: Base Unit / s /
Base Unit
0x00n20107 Read/Write PP (Pos.) REAL64 % [0.0...1.0] Threshold velocity in
percent above which
the additional
proportional gain, kp
or kv respectively,
applies
0x00n20108 Read/Write P/PID (Acc.) REAL64 s [0.0 ... 100.0] Proportional gain ka Acceleration
pre-control
0x00n2010D Read/Write P/PID REAL64 mm [0.0 ... 10000.0] "Dead band" for Reserved
position error (control function
deviation)
(for P/PID controllers
with velocity or torque
interface)
0x00n2010F Read/Write P/PP/PID (pos.) REAL64 (mm/s) / [0.0...1000.0] Slave coupling Slave coupling
Slave control mm difference control: difference
control
Proportional gain kcp

0x00n20110 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset


calibration: active/
passive
0x00n20111 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset
calibration: hold mode
0x00n20112 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset
calibration: Fading
mode
0x00n20114 Read/Write P (Pos.) REAL64 % [0.0 ... 1.0] Automatic offset
calibration: Pre-control
limit
0x00n20115 Read/Write P (Pos.) REAL64 s [0.1 ... 60.0] Automatic offset
calibration: Time
constant
0x00n20116 Read/Write PID (pos.) REAL64 % [0.0...1.0] Maximum output
limitation (±) for I part
in percent (default
setting: 0.1 = 10%)
0x00n20117 Read/Write PID (pos.) REAL64 % [0.0...1.0] Maximum output
limitation (±) for D part
in percent (default
setting: 0.1 = 10%)
0x00n20118 Read/Write PID (pos.) UINT16 1 0/1 Deactivation of the I
part during an active
positioning process
(assuming I part
active)? (Default
setting: 0 = FALSE)
0x00n20120 Read/Write P/PID (pos.) REAL64 s ≥0 PT-1 filter value for Reserved
position error (pos. function,
control deviation) no standard!

0x00n20202 Read/Write P/PID (velocity) REAL64 1 [0.0...1000.0] Proportional gain kp or Velocity control
kv

TwinCAT 3 Version: 1.1.0 73


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n20203 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Integral action time Tn Velocity
control
0x00n20204 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Derivative action time Velocity control
Tv
0x00n20205 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Damping time Td Velocity control
0x00n20206 Read/Write PID (velocity) REAL64 % [0.0...1.0] Maximum output Velocity
limitation (±) for I-part control
in percent (default
setting: 0.1 = 10%)
0x00n20207 Read/Write PID (velocity) REAL64 % [0.0...1.0] Maximum output Velocity control
limitation (±) for D-part
in percent (default
setting: 0.1 = 10%)
0x00n2020D Read/Write P/PID (velocity) REAL64 mm/s [0.0 ... 10000.0] "Dead band" for Reserved
velocity error (control function
deviation)
(for P/PID controllers
with velocity or torque
interface)
0x00n20220 Read/Write P/PID (velocity) REAL64 s ≥0 PT-2 filter value for Velocity control,
velocity error (vel. not standard!
control deviation)
0x00n20221 Read/Write P/PID (velocity) REAL64 s ≥0 PT-1 filter value for Reserved
velocity error (vel. function,
control deviation) no standard!

0x00n20250 Read/Write P/PI (observer) UINT32 1 ENUM (>0) Observer mode [} 159]
for control in the
torque interface
0: OFF (default)
1: LUENBERGER
0x00n20251 Read/Write P/PI (observer) REAL64 Nm / A >0.0 Motor:
Torque constant KT
0x00n20252 Read/Write P/PI (observer) REAL64 kg m2 >0.0 Motor:
Moment of inertia JM
0x00n20253 Read/Write P/PI (observer) REAL64 Hz [100.0 ... Bandwidth f0
2000.0] Default:
500
0x00n20254 Read/Write P/PI (observer) REAL64 1 [0.0 ... 2.0] Correction factor kc
Default: 1.0
0x00n20255 Read/Write P/PI (observer) REAL64 s [0.0 ... 0.01] Velocity filter (1st
Default: 0.001 order):
Time constant T

0x00n20A03 Read/Write P/PID (MW) REAL64 cm^2 [0.0 ... Cylinder area AA of the Reserved
1000000] A side in cm^2 parameters!
0x00n20A04 Read/Write P/PID (MW) REAL64 cm^2 [0.0 ... Cylinder area AB of the Reserved
1000000] B side in cm^2 parameters!
0x00n20A05 Read/Write P/PID (MW) REAL64 cm^3/s [0.0 ... Nominal volume flow Reserved
1000000] Qnom in cm^3/s parameters!
0x00n20A06 Read/Write P/PID (MW) REAL64 bar [0.0 ... Nominal pressure or Reserved
1000000] valve pressure drop, parameters!
Pnom in bar
0x00n20A07 Read/Write P/PID (MW) UINT32 1 [1 ... 255] Axis ID for the system Reserved
pressure Po parameters!

DRIVE:
0x00n30001 Read Drive: every UINT32 1 [1 ... 255] Drive ID
0x00n30002 Read Drive: every STRING[30+1] 1 30 characters Drive name
0x00n30003 Read Drive: every UINT32 1 ENUM (>0) Drive type [} 164]
0x00n30004 Read/Write Drive: every UINT32 1 Byteoffset Input address offset (I/ Change I/O
O-Input-Image) address
0x00n30005 Read/Write Drive: every UINT32 1 Byteoffset Output address offset Change I/O
(I/O-Output-Image) address

74 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n30006 Read/Write Drive: every UINT16 1 [0,1] Motor polarity Writing is not
allowed if the
controller
enable has
been issued.
0x00n3000A Read/Write Drive: every UINT32 1 ENUM (≥0) Drive mode
0x00n3000B Read/Write Drive: every REAL64 % [-1.0 ... 1.0] Minimum output limit
(output limitation)
(default setting: -1.0 =
-100%)
0x00n3000C Read/Write Drive: every REAL64 % [-1.0 ... 1.0] Maximum output limit
(output limitation)
(default setting: 1.0 =
100%)
0x00n3000D Read Drive: every UINT32 INC Maximum number of
output increments
(output mask)
0x00n30010 Read/Write Drive: every UINT32 1 Internal Drive Control Reserved!
double word to
determine the drive
operation modes
0x00n30011 Read/Write every UINT32 1 ≥5 Internal drive reset Reserved!
counter
(time in NC cycles for
enable and reset)

0x00n30101 Read/Write D: Servo REAL64 e.g. mm/ >0.0 Reference velocity at


s reference output
(velocity pre-control)
0x00n30102 Read/Write D: Servo REAL64 % [0.0 ... 5.0] Reference output in
percent (default
setting: 1.0 = 100%)
0x00n30103 Read D: Servo REAL64 e.g. mm/ >0.0 Resulting velocity at
s 100% output
0x00n30104 Read/Write D: Servo REAL64 e.g. mm/ ±∞ Velocity offset (DAC
s offset) for drift
calibration (offset
calibration) of the axis
0x00n30105 Read/Write D: Servo REAL64 1 [0.0 ... Velocity scaling For
(Sercos, Profi 100000000.0] (scaling factor to Sercos, Profi
Drive, AX200x, respond to the weight Drive, AX200x,
CANopen) in the drive) CANopen
0x00n30106 Read/Write D: Profi Drive UINT32 0.001 * ≥0 Profibus/Profi Drive Only for Profi
DSC 1/s DSC: Position control Drive DSC
gain Kpc
0x00n30107 Read/Write D: Profi Drive REAL64 1 ≥ 0.0 Profibus/Profi Drive Only for Profi
DSC DSC: Scaling for Drive DSC
calculation of 'XERR'
(default: 1.0)
0x00n30109 Read/Write D: Servo REAL64 1 [0.0 ... Position scaling For Sercos,
(Sercos, 100000000.0] (scaling factor to CANopen
CANopen) respond to the weight
in the drive)
0x00n3010A Read/Write D: Servo REAL64 1 [0.0 ... Acceleration scaling For
(Sercos, Profi 100000000.0] (scaling factor to Sercos, Profi
Drive, AX200x, respond to the weight Drive, AX200x,
CANopen) in the drive) CANopen
0x00n3010B Read/Write D: Servo REAL64 1 [0.0 ... Torque scaling (rotary For
(Sercos, Profi 100000000.0] motor) or force scaling Sercos, Profi
Drive, AX200x, (linear motor) (scaling Drive, AX200x,
CANopen) factor for reacting to CANopen
weighting in the drive)
for "TorqueOffset"
(additive moment as
pre-control)

TwinCAT 3 Version: 1.1.0 75


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n3010C Read/Write D: Servo REAL64 1 [0.0 ... Torque scaling (rotary For
(Sercos, Profi 100000000.0] motor) or force scaling Sercos, Profi
Drive, AX200x, (linear motor) (scaling Drive, AX200x,
CANopen) factor for reacting to CANopen
weighting in the drive)
From TC3.1
for "SetTorque"
B4024.2
(e.g.
MC_TorqueControl)
with Drive OpMode
CST)

0x00n30120 Read/Write D: servo/ UINT32 1 ≥0 Table ID Only for


hydraulics/ KL4xxx,
(0: no table)
M2400,
Universal
0x00n30121 Read/Write D: servo/ UINT32 1 ≥0 Interpolation type Only for
hydraulics KL4xxx,
0: linear
M2400,
2: spline Universal
0x00n30122 Read/Write Servo/ REAL64 % [-1.0 ... 1.0] Output offset in Only for
hydraulics percent KL4xxx,
M2400,
Note: Acts according
Universal
to the characteristic
evaluation!

0x00n30151 Read/Write D: servo / non- REAL64 1 [0.0 ... 100.0] Quadrant


linear compensation factor
(relationship between
quadrant I and III)
0x00n30152 Read/Write D: servo / non- REAL64 1 [0.01 ... 1.0] Velocity reference
linear point in percent (1.0 =
100 %)
0x00n30153 Read/Write D: servo / non- REAL64 1 [0.01 ... 1.0] Output reference point
linear in percent (1.0 = 100
%)

0x00030301 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 1


motor
0x00030302 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 2
motor
0x00030303 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 3
motor
0x00030304 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 4
motor
0x00030305 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 5
motor
0x00030306 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 6
motor
0x00030307 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 7
motor
0x00030308 Read/Write D: Stepper UINT8 1 Bit mask: Cycle 8
motor
0x00030310 Read/Write D: Stepper UINT8 1 Bit mask: Holding
motor current

76 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.4.2 "Index offset" specification for axis state (Index group 0x4100 + ID)

TwinCAT 3 Version: 1.1.0 77


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n00000 Read every (online { AXIS ONLINE Changed from
structure for STRUCTURE (NC/ TwinCAT 3, not
axis data) CNC) oscilloscopeabl
INT32 1 Error state e!
(NCAXISSTAT
INT32 Reserved E_
REAL64 e.g. mm Actual position ONLINESTRU
REAL64 e.g. Modulo actual position CT)
degrees
REAL64 e.g. mm Set position
REAL64 e.g. Modulo set position
degrees
REAL64 e.g. mm/ Optional: Actual
s velocity
REAL64 e.g. mm/ Set velocity
s
UINT32 % 0...1000000 Velocity override
(1000000 == 100%)
UINT32 Reserved
REAL64 e.g. mm Lag error position
REAL64 e.g. mm PeakHold value for
max. neg. position lag
(pos.)
REAL64 e.g. mm Peak hold value for
max. pos. position lag
(pos.)
REAL64 % Controller output in
percent
REAL64 % Total output in percent
UINT32 1 ≥0 Axis state double word
UINT32 1 ≥0 Axis control double
word
UINT32 1 ≥0 Slave coupling state
(state)
UINT32 1 0; 1,2,3... Axis control loop index
REAL64 e.g. mm/ Actual acceleration
s^2
REAL64 e.g. mm/ Set acceleration
s^2
REAL64 e.g. mm/ Set jerk (new from
s^3 TwinCAT 3.1 B4013)
REAL64 e.g. Set torque or set force
100% =
("SetTorque")
1000
REAL64 e.g. Actual torque or actual
100% = force (new from
1000 TwinCAT 3.1 B4013)
REAL64 e.g. %/s Set torque change or
set force change (time
derivative of the set
torque or set force)
(from TwinCAT 3.1
B4024.2)
REAL64 e.g. Additive set torque or
100% = additive set force
1000
("TorqueOffset")
(from TwinCAT 3.1
B4024.2)
...
} 256 bytes
0x00000001 Read every UINT32 1 Axis state error code Symbolic
access:
"ErrState''

0x00n00009 Read every UINT32 1 ≥0 Set cycle counter


(SAF timestamp)

78 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n0000A Read every REAL64 e.g. mm Set position Symbolic
access:
"SetPos''
0x00n0000B Read every REAL64 e.g. Modulo set position Symbolic
DEGRE access:
ES "SetPosModulo'
'
0x00n0000C Read every INT32 1 Modulo set rotation
0x00n0000D Read every REAL64 1 [-1.0, 0.0, 1.0] Set travel direction
0x00n0000E Read every REAL64 e.g. mm/ Set velocity Symbolic
s access:
"SetVelo''
0x00n0000F Read every REAL64 e.g. mm/ Set acceleration Symbolic
s^2 access:
"SetAcc''
0x00n00010 Read every REAL64 e.g. mm/ Set jerk (time Symbolic
s^3 derivative of the set access:
acceleration) "SetJerk''
0x00n00011 Read every REAL64 e.g. Nm Set torque (rot. motor) NEW from
or N or TwinCAT 3.1
respectiv set force (linear motor) B4022
ely,
("SetTorque") Symbolic
e.g. access:
100% = "SetTorque''
1000
0x00n00012 Read every REAL64 1 Set coupling factor
(set gear ratio)
0x00n00013 Read every REAL64 e.g. mm Expected target
position
0x00n00014 Read Servo { Remaining travel time Always to SEC
and distance Port 501!
(SERVO):
REAL64 s ≥0 Remaining travel time
REAL64 e.g. mm ≥ 0 Remaining distance
}
0x00n00015 Read every UINT32 1 ≥0 Set command number Symbolic
access:
"CmdNo''
0x00n00016 Read Servo REAL64 s ≥0 Positioning time of the
last motion command
(start → target position
window)
0x00n00017 Read Servo REAL64 % [0.0…1.0] Set override value for NEW from
velocity TwinCAT 3.1
1.0=100%
B4020
Note: initially only
implemented for FIFO
group
0x00000018 ReadWrite Servo Write Reading the "Stop Always to SEC
information" (stop Port 501!
distance, stop time)
REAL64 e.g. mm/ ≥ 0 Deceleration for axis
s^2 stop
REAL64 e.g. mm/ ≥ 0 Jerk for axis stop
s^3
Read
REAL64 e.g. mm ≥ 0 Stop distance
REAL64 s ≥0 Stop time

0x00n0001A Read every REAL64 e.g. mm Uncorrected


set position
0x00n0001D Read every REAL64 1 [-1.0, 0.0, 1.0] Uncorrected
set travel direction
0x00n0001E Read every REAL64 e.g. mm/ Uncorrected
s set velocity
0x00n0001F Read every REAL64 e.g. mm/ Uncorrected
s^2 set acceleration

TwinCAT 3 Version: 1.1.0 79


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00000020 Read every UINT32 1 s. ENUM Coupling state (state)
0x00000021 Read every UINT32 1 ≥0 Coupling table index
0x00000022 Read Servo master/ { Reading the coupling
slave coupling parameters (SERVO):
Type: LINEAR, REAL64 1 [±1000000.0] Parameter 1: Linear:
(&SPECIAL) Gear ratio
REAL64 1 [±1000000.0] Parameter 2: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 3: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 4: Linear:
Reserve
}
0x00000023 Read Servo master/ REAL64 1 [±1000000.0] Reading the gear ratio
slave coupling (SERVO)
Type: LINEAR, Type: LINEAR
(&SPECIAL)
0x00000024 Read Servo UINT32 1 ≥0 Number / index of the
active axis control
circuit (triple of
encoder, controller
and axis interface)
0x00000025 Read Servo UINT16 1 0/1 External setpoint
specification via axis
interface PCLtoNC
active?
0x00000026 Read Servo master/ REAL64 [64] 1 ±∞ Reading of the Modified from
slave coupling characteristic values of TwinCAT 3
the slave
Type:
synchronization profile
SYNCHRONIZI
NG Type:
SYNCHRONIZING
0x00000027 ReadWrite Servo master/ Write Reading the "table Only port 500!
slave coupling coupling information"
Modified from
Type: VOID e.g. mm ±∞ - No data for the TwinCAT 3
TABULAR, MF or "current information"
- optional for a certain
REAL64
"master axis position"
or
- for a certain table ID
DWORD, and optional “master
DWORD, axis position” (TC 3.1
REAL64 B4017)
Read
REAL64 [32] ±∞ Reading the structure
for the table coupling
information [} 167]
0x00000028 ReadWrite Servo master/ Write Reading the "multi- Only port 500!
slave coupling table coupling
information"
Type:
(CamAddition)
MULTICAM
(CamAddition) UINT32 1 ≥0 Table ID to which the
query relates
Read
96 bytes Reading the structure
for the multi-table
coupling information
[} 167]
0x00000029 Read Servo UINT32 1 Delayed error code
(error pre-warning) in
case of a delayed
error reaction (see bit
ErrorPropagationDelay
ed)

80 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x0000002A Read Servo REAL64 e.g. mm ±∞ Position difference
while fading from set
position to actual
position (fading part)
0x0000002B Read Servo REAL64 e.g. mm/ ±∞ Relative velocity while
s fading from set
position to actual
position (fading part)
0x0000002C Read Servo REAL64 e.g. mm/ ±∞ Relative acceleration
s ^2 while fading from set
position to actual
position (fading part)
0x0000002D Read Servo UINT32 1 ≥0 Counter for NEW
initialization command
(InitializeCommandCo
unter)
0x0000002E Read Servo UINT32 1 ≥0 Counter for reset NEW
command
(ResetCommandCoun
ter)
0x00000030 Read Servo REAL64 e.g. Nm/ ±∞ Set torque change NEW from
s or N/s (rot. motor) or TwinCAT 3.1
set force change B4024
(linear motor)
(time derivative of the
set torque or set force)
0x00000031 Read/Write Servo REAL64 e.g. Nm Additive set torque From
or N (rot. motor) or TwinCAT 3.1
respectiv additive set force B4024.2
ely, (linear motor) for pre-
Symbolic
control.
e.g. access:
100% = ("TorqueOffset") "TorqueOffset''
1000
0x00000040 Read Servo UINT32 1 ≥0 Counter for correction NEW from
of the NC setpoints in TwinCAT 3.1
case of data B4020
inconsistency
(activation with Idx-
Group 0x1000 and
Idx-Offset 0x0020)

0x00000050 Read every UINT32 1 Set travel phase Cannot be


(SWGenerator) traced by
oscilloscope!
0x00000051 Read every UINT16 1 Is the axis disabled? Cannot be
traced by
oscilloscope!

0x00n00060 Read/Write every (online { Simple AXIS Cannot be


setpoint SETPOINT traced by
structure) STRUCTURE (NC/ oscilloscope!
CNC)
40 bytes
REAL64 e.g. mm Set position
from TC 3.1
REAL64 e.g. mm/ Set velocity B4022.30
s
REAL64 e.g. mm/ Set acceleration /
s^2 deceleration
REAL64 1 [-1.0, 0.0, 1.0] Set travel direction
REAL64 e.g. mm/ Set jerk
s^3
}

TwinCAT 3 Version: 1.1.0 81


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n00060 Read/Write every (online { Extended AXIS Cannot be
setpoint SETPOINT traced by
structure) STRUCTURE (NC/ oscilloscope!
CNC)
56 bytes
REAL64 e.g. mm Set position
from TC 3.1
REAL64 e.g. mm/ Set velocity B4022.29
s
REAL64 e.g. mm/ Set acceleration /
s^2 deceleration
REAL64 1 [-1.0, 0.0, 1.0] Set travel direction
REAL64 e.g. mm/ Set jerk
s^3
REAL64 Nm or N Set torque or set force
or %
REAL64 Nm/s or time derivative of the
N/s or set torque or set force
%/s (ramp)
}
0x00n00061 Read/Write every (online { AXIS DYNAMIC from TC 3.1
dynamics SETPOINT B4022.30
setpoint STRUCTURE (NC/
structure) CNC)
32 bytes REAL64 e.g. mm/ Set velocity
s
REAL64 e.g. mm/ Set acceleration /
s^2 deceleration
REAL64 1 [-1.0, 0.0, 1.0] Set travel direction
REAL64 e.g. mm/ Set jerk
s^3
}
0x00n00061 Read/Write every (online { AXIS DYNAMIC from TC 3.1
dynamics SETPOINT B4022.29
setpoint STRUCTURE (NC/
structure) CNC)
48 bytes REAL64 e.g. mm/ Set velocity
s
REAL64 e.g. mm/ Set acceleration /
s^2 deceleration
REAL64 1 [-1.0, 0.0, 1.0] Set travel direction
REAL64 e.g. mm/ Set jerk
s^3
REAL64 Nm or N Set torque or set force
or %
REAL64 Nm/s or time derivative of the
N/s or set torque or set force
%/s (ramp)
}
0x00n00062 Read/Write every (online { TORQUE SETPOINT from TC 3.1
TORQUE STRUCTURE (NC/ B4022.30
setpoint CNC)
structure) REAL64 Nm or N Set torque or set force
16 bytes or %
REAL64 Nm/s or time derivative of the
N/s or set torque or set force
%/s (ramp)
}

82 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00000063 ReadWrite only for Write Read active "Drive NEW from TC
SERCOS/SoE Operation Mode" 3.1 B4022 (NC
and CANopen/ UINT32 1 Reserve 4443)
CoE
UINT32 1 Reserve Always to SEC
Port 501!
Read
INT32 ENUM [0; 1, 2, 3, …] Currently active "Drive
[} 165] Operation Mode"
Special cases:
(generic modes)
(see ≥ 100: SoE
appendi <0: CoE
x)
UINT32 1 Reserve

0x00n10002 Read every (Encoder) REAL64 e.g. mm Actual position (charge Symbolic
with actual position access:
compensation value) "ActPos''
n = 0: standard
encoder of the axes >
0: nth encoder of the
axis (optional)
0x00n10003 Read every (Encoder) REAL64 e.g. Modulo actual position Symbolic
DEGRE access:
ES "ActPosModulo'
'
0x00n10004 Read every (Encoder) INT32 1 Modulo actual rotation
0x00n10005 Read every (Encoder) REAL64 e.g. mm/ Optional: Actual Symbolic
s velocity access:
"ActVelo''
0x00n10006 Read every (Encoder) REAL64 e.g. mm/ Optional: Actual Symbolic
s^2 acceleration access:
"ActAcc''
0x00n10007 Read every (Encoder) INT32 INC Encoder actual
increments
0x00n10008 Read every (Encoder) INT64 INC Software - actual
increment counter
0x00n10009 Read every (Encoder) UINT16 1 0/1 Reference flag
("calibrate flag")
0x00n1000A Read every (Encoder) REAL64 e.g. mm Actual position
correction value
(measurement system
error correction)
0x00n1000B Read every (Encoder) REAL64 e.g. mm Actual position without Cannot be
actual position traced by
compensation value oscilloscope!

0x00n10010 Read every (Encoder) REAL64 e.g. mm/ Actual velocity without
s actual position
compensation value
0x00n10012 Read every (Encoder) REAL64 e.g. mm Unfiltered actual
position (charge with
actual position
compensation value)
0x00n10014 Read Encoder: SoE, REAL64 e.g. mm/ Optional: actual drive NEW from
CoE, MDP 742 s velocity (transferred TwinCAT 3.1
directly from SoE, CoE B4020.30
or MDP 742 drive)
0x00n10015 Read every (Encoder) REAL64 e.g. mm/ Optional: Unfiltered
s actual velocity

0x00n10017 Read REAL64 e.g. mm Reading out the


MC_SetPosition offset

TwinCAT 3 Version: 1.1.0 83


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n10018 Read PTP axis UINT32 0/1 0/1 Returns the status of Port501
Encoder axis reinitialization after NC
encoder reinitialization
has been started
(Index Group
0x4200+ID; Index
Offset 0x00n0003B).
n = 0: Standard
encoder of the axis
n > 0: n-th encoder of
the axis (optional)

0x00n10101 Read INC (Encoder) REAL64 e.g. mm Read back of the Cannot be
position difference traced by
between activation of oscilloscope!
the internal hardware
latch and the time
when it becomes valid

0x00n20001 Read R: every INT32 1 Error state of the


controller
n = 0: standard
controller of the axes >
0: nth controller of the
axis (optional)
0x00n20002 Read R: every REAL64 e.g. mm/ Controller output in Symbolic
s absolute units access:
"CtrlOutput''
0x00n20003 Read R: every REAL64 % Controller output in Cannot be
percent traced by
oscilloscope!
0x00n20004 Read R: every REAL64 V Controller output in Cannot be
volts traced by
oscilloscope!
0x00n2000D Read R: every REAL64 e.g. mm Lag error position Base Unit
(without dead time
compensation)
0x00n2000F Read R: every REAL64 e.g. mm Lag error position (with Symbolic
dead time access:
compensation) "PosDiff''

0x00n20010 Read R: every REAL64 e.g. mm Peak hold value for


maximum negative lag
error of the position
0x00n20011 Read R: every REAL64 e.g. mm Peak hold value for
minimum positive lag
error of the position
0x00n20012 Read R: every REAL64 e.g. mm/ Lag error velocity Not
s implemented!

0x00n20021 Read R: every REAL64 e.g. mm Difference (deviation) Symbolic


between the lag error access:
position of the master "PosDiffCouple''
axis and that of the
slave axis (master lag
error minus slave lag
error)
0x00n20022 Read R: every REAL64 e.g. mm PeakHold value for the Base Unit
maximum negative
difference between
master and slave axis
lag error of the
position
0x00n20023 Read R: every REAL64 e.g. mm PeakHold value for the Base Unit
maximum positive
difference between
master and slave axis
lag error of the
position

84 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range

0x00n20101 Read R: P/PID (Pos.) REAL64 e.g. mm/ P part of the controller
s in absolute units
0x00n20102 Read R: PID (Pos.) REAL64 e.g. mm/ I part of the controller
s in absolute units
0x00n20103 Read R: PID (Pos.) REAL64 e.g. mm/ D part of the controller
s in absolute units
0x00n20104 Read R: PID (Pos.) UINT16 1 0/1 Limitation of the I part
active?
0x00n20105 Read R: PID (Pos.) UINT16 1 0/1 Limitation of the D part
active?
0x00n20106 Read R: PID (Pos.) UINT16 1 0/1 ARW measures of the Not
I-part active? ARW: implemented!
Anti Reset Windup

0x00n20110 Read R: PID (Pos.) REAL64 e.g. mm/ Acceleration pre- Acceleration
s control Yacc of the pre-control
controller in absolute
units
Note: function
depends on controller
type!
0x00n20111 Read R: PP (Pos.) REAL64 mm/s/ ≥0 Internal interpolated PP controller
mm proportional gain kp or
kv

0x00n20201 Read R: P,PID REAL64 e.g. mm/ Velocity part of the


(velocity) s controller
0x00n20202 Read R: P,PID REAL64 % Velocity part of the Cannot be
(velocity) controller in percent traced by
oscilloscope!
0x00n20203 Read R: P,PID REAL64 V Velocity part of the Cannot be
(velocity) controller in volts traced by
oscilloscope!
0x00n20201 Read R: P/PID REAL64 e.g. mm/ P part of the controller
(velocity) s in absolute units
0x00n20202 Read R: P/ PID REAL64 e.g. mm/ I part of the controller
(veloc.) s in absolute units
0x00n20203 Read R: P/ PID REAL64 e.g. mm/ D part of the controller
(veloc.) s in absolute units
0x00n20204 Read R: P/ PID UINT16 1 0/1 Limitation of the I part
(veloc.) active?
0x00n20205 Read R: P/ PID UINT16 1 0/1 Limitation of the D part
(veloc.) active?
0x00n20206 Read R: P/ PID UINT16 1 0/1 ARW measures for the
(veloc.) I part active?
(ARW: Anti Reset
Windup)
0x00n2020A Read R: P/ PID REAL64 e.g. mm/ Total input size of the
(veloc.) s velocity controller

0x00n20A00 Read R: PID (MW) REAL64 % [-1.0...1.0] Offsetting of the set Reserved
velocity (pre-control) parameters!
0x00n20A01 Read R: PID (MW) REAL64 e.g. mm/ P part of the controller Reserved
s in absolute units or parameters!
percent (according to
output weight)
0x00n20A02 Read R: PID (MW) REAL64 e.g. mm/ I part of the controller Reserved
s in absolute units or parameters!
percent (according to
output weight)
0x00n20A03 Read R: PID (MW) REAL64 e.g. mm/ D part of the controller Reserved
s in absolute units or parameters!
percent (according to
output weight)
0x00n20A04 Read R: PID (MW) UINT16 1 0/1 Limitation of the I part Reserved
active? parameters!

TwinCAT 3 Version: 1.1.0 85


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
(Hex) unit range
0x00n20A05 Read R: PID (MW) UINT16 1 0/1 Limitation of the D part Reserved
active? parameters!
0x00n20A06 Read R: PID (MW) UINT16 1 0/1 ARW measures for the Reserved
I part active? parameters!
ARW: Anti Reset
Windup
0x00n20A10 Read R: PID (MW) REAL64 e.g. mm/ Acceleration pre- Reserved
s control Yacc of the parameters!
controller in absolute
units

0x00n30001 Read D: every INT32 1 Error state of the drive


0x00n30002 Read D: every REAL64 e.g. mm/ Total output in Symbolic
s absolute units access:
"DriveOutput''"
0x00n30003 Read D: every REAL64 % Total output in percent
0x00n30004 Read D: every REAL64 V Total output in volts Cannot be
traced by
oscilloscope!
0x00n30005 Read D: every REAL64 e.g. mm/ PeakHold value for
s maximum negative
total output
0x00n30006 Read D: every REAL64 e.g. mm/ PeakHold value for
s maximum positive total
output
0x00n30007 Read D: every REAL64 e.g. Actual torque or actual from
100% = force respectively TwinCAT 3.1
1000, (typically 100% = B4022
e.g. Nm 1000)
Symbolic
or N
access:
"ActTorque''
0x00n30008 Read D: every REAL64 e.g. Nm/ ±∞ Actual torque change from
s or N/s or actual force change TwinCAT 3.1
respectively B4024
(time derivative of the
actual torque or actual
force respectively)

0x00n30013 Read D: every REAL64 % Total output in percent


(based on non-linear
characteristic curve!)
0x00n30014 Read D: every REAL64 V Total output in volt Cannot be
(based on non-linear traced by
characteristic curve!) oscilloscope!

0x00n3011A Read D: Servo REAL64 e.g. mm Optional output NEW


(Sercos, filtering: For Sercos,
CANopen) Filtered set position CANopen
0x00n3011E Read D: Servo REAL64 e.g. mm/ Optional output NEW
(Sercos, s filtering: For Sercos,
CANopen) Filtered set velocity CANopen
0x00n3011F Read D: Servo REAL64 e.g. mm/ Optional output NEW
(Sercos, s^2 filtering: For Sercos,
CANopen) Filtered set CANopen
acceleration / set
deceleration

86 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.4.3 "Index offset" specification for axis functions (Index group 0x4200
+ ID)

TwinCAT 3 Version: 1.1.0 87


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000001 Write every VOID Reset axis For FIFO axes
too!
0x00000002 Write every VOID Stop axis For FIFO axes
too!
0x00000003 Write every VOID Clear axis (task) For FIFO axes
too!
0x00000004 Write every { Emergency stop (with Only for PTP
controlled ramp) axes!
REAL64 e.g. mm/ > 0.0 Deceleration (must be
s^2 greater than or equal
to the original
deceleration)
REAL64 e.g. mm/ > 0.0 Jerk (must greater
s^3 than or equal to the
original jerk)
}
0x00000005 Write PTP axis { Parameterizable stop Only for PTP
(with controlled ramp) axes!
REAL64 e.g. mm/ > 0.0 Deceleration Reserved
s^2 function,
REAL64 e.g. mm/ > 0.0 Jerk no standard!
s^3
}
0x00000009 Write PTP axis { Oriented stop Only for PTP
(oriented end position) axes!
REAL64 e.g. ≥ 0.0 Modulo end position
degrees (modulo target
position)
REAL64 e.g. mm/ > 0.0 Deceleration (currently
s^2 not active)
REAL64 e.g. mm/ > 0.0 Jerk (not yet
s^3 implemented)
}

0x00000010 Write every VOID Reference axis


("calibration")
0x00000011 Write every { New end position axis Modified from
UINT32 ENUM s. appendix TwinCAT 3
End position type
[} 157] (see appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ New end position
(target position)
}
0x00000012 Write every { New end position and
new velocity axis
UINT32 ENUM s. appendix Command type [} 157]
(s. appendix)
UINT32 ENUM s. appendix End position type
[} 157] (see appendix)
REAL64 e.g. mm ±∞ New end position
(target position)
REAL64 e.g. mm/s ≥ 0.0 New final velocity
(requested travel
velocity)
REAL64 e.g. mm ±∞ Optional: Switchover
position from which
the new travel profile
is activated
}

88 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000015 Write every { New dynamic
parameters for active
positioning
REAL64 e.g. mm/ > 0.0 Acceleration
s^2
REAL64 e.g. mm/ > 0.0 Deceleration
s^2
REAL64 e.g. mm/ > 0.0 Optional: Jerk (not yet
s^3 implemented)
}
0x00000016 ReadWrite every SERVO Write(80 bytes) Universal Axis Start Always to SEC
(UAS): Port 501!
Merge of single
Modified from
commands, such as
TwinCAT 3
axis start, and online
changes in
combination with
"Buffer Mode" (see
TcMc2.lib)
{
UINT32 ENUM s. appendix Start type [} 156] (s.
appendix)
UINT32 1 ≥0 Bit mask for checks
and operation modes
(Default value: 0)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 e.g. mm/s ≥ 0.0 Required velocity
Vrequ
REAL64 e.g. mm/ ≥ 0.0 Optional: Acceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Optional: Deceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Optional: Jerk
s^3
UINT32 ENUM s. appendix Buffer mode [} 156]
(command buffer)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ Optional: Blending
position (command
blending position)
REAL64 e.g. mm/s ≥ 0.0 Optional: Initial
segment velocity Vi
(0 ≤ Vi ≤ Vrequ)
REAL64 e.g. mm/s ≥ 0.0 Optional: Segment
end velocity Vf
(0 ≤ Vf ≤ Vrequ)
}
Read
{
UINT16 1 ≥0 Command number
(job number)
UINT16 1 ≥0 Command status
}

TwinCAT 3 Version: 1.1.0 89


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000017 ReadWrite SERVO Write(80 bytes) "Master/slave Not yet
decoupling" and released!
"Universal axis start
(UAS)":
Merge of decoupling
command of a slave
axis (IdxOffset:
0x00000041) and the
subsequent universal
axis start (UAS)
(IdxOffset:
0x00000016)
{
UINT32 ENUM s. appendix Start type [} 156] (s.
appendix)
UINT32 1 ≥0 Bit mask for checks
and operation modes
(Default value: 0)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 e.g. mm/s ≥ 0.0 Required velocity
Vrequ
REAL64 e.g. mm/ ≥ 0.0 Acceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Deceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Jerk
s^3
UINT32 ENUM s. appendix Buffer mode [} 156]
(command buffer)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ Optional: Blending
position (command
blending position)
REAL64 e.g. mm/s ≥ 0.0 Optional: Initial
segment velocity Vi
(0 ≤ Vi ≤ Vrequ)
REAL64 e.g. mm/s ≥ 0.0 Optional: Segment
end velocity Vf
(0 ≤ Vf ≤ Vrequ)
}
Read
{
UINT16 1 ≥0 Command number
(job number)
UINT16 1 ≥0 Command status
}
0x00000018 Write every VOID Release axis lock for
motion commands
(TcMc2)
0x00000019 Write every UINT32 1 >0 Set external axis error Caution when
(runtime error) using!
0x00n0001A Write every { Set actual axis Caution when
position using!
UINT32 ENUM s. appendix Actual position type For FIFO axes
[} 157] (see appendix) too!
UINT32 Reserve (TwinCAT 3) Always to SEC
REAL64 e.g. mm ±∞ Actual position for Port 501!
axes n = 0: standard Modified from
encoder of the axis TwinCAT 3
n > 0: n-th encoder for
the axis (optional)
}

90 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00n0001B Write every UINT32 1 0/1 Set reference flag Caution when
("calibrate flag") using!
n = 0: Standard For FIFO axes
encoder for the axis too!
n > 0: n-th encoder for
the axis (optional)
0x00n0001C Write SERVO { Set only actual axis Caution when
position without using!
manipulating the set
position (also for slave
and with active
process)
UINT32 ENUM s. appendix Actual position type
[} 157] (see appendix)
REAL64 e.g. mm ±∞ Actual position for
axes n = 0: standard
encoder of the axes >
0: nth encoder of the
axis (optional)
Caution when using!
}
0x00n0001D Write every { Actual value setting of Caution when
the axis on the drive using!
side
Only for
(position interface and
CANopen!
encoder offset of zero
assumed!)
n = 0: Standard
encoder for the axis
n > 0: n-th encoder for
the axis (optional)
UINT32 ENUM s. appendix Actual position type
[} 157] (see appendix)
REAL64 e.g. mm ±∞ Actual position for axis
}
0x00n0001E Write every { Set a new encoder Caution when
scaling factor on the using!
fly (in motion of the
Always to SEC
axis)
Port 501!
UINT16 ENUM 1 Encoder scaling factor
type Modified from
TwinCAT 3
1: Absolute
2: Relative
UINT16 ControlWord
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ [1.0E-8 ... New encoder scaling
INC 100.0] factor
n = 0: Standard
encoder for the axis
n > 0: n-th encoder for
the axis (optional)
}

TwinCAT 3 Version: 1.1.0 91


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00n0001F Write every { Set actual axis Caution when
position on the fly (in using!
motion of the axis)
Always to SEC
UINT32 ENUM Position type for Port 501!
setting actual value on
the fly
1: Absolute
2: Relative
UINT32 1 Control double word,
e.g. for "clearing the
lag error"
REAL64 Reserve
REAL64 e.g. mm ±∞ New actual axis
position
UINT32 Reserve
UINT32 Reserve
}

0x00000020 Write every 1D start { Standard axis start: Modified from


UINT32 ENUM s. appendix TwinCAT 3
Start type [} 156] (s.
appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 e.g. mm/s ≥0.0 Required velocity
}
0x00000021 Write every 1D start { Extended axis start Modified from
(SERVO): TwinCAT 3
UINT32 ENUM s. appendix Start type [} 156] (s.
appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 e.g. mm/s ≥ 0.0 Required velocity
UINT32 0/1 0/1 Standard
acceleration?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Acceleration
s^2
UINT32 0/1 0/1 Standard
deceleration?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Deceleration
s^2
UINT32 0/1 0/1 Standard jerk?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Jerk
s^3
}

92 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000022 Write SERVO(MW) { Special axis start Reserved start
(SERVO): function, no
UINT32 ENUM s. appendix standard!
Start type [} 156] (s.
appendix) Modified from
UINT32 Reserve (TwinCAT 3) TwinCAT 3
REAL64 e.g. mm ±∞ End position (target
position)
REAL64 mm/s ≥ 0.0 Required start velocity
REAL64 e.g. mm ±∞ Position for a new
velocity level
REAL64 e.g. mm/s ≥ 0.0 New end velocity level
UINT32 0/1 0/1 Standard
acceleration?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Acceleration
s^2
UINT32 0/1 0/1 Standard
deceleration?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Deceleration
s^2
UINT32 0/1 0/1 Standard jerk?
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Jerk
s^3
}
0x00000023 Write SERVO { Start external setpoint Modified from
specification (setting TwinCAT 3
by cyclic axis interface
PLCtoNC)
UINT32 ENUM 1: Absolute Start type [} 156]
2: Relative
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ New end position
(target position)
optional!
REAL64 Reserve (TwinCAT 3)
}
0x00000024 Write SERVO VOID Stop/disable external
setpoint specification
(cycl. axis interface
PLCtoNC)
0x00000025 Write SERVO { Start reversing Modified from
operation for TwinCAT 3
positioning (SERVO):
UINT32 ENUM 1 Start type [} 156]
(default: 1)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ End position 1 (target
position)
REAL64 e.g. mm ±∞ End position 2 (target
position)
REAL64 0/1 0/1 Required velocity
REAL64 s ≥ 0.0 Idle time
}
0x00000026 Write every { Start drive output Modified from
UINT32 ENUM s. appendix TwinCAT 3
Output type [} 164] (s.
appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. % ±∞ Required output value
(e.g. %)
}
0x00000027 Write every VOID Stop drive output

TwinCAT 3 Version: 1.1.0 93


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000028 Write every { Change the drive
output:
UINT32 ENUM s. appendix Output type [} 164] (s.
appendix)
REAL64 e.g. % ±∞ Required output value
(e.g. %)
}
0x00000029 Write every VOID Instantaneously adopt Reserved
current override value function, no
and freeze until next standard!
override change!
0x0000002A Write every { Calculate and set Reserved
32 bytes encoder offset function, no
} standard!
0x0000002B ReadWrite every WriteData: s. Stop external setpoint Reserved
'UAS' generator and function, no
ReadData: s. continuous endless standard!
'UAS' motion ('UAS':
Universal axis start)
0x0000002C Write every UINT32 ≥0 Set "homing state" (for New from
internal use) TwinCAT 3

94 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x0000002D ReadWrite Servo Write Switches an NC- Danger during
controlled axis to use!
"Cyclic Synchronous (* see end of
Torque Mode" (CST) table)
and sets a torque
setpoint for it.
{
UINT32 Torque-axis start type:
0x3001: Absolute
0x3002: Relative
UINT32 1 (bit array) Internal control mask
(bit array):
00000000_00000001
(bit 0): Use manual
torque for initialization.
10000000_000000000
(bit 31): Update/
refresh parameter for
current command in
'ContinuousUpdate'
mode (fTorqueRamp,
fVelocityLimitHigh,
fVelocityLimitLow), do
not increase cmd no.
UINT32 0/1 0/1 Mode:
0: Default (discrete)
1: ContinuousUpdate
UINT32 ENUM see appendix Buffer mode [} 156]
only ABORTING
possible
REAL64 Nm or % [0.0 … 1.0E10] Torque target value
(signed value)
REAL64 Nm/s or %/ [0.0 … 1.0E10] Torque change
s velocity
REAL64 e.g. mm/s [0.0 ... 1.0E10] Velocity limit high
'VelocityLimitHi
gh' must be
greater than or
equal to
'VelocityLimitLo
w' (both values
can be
negative).
REAL64 e.g. mm/s [0.0 … 1.0E10] Velocity limit low
REAL64 e.g. mm/ [0.0 … 1.0E10] Acceleration
s^2
REAL64 e.g. mm/ [0.0 … 1.0E10] Deceleration
s^2
REAL64 Nm or % [0.0 … 1.0E10] Optional: Manual
torque start value
(sync value)
}
Read
{
UINT16 1 >=0 Command number
(job number)
UINT16 1 >=0 Command status
}
0x0000002E Reserved
0x0000002F Reserved

TwinCAT 3 Version: 1.1.0 95


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000030 Write SERVO { Start section Only affects
compensation older TwinCAT
(SERVO) 2 systems
UINT32 ENUM s. appendix Compensation type
[} 157] (see appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 Max. acceleration
s^2 increase
REAL64 e.g. mm/ ≥ 0.0 Max. deceleration
s^2 increase
REAL64 e.g. mm/s > 0.0 Max. increase velocity
REAL64 e.g. mm/s > 0.0 Base velocity for the
process
REAL64 e.g. mm ±∞ Path difference to be
compensated
REAL64 e.g. mm > 0.0 Path distance for
compensation
}
0x00000030 ReadWrite SERVO returns { Start section Changed from
the actually READ+WRITE: compensation
TwinCAT 2
implemented (SERVO)
211R3
parameters as Note: only contained in
return values 'TcMc2.lib' or
'Tc2_MC2.library' TwinCAT 3
UINT32 ENUM s. appendix Compensation type
[} 157] (see appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ ≥ 0.0 => Max. acceleration
s^2 increase
<= Returns the
implemented
acceleration increase
(new in 'TcMc2.lib' or
'Tc2_MC2.library')
REAL64 e.g. mm/ ≥ 0.0 => Max. deceleration
s^2 increase
<= Returns the
implemented
deceleration increase
(new in 'TcMc2.lib' or
'Tc2_MC2.library')
REAL64 e.g. mm/s > 0.0 => Requested max.
increase velocity
<= Returns the
implemented increase
velocity
REAL64 e.g. mm/s > 0.0 Base velocity for the
process
REAL64 e.g. mm ±∞ => Requested path
difference to be
compensated
<= Returns the
implemented path
difference
REAL64 e.g. mm > 0.0 => Requested max.
distance for
compensation
<= Returns
implemented distance
UINT32 1 ≥0 <= Returns Warning
ID (e.g. 0x4243)
UINT32 Reserve (TwinCAT 3)
}
0x00000031 Write SERVO VOID Stop section
compensation
(SERVO)

96 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000032 Write SERVO { Start reversing Modified from
operation with velocity TwinCAT 3
jumps (SERVO):
(can be used to
determine the velocity
step response)
UINT32 ENUM 1 Start type [} 156]
(default: 1)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/s ±∞ Required velocity 1
(negative values also
permitted)
REAL64 e.g. mm/s ±∞ Required velocity 2
(negative values also
permitted)
REAL64 s > 0.0 Travel time for velocity
1 and 2
REAL64 s ≥ 0.0 Idle time
UINT32 1 0, 1,2,3... Optional: Number of
repetitions,
Default "0": unlimited
in time
UINT32 Reserve (TwinCAT 3)
}
0x00000033 Write SERVO { Sine oscillation Modified from
sequence TwinCAT 3
- used as single sinus
oscillation (sinus
generator)
- used as sinus
oscillation sequence
(e.g. for bode plot)
UINT32 ENUM 1 Start type [} 156]
(fixed to start type 1
yet)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/s > 0.0 Base amplitude (e.g.
2.5 mm/s)
REAL64 Hz [0.0 .... 10.0] Base frequency (e.g.
1.953125 Hz)
REAL64 e.g. mm/s ≥ 0.0 Start amplitude at
begin (e.g. 0.0 mm/s)
REAL64 e.g. mm/ > 0.0 Feed constant motor
REV (per motor turn) (e.g.
10.0 mm/REV)
REAL64 Hz ≥ 1.0 Frequency range: start
frequency (e.g. 20.0
Hz)
REAL64 Hz ≤ 1/(2*dT) Frequency range: stop
frequency (e.g. 500.0
Hz)
REAL64 s > 0.0 Step duration (e.g.
2,048s)
UINT32 1 [1 ... 200] Number of
measurements (step
cycles) (e.g. 20)
UINT32 1 Number of parallel
measurements (e.g. 1)
not used yet!
}

TwinCAT 3 Version: 1.1.0 97


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000034 Write SERVO { Phasing
- Start Phasing
- Stop Phasing
UINT32 ENUM 1 PhasingType:
1: ABSOLUTE
2: RELATIVE
4096: STOP
UINT32 1 ≥0 Control Mask
Bit 0: Continuous
Update
UINT32 1 ≥0 Master axis ID
(for multi master)
UINT32 Reserve
REAL64 e.g. mm ±∞ Phase shift
REAL64 e.g. mm/s > 0.0 Velocity
REAL64 e.g. mm/ ≥ 0.0 Acceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Deceleration
s^2
REAL64 e.g. mm/ ≥ 0.0 Jerk
s^3
REAL64[4] Reserve
UINT32 Reserve
UINT32 1 ENUM Buffer mode
(NOT
IMPLEMENTED)
REAL64 e.g. mm ±∞ Blending position
(NOT
IMPLEMENTED)
}
0x00n0003B Write PTP axis VOID Triggers NC encoder Danger during
Encoder axis reinitilization to valid use!
IO values There must be
no controller
n = 0: Standard
enable (position
encoder of the axis
jump)
n > 0: n-th encoder of
The axis status
the axis (optional)
index offset
0x00n10018
can be used to
read out
whether NC
encoder
reinitilization
has been
completed.
Port 501

98 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000040 Write Master/Slave { Master/Slave coupling Extension for
(0x00n00040) coupling (SERVO): "flying saw"!
(SERVO) UINT32 ENUM s. appendix Slave type [} 158]/ Angle >0.0 and
coupling type (see £ 90.0 degrees
appendix) (parallel saw:
UINT32 1 [1...255] Axis ID of the master 90.0 degrees)
axis/group
UINT32 1 [0...8] Subindex n of the
master axis (default:
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default:
value: 0)
REAL64 1 [±1000000.0] Parameter 1: Linear:
Gear ratio
FlySawVelo: Reserve
FlySaw: Abs. synchron
position master [mm]
REAL64 1 [±1000000.0] Parameter 2:Linear:
Reserve
FlySawVelo: Reserve
FlySawPos: Abs.
synchron position
slave [mm]
REAL64 1 [±1000000.0] Parameter 3: Linear:
Reserve
FlySawVelo: Angle of
inclination in
[DEGREES]
FlySawPos: Angle of
inclination in
[DEGREES]
REAL64 1 [±1000000.0] Parameter 4:Linear:
Reserve
FlySawVelo: Gear
ratio
FlySawPos: Gear ratio
}

TwinCAT 3 Version: 1.1.0 99


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000040 Write Master/Slave { Master/Slave coupling Multi master
(0x00n00040) coupling (SERVO): coupling
(SERVO) UINT32 ENUM s. appendix (MC_GearInMul
Slave type [} 158]/
tiMaster)
coupling type (see
appendix) Version V1 and
UINT32 1 [1...255] Axis ID of the master V2
axis/group Modified from
UINT32 1 [1...8] Subindex n of the TwinCAT 3
master axis (default:
value: 0)
UINT32 1 [1...8] Subindex n of the
slave axis (default:
value: 0)
UINT32 1 [0...255] Axis ID master 2
UINT32 1 [0...255] Axis ID master 3
UINT32 1 [0...255] Axis ID master 4
UINT32 1 [0...255] Reserve (axis ID
master 5)
UINT32 1 [0...255] Reserve (axis ID
master 6)
UINT32 1 [0...255] Reserve (axis ID
master 7)
UINT32 1 [0...255] Reserve (axis ID
master 8)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm/ Maximum
s^2 acceleration/
deceleration of the
slave axis
UINT32 1 ≥0 Control mask, not
previously used
(check and operation
mode for profile)
UINT32 Reserve (TwinCAT 3)
Extension V2 (Optional):
REAL64 e.g. mm/ ≥ 0.0 Maximum deceleration
s^2 of the slave axis
REAL64 e.g. mm/ ≥ 0.0 Maximum jerk of the
s^3 slave axis
REAL64 e.g. mm/s ≥ 0.0 Maximum velocity of
the slave axis
REAL64 Reserve
REAL64 Reserve
} 64 or 104
bytes

0x00000041 Write Master/slave VOID Master/slave


decoupling decoupling (SERVO)
(SERVO)

100 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000041 Write Master/Slave { Master/slave Not yet
decoupling with decoupling with released!
configurable configurable follow-up
Modified from
follow-up function (e.g. new end
TC3
function position, new velocity,
(SERVO) stop, E-stop) (SERVO)
UINT32 ENUM s. appendix Decoupling type
[} 158] (see appendix)
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ Optional: New end
position
REAL64 e.g. mm/s > 0.0 Optional: New
requested velocity
REAL64 e.g. mm/ ≥ 0.0 Optional: Acceleration
s^2 (0: Default) for new end position,
new velocity and
emergency stop (E-
stop)
REAL64 e.g. mm/ ≥ 0.0 Optional: Deceleration
s^2 (0: Default) for new end position,
new velocity and
emergency stop (E-
stop)
REAL64 e.g. mm/ ≥ 0.0 Optional: Jerk for new
s^3 (0: Default) end position, new
velocity and
emergency stop (E-
stop)
}
0x00000042 Write Master/Slave { Change of the
coupling coupling parameters
(SERVO):
Type: LINEAR
(&SPECIAL) REAL64 1 [±1000000.0] Parameter 1: Linear:
Gear ratio
REAL64 1 [±1000000.0] Parameter 2: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 3: Linear:
Reserve
REAL64 1 [±1000000.0] Parameter 4: Linear:
Reserve
}
0x00000043 Write Master/slave { Change of the table
table coupling coupling parameters
(SERVO):
Type:
TABULAR
REAL64 mm ±∞ Slave position offset
REAL64 mm ±∞ Master position offset
}
0x00000043 Write Master/slave { Change of the table Also for "Motion
table coupling coupling parameters Function"
(SERVO):
Type:
TABULAR REAL64 mm ±∞ Slave position offset
and REAL64 mm ±∞ Master position offset
"Motion
REAL64 1 ±∞ (<> 0.0) Slave position scaling
Function"
REAL64 1 ±∞ (<> 0.0) Master position scaling
}

TwinCAT 3 Version: 1.1.0 101


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000043 Write Master/slave { Change of the table
table coupling coupling parameters
(SERVO):
Type:
TABULAR REAL64 mm ±∞ Slave position offset
REAL64 mm ±∞ Master position offset
REAL64 1 ±∞ (<> 0.0) Slave position scaling
REAL64 1 ±∞ (<> 0.0) Master position scaling
REAL64 e.g. mm ±∞ Absolute master
activation position
}
0x00000044 Write Slave-Stop VOID Stop the "flying saw" Only for "flying
(SERVO) (SERVO) saw"
0x00000045 Write Master/slave { Master/slave table
(0x00n00045) table coupling coupling (SERVO):
(SERVO) UINT32 ENUM s. appendix Slave type/coupling
type [} 158] (see
appendix)
UINT32 1 [1...255] Axis ID of the master
axis
UINT32 1 [0...8] Subindex n of the
master axis (default:
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default
value: 0)
SOLO TABLE
SECTION
REAL64 mm ±∞ Slave position offset
(type: TABULAR)
REAL64 mm ±∞ Master position offset
(type: TABULAR)
UINT32 1 [0,1] Slave positions
absolute (type:
TABULAR)
UINT32 1 [0,1] Master positions
absolute (type:
TABULAR)
UINT32 1 [1...255] Table ID of the
coupling table (type:
TABULAR)
MULTI TABLE
SECTION
UINT16 1 [0...8] Number of tables
(type: MULTITAB)
Note: Misused as
interpolation type for
solo tables
UNIT16 1 [0...8] Number of profile
tables (type:
MULTITAB)
UNIT32[8] 1 [1...255] Tables IDs of the
coupling tables (type:
MULTITAB)
}
0x00000046 Write Master/slave UINT32 1 [1...255] Correction table
multi-tables activation, correction
table ID
0x00000046 Write Master/slave { Activation of correction Modified from
multi-tables table TwinCAT 3
UINT32 1 [1...255] Correction table ID
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ Absolute master
activation position
}

102 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000047 Write Master/slave UINT32 1 [1..255] Deactivation of profile
multi-tables table at the end of the
cycle, table ID of the
current monocyclic
profile table
0x00000048 ReadWrite Master/slave Write: UINT32 1 [1..255] Reading the last
multi-tables correction offset: Table
ID of the correction
table
Read: REAL32 e.g. mm ±∞ Offset by departing the
correction table with
the according table ID
0x00000049 Write Master/slave REAL64 1 ±∞ Change the slave
table coupling table scaling factor for
the slave table column
Type:
(Default value: 1.0)
TABULAR

TwinCAT 3 Version: 1.1.0 103


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x0000004A(0x Write Master/Slave { Master/Slave Solo Modified from
00n0004A) Universal Table Table Coupling TwinCAT 3
Coupling (SERVO):
(SERVO) UINT32 ENUM s. appendix Slave type/coupling
type [} 158] (see
appendix)
UINT32 1 [1...255] Axis ID of the master
axis
UINT32 1 [0...8] Subindex n of the
master axis (default:
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default:
value: 0)
UINT32 1 1...255] Table ID of the
coupling table (type:
TABULAR)
UINT32 1 Table interpolation
type
REAL64 mm ±∞ Slave position offset
(type: TABULAR)
REAL64 mm ±∞ Master position offset
(type: TABULAR)
REAL64 mm ±∞ Slave position scaling
(type: TABULAR)
REAL64 mm ±∞ Master position scaling
(type: TABULAR)
UINT32 1 [0,1] Slave position
absolute ?
(Type: TABULAR)
UINT32 1 [0,1] Master positions
absolute ?
(Type: TABULAR)
UINT32 ENUM s. appendix Activation type of the
change:
0: 'instantaneous'
(default)
1: 'at master cam
position'
2: 'at master axis
position'
3: 'next cycle'
UINT32 Reserve (TwinCAT 3)
REAL64 mm ±∞ Activation position
UINT32 ENUM s. appendix Master scaling type:
0: user defined
(default)
1: scaling with auto
offset
2: off
UINT32 ENUM s. appendix Slave scaling type:
0: user defined
(default)
1: scaling with auto
offset
2: off
}

104 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x0000004A(0x Write Master/Slave { Master/Slave Solo Modified from
00n0004A) Universal Table Table Coupling TwinCAT 3
Coupling (SERVO):
(SERVO) UINT32 ENUM s. appendix Slave type/coupling
type [} 158] (see
appendix)
UINT32 1 [1...255] Axis ID of the master
axis
UINT32 1 [0...8] Subindex n of the
master axis (default:
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default:
value: 0)
UINT32 1 1...255] Table ID of the
coupling table (type:
TABULAR)
UINT32 1 Table interpolation
type
REAL64 mm ±∞ Slave position offset
(type: TABULAR)
REAL64 mm ±∞ Master position offset
(type: TABULAR)
REAL64 mm ±∞ Slave position scaling
(type: TABULAR)
REAL64 mm ±∞ Master position scaling
(type: TABULAR)
UINT32 1 [0,1] Slave position
absolute ? (Type:
TABULAR)
UINT32 1 [0,1] Master positions
absolute ? (Type:
TABULAR)
UINT32 ENUM s. appendix Activation type of the
change:
0: 'instantaneous'
(default)
1: 'at master cam
position'
2: 'at master axis
position'
3: 'next cycle'
UINT32 Reserve (TwinCAT 3)
REAL64 mm ±∞ Activation position
UINT32 ENUM s. appendix Master scaling type:
0: user defined
(default)
1: scaling with auto
offset
2: off
UINT32 ENUM s. appendix Slave scaling type:
0: user defined
(default)
1: scaling with auto
offset
2: off
Extension for MultiCam:
UINT32 ENUM s. appendix Cam Operation Mode
UINT32 1 [1…255] Reference table ID
BYTE[104] Reserve (TwinCAT 3)
}

TwinCAT 3 Version: 1.1.0 105


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x0000004B(0x Write Master/slave { Master/slave Modified from
00n0004B) universal flying synchronization TwinCAT 3
saw (SERVO) coupling (SERVO):
UINT32 ENUM s. appendix Slave type/coupling
type (see appendix)
UINT32 1 [1...255] Axis ID of the master
axis
UINT32 1 [0...8] Subindex n of the
master axis (default:
value: 0)
UINT32 1 [0...8] Subindex n of the
slave axis (default:
value: 0)
REAL64 1 ±∞ (<> 0.0) Gear ratio
REAL64 mm ±∞ Master synchron
position
REAL64 mm ±∞ Slave synchron
position
REAL64 mm/s ≥ 0.0 Slave velocity
(optional)
REAL64 mm/s^2 ≥ 0.0 Slave acceleration
(optional)
REAL64 mm/s^2 ≥ 0.0 Slave deceleration
(optional)
REAL64 mm/s^3 ≥ 0.0 Slave jerk (optional)
UINT32 1 ≥0 Bit mask (default
value: 0)
UINT32 Reserve (TwinCAT 3)
}

106 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x0000004D(0x Write Master/slave { Change in table Modified from
00n0004D) table coupling scaling (SERVO): TwinCAT 3
Type: UINT32 ENUM s. appendix Activation type of the
TABULAR change
and MF 0: 'instantaneous'
(default)
1: 'at master cam
position'
2: 'at master axis
position'
3: 'next cycle'
UINT32 Reserve (TwinCAT 3)
REAL64 e.g. mm ±∞ Activation position
UINT32 ENUM s. appendix Master scaling type
0: user defined
(default)
1: scaling with auto
offset
2: off
UINT32 ENUM s. appendix Slave scaling type
0: user defined
(default)
1: scaling with auto
offset
2: off
REAL64 e.g. mm ±∞ Master position offset
REAL64 e.g. mm ±∞ Slave position offset
REAL64 1 ±∞ (<> 0.0) Master position scaling
REAL64 1 ±∞ Slave position scaling
Optional extension for MultiCam:
UINT32 1 ≥0 Cam Table ID
UINT32 Reserve (TwinCAT 3)
}

0x00000050 Write every VOID Deactivate complete


axis (disable)
0x00000051 Write every VOID Activate complete axis
(enable)
0x00000052 Write SERVO { Change of the active Modified from
axis control loop (triple TwinCAT 3
from encoder,
controller and axis
interfaces) with/without
external setpoint
specification:
UINT32 1 ≥0 Number/index of the
axis control loop
(Default value: 0)
UINT32 ENUM s. appendix Switching type for
(>0) synchronization
behavior [} 168]
1: 'Standard'
REAL64 1 ±∞ Synchronization value
for switching (optional)
UINT32 0/ 1 0/1 External setpoint
specification by means
of axis interface ?
Note: Not used so far!
UINT32 Reserve (TwinCAT 3)
}

TwinCAT 3 Version: 1.1.0 107


Target systems

Index offset Access Axis type Data type Phys. unit Definition Description Note
(Hex) range
0x00000060 Write every VOID Deactivate drive
output (disable)
0x00000061 Write every VOID Activate drive output
(enable)
0x00000062 Write high/low UINT16 1 0/1 Release parking
brake?
0: automatic activation
(default)
1: mandatorily always
released
Note:
Reset to '0' when
resetting the axis!
0x00000063 Write only for { Activate "Drive NEW from TC
SERCOS/SoE Operation Mode" (e.g. 3.1 B4022 (NC
and CANopen/ Position Velo, Torque, 4443)
CoE etc.)
Always to SEC
INT32 ENUM [0; 1, 2, 3, …] New "Drive Operation Port 501!
[} 165] Mode" (generic
Special cases:
(see modes)
appendix) ≥ 100: SoE
< 0: CoE
UINT32 1 0 Reserve
UINT32 1 0 Reserve
UINT32 1 0 Reserve
}

0x00000070 Write every VOID Return of the axis


from, e.g. a 3D group
to its own PTP group

* The following warning relates to index offset 0x0000002D:

DANGER
Danger to life or risk of serious injury or damage to property due to unintentional
movements of the axis
When using the function block, the axis is switched to CST mode. After using the function block (especially
after error situations), the axis may still be in CST mode. This can lead to sudden and unplanned
movements (especially with lifting axes) when the axis is released.
• Ensure that there is no hazard as defined by the risk assessment.
• Check the current operation mode via the function block MC_ReadDriveOperationMode.
• If the axis is not in a position-related operation mode (CSV/CSP), transfer it before an enable:
– directly with MC_WriteDriveOperationMode into the desired position-related operation mode (CSV/
CSP) or
– indirectly with MC_Halt / MC_Stop into the desired position-related operation mode (CSV/CSP) (from
TwinCAT 3.1.4024.40)
Other function blocks that switch the axis indirectly into a position-related operation mode can only do
this to a limited extent and are therefore not to be used for a deliberate operation mode change.
ð Subsequently, it is necessary to check again whether the axis is really in a position-related operation
mode (CSV/CSP), if not, an abort with error handling is required.

108 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.4.4 "Index offset" specification for cyclic axis process data (Index
group 0x4300 + ID)

TwinCAT 3 Version: 1.1.0 109


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
( Hex ) unit range
0x00n00000 Read/Write every { 128 bytes} STRUCT see AXIS STRUCTURE Write command
(PLC→NC) axis interface (PLC→NC) only optional!
n = 0: standard axis Consider safety
interface aspects!
n > 0: n-th axis PLCTONC_AXI
interface (optional) S_REF
0x00n00001 Read/Write every UINT32 1 >0 Control double word Write command
(PLC→NC) only optional!
Symbolic
access
possible!
"ControlDWord"
0x00n00002 Read/Write every UINT16 1 0/1 Controller enable Cannot be
(PLC→NC) traced by
oscilloscope!
0x00n00003 Read/Write every UINT16 1 0/1 Feed enable plus Cannot be
(PLC→NC) traced by
oscilloscope!
0x00n00004 Read/Write every UINT16 1 0/1 Feed enable minus Cannot be
(PLC→NC) traced by
oscilloscope!
0x00n00007 Read/Write every UINT16 1 0/1 Referencing cam Cannot be
(PLC→NC) traced by
oscilloscope!

0x00n00021 Read/Write every UINT32 % 0...1000000 Velocity override Write command


(PLC→NC) (1000000 == 100%) only optional!
Symbolic
access
possible!
"OverrideV"
0x00n00022 Read/Write every UINT32 1 ENUM Operation mode axis Write command
(PLC→NC) only optional!
0x00n00025 Read/Write every REAL64 e.g. mm Actual position Write command
(PLC→NC) correction value only optional!
(measurement system
error correction)

0x00n00026 Read/Write every REAL64 e.g. mm/ External controller Write command
(PLC→NC) s component (position only optional!
controller component)

0x00n00027 Read/Write every { External setpoint Write command


(PLC→NC) generation only optional!
REAL64 e.g. mm ±∞ External set position
REAL64 e.g. mm/ ±∞ External set velocity Modified from
s TC3
REAL64 e.g. mm/ ±∞ External set
s^2 acceleration
INT32 1 +1, 0, -1 External set travel
direction
UINT32 Reserve (TC3)
REAL64 Reserve (TC3)
}

0x00n00080 Read every { 256 bytes} STRUCT see AXIS STRUCTURE Changed from
(PLC→NC) axis interface (NC→PLC) TC3.NCTOPLC
_AXIS_REF
Note: size and
alignment changed
n = 0: standard axis
interface
n > 0: n-th axis
interface (optional)

110 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
( Hex ) unit range
0x00n00071 Read every UINT8 1 >0 State double word:
(PLC→NC) byte 1
0x00n00072 Read every UINT8 1 >0 State double word:
(PLC→NC) byte 2
0x00n00073 Read every UINT8 1 >0 State double word:
(PLC→NC) byte 3
0x00n00074 Read every UINT8 1 >0 State double word:
(PLC→NC) byte 4
0x00n00081 Read every UINT32 1 >0 State double word Symbolic
(PLC→NC) (complete) access
possible!
"StateDWord"
0x00n00082 Read every UINT16 1 0/1 Axis is ready for Cannot be
(PLC→NC) operation traced by
oscilloscope!
0x00n00083 Read every UINT16 1 0/1 Axis has been Cannot be
(PLC→NC) referenced traced by
oscilloscope!
0x00n00084 Read every UINT16 1 0/1 Axis in protected Cannot be
(PLC→NC) operation mode (e.g. traced by
slave axis) oscilloscope!
0x00n00085 Read every UINT16 1 0/1 Axis is in rapid mode Cannot be
(PLC→NC) traced by
oscilloscope!
0x00n00088 Read every UINT16 1 0/1 Axis has invalid I/O Cannot be
(PLC→NC) data traced by
oscilloscope!
0x00n00089 Read every UINT16 1 0/1 Axis is in an error state Cannot be
(PLC→NC) traced by
oscilloscope!
0x00n0008A Read every UINT16 1 0/1 Axis moving to larger Cannot be
(PLC→NC) values traced by
oscilloscope!
0x00n0008B Read every UINT16 1 0/1 Axis moving to smaller Cannot be
(PLC→NC) values traced by
oscilloscope!
0x00n0008C Read every UINT16 1 0/1 Axis is at a logical Cannot be
(PLC→NC) standstill traced by
(only setpoints are oscilloscope!
considered)
(position controller?)
0x00n0008D Read every UINT16 1 0/1 Axis is being Cannot be
(PLC→NC) referenced traced by
oscilloscope!
0x00n0008E Read every UINT16 1 0/1 Axis is in position Cannot be
(PLC→NC) window traced by
oscilloscope!
0x00n0008F Read every UINT16 1 0/1 Axis is at target Cannot be
(PLC→NC) position (target traced by
position reached) oscilloscope!

0x00n00090 Read every UINT16 1 0/1 Axis has constant Cannot be


(PLC→NC) velocity or rotary traced by
speed oscilloscope!
0x00n0009A Read every UINT16 1 0/1 Operation mode not Cannot be
(PLC→NC) executed (busy) traced by
oscilloscope!
0x00n0009B Read every UINT16 1 0/1 Axis has instructions, Cannot be
(PLC→NC) is carrying instructions traced by
out oscilloscope!

0x00n000B1 Read every UINT32 1 ≥0 Axis error code


(PLC→NC)
0x00n000B2 Read every UINT32 1 ENUM Motion state of the Symbolic
(PLC→NC) axis (master state access
[} 165] / slave state possible!
[} 165]) "AxisState"

TwinCAT 3 Version: 1.1.0 111


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
( Hex ) unit range
0x00n000B3 Read every UINT32 1 ENUM Operation mode of the
(PLC→NC) axis (rev. NC)
0x00n000B4 Read every UINT32 1 ENUM Axis referencing status Symbolic
(PLC→NC) access
possible!
"HomingState"
0x00n000B5 Read every UINT32 1 ENUM Axis coupling state Symbolic
(PLC→NC) access
possible!
"CoupleState"
0x00n000B6 Read every UINT32 1 ≥0 SVB entries/tasks of
(PLC→NC) the axis (PRE table)
0x00n000B7 Read every UINT32 1 ≥0 SAF entries/tasks of
(PLC→NC) the axis (EXE table)
0x00n000B8 Read every UINT32 1 ≥0 Axis ID
(PLC→NC)
0x00n000B9 Read every UINT32 1 ≥0 Operation modes state
(PLC→NC) double word:Bit 0:
Position range
monitoring active?
Bit 1: target position
window monitoring
active?
Bit 2: looping distance
active?
Bit 3: physical motion
monitoring active?
Bit 4: PEH time
monitoring active?
Bit 5: backlash
compensation active?
Bit 6: delayed error
reaction mode active?
Bit 7: modulo
operation mode active
(modulo axis)?
Bit 16: following error
monitoring position
active?
Bit 17: following error
monitoring vel. active?
Bit 18: end position
monitoring min.
active?
Bit 19: end position
monitoring max.
active?
Bit 20: actual position
correction active?
0x00n000BA Read every REAL64 e.g. mm Actual position
(PLC→NC) (calculated absolute
value)
0x00n000BB Read every REAL64 e.g. mm Modulo actual position
(PLC→NC)
0x00n000BC Read every INT32 1 Modulo rotations
(PLC→NC)
0x00n000BD Read every REAL64 e.g. mm/ Actual velocity
(PLC→NC) s (optional)
0x00n000BE Read every REAL64 e.g. mm Following error
(PLC→NC) position
0x00n000BF Read every REAL64 e.g. mm Set position
(PLC→NC)
0x00n000C0 Read every REAL64 e.g. mm/ Set velocity
(PLC→NC) s

112 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Axis type Data type Phys. Definition Description Note
( Hex ) unit range
0x00n000C1 Read every REAL64 e.g. mm/ Set acceleration
(PLC→NC) s^2

0x00n10000 Read/Write Encoder: every { 40 bytes STRUCT see ENCODER OUTPUT Write command
(NC→IO) } encoder IO STRUCTURE only optional!
interface (NC→IO, 40 Consider safety
bytes)NCENCODERS aspects!
TRUCT_OUT2
0x00n10080 Read Encoder: every { 40 bytes STRUCT see ENCODER-INPUT-
(IO→NC) } encoder IO STRUCTURE
interface (IO→NC, 40
bytes)NCENCODERS
TRUCT_IN2

0x00n30000 Read/Write Drive: every { 40 bytes STRUCT see DRIVE-OUTPUT- Write command
(NC→IO) } drive IO STRUCTURE only optional!
interface (NC→IO, 40 Consider safety
bytes)NCDRIVESTRU aspects!
CT_OUT2
0x00n30080 Read Drive: every { 40 bytes STRUCT see DRIVE-INPUT-
(IO→NC) } drive IO STRUCTURE
interface (NC→IO, 40
bytes)NCDRIVESTRU
CT_IN2

TwinCAT 3 Version: 1.1.0 113


Target systems

3.1.1.5.4.5 Specification Encoder

3.1.1.5.4.5.1 "Index offset" specification for encoder parameter (Index group


0x5000 + ID)

114 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000001 Read every UINT32 1 [1 ... 255] Encoder ID
0x00000002 Read every UINT8[30+1] 1 30 characters Encoder name
0x00000003 Read every UINT32 1 s. ENUM (>0) Encoder type [} 160]
0x00000004 Read/Write every UINT32 1 Byteoffset Input address offset change I/O
(IO-Input-Image) address
0x00000005 Read/Write every UINT32 1 Byteoffset Output address offset change I/O
(IO-Output-Image) address
0x00000006 Read/Write every REAL64 e.g. mm/ [1.0E-12 ... resulting scaling factor Writing is not
INC 1.0E+30] (numerator / allowed if the
denominator) controller
enable has
Note: from TC3 the
been issued.
scaling factor consists
of two components –
numerator and
denominator (default:
1.0).
0x00000007 Read/Write every REAL64 e.g. mm [±1.0E+9] Position offset Writing is not
allowed if the
controller
enable has
been issued.
0x00000008 Read/Write every UINT16 1 [0,1] encoder count Writing is not
direction allowed if the
controller
enable has
been issued.
0x00000009 Read/Write every REAL64 e.g. mm [0.001 ... modulo factor
1.0E+9]
0x0000000A Read/Write every UINT32 1 s. ENUM (>0) Encoder mode [} 161]
in the appendix
0x0000000B Read/Write every UINT16 1 0/1 soft end min.
monitoring?
0x0000000C Read/Write every UINT16 1 0/1 soft end max.
monitoring?
0x0000000D Read/Write every REAL64 mm Soft end position min.
0x0000000E Read/Write every REAL64 mm Soft end position max.
0x0000000F Read/Write every UINT32 1 s. ENUM (≥0) Encoder evaluation
in the appendix direction [} 161]
(enable for log.
counting direction)
0x00000010 Read/Write every REAL64 s [0.0...60.0] Filter time for actual
position value in
seconds (P-T1)
0x00000011 Read/Write every REAL64 s [0.0...60.0] Filter time for actual
velocity value in
seconds (P-T1)
0x00000012 Read/Write every REAL64 s [0.0...60.0] filter time for actual
acceleration value in
seconds (P-T1)
0x00000013 Read/Write every UINT8[10+1] 1 physical unit Not
implemented!
0x00000014 Read/Write every UINT32 1 interpretation of the Not
units (position, implemented!
velocity, time)
bit array
Bit 0: velocity in x/min
instead of x/s
Bit 1: position in
thousandths of the
base unit

TwinCAT 3 Version: 1.1.0 115


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000015 Read/Write every UINT32 INC [0x0... Encoder mask Axis has to be
0xFFFFFFFF] (maximum value of the disabled for
encoder actual value write access.
in increments)
see also
Note: The encoder "Encoder Sub
mask may be any Mask"
numerical value (e.g. parameter
3600000). Unlike in
the past, it no longer
has to correspond to a
continuous series off
binary one's (2n-1).
0x00000016 Read/Write every UINT16 1 0/1 Actual position
correction
(measurement system
error correction)?
0x00000017 Read/Write every REAL64 s [0.0...60.0] Filter time for actual
position correction in
seconds (P-T1)
0x00000018 Read/Write every UINT32 1 [0x0... Filter mask for raw
0xFFFFFFFF] incremental value
(0x0: full pass)
0x00000019 Read/Write every UINT32 1 s. ENUM (≥0) Encoder absolute Writing is not
in the appendix dimensioning system allowed if the
controller
[} 161]
enable has
been issued.
0x0000001A Read/Write every UINT32 1 s. ENUM (≥0) Encoder position Not
initialization implemented!
0x0000001B Read/Write every REAL64 e.g. mm [≥0, modulo Tolerance window for
factor/2] modulo-start
0x0000001C Read every UINT32 1 s. ENUM (≥0) Encoder sign
interpretation [} 161]
(data type)
0x0000001D Read every UINT16 1 0/1 Incremental or
absolute encoder ?
0: incremental encoder
type
1: absolute encoder
type
0x00000020 Read/Write every UINT32 1 s. ENUM (≥0) Encoder dead time
compensation mode
0: off (Default)
1: on (with velocity)
2: on (with velocity and
acceleration)
0x00000021 Read/Write every UINT32 1 Control double word
(32 bits) for the
encoder dead time
compensation:
Bit 0 = 0: relative I/O
times (default)
Bit 0 = 1: absolute I/O
times
0x00000022 Read/Write every INT32 ns [±1.0E+9] Sum of the
parameterized time
shifts for the encoder
dead time
compensation
(typically positive
numerical values)
0x00000023 Read/Write every REAL64 e.g. mm/ [1.0E-12 ... Component of the NEW from TC3
INC 1.0E+30] scaling factor:
Writing is not
numerator
allowed if the
(=> scaling factor controller
numerator / scaling enable has
factor denominator) been issued.

116 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000024 Read/Write every REAL64 1 [1.0E-12 ... Component of the NEW from TC3
1.0E+30] scaling factor:
Writing is not
denominator
allowed if the
(=> scaling factor controller
numerator / scaling enable has
factor denominator) been issued.
Default: 1.0
0x00000025 Read/Write every { e.g. mm/ [1.0E-12 ... Component of the NEW from TC3
REAL64 INC 1.0E+30] scaling factor:
REAL64 1 [1.0E-12 ... numerator
} 16 bytes 1.0E+30]
Component of the
scaling factor:
denominator
(=> scaling factor
numerator / scaling
factor denominator)
0x00000030 Read/Write every UINT32 1 Internal encoder NEW from TC3
control double word for
specifying the
operation modes and
properties

0x00000101 Read/Write INC UINT16 1 [0,1] inverse search


direction for ref.cam?
0x00000102 Read/Write INC 1 [0,1] inverse search
direction for sync
pulse?
0x00000103 Read/Write INC REAL64 e.g. mm [±1.0E+9] Reference position
0x00000104 Read/Write INC UINT16 1 [0,1] distance monitoring Not
between Ref. cams implemented!
and sync pulse active?
0x00000105 Read/Write INC UINT32 INC [0 ...65536] minimum distance Not
between Ref. cams implemented!
and sync pulse in
increments
0x00000106 Read/Write INC UINT16 1 [0,1] external sync pulse?
0x00000107 Read/Write INC UINT32 1 s. ENUM (>0) Referencing mode
(Sync Condition)
[} 162]
0x00000108 Read/Write INC UINT32 1 [0x0000000F... Encoder Sub Mask NEW
0xFFFFFFFF]bi (maximum value of the see also param.
nary mask: (2n - absolute range of the "Encoder Mask"
1) encoder actual value
in increments)
Used, for example, as
a reference mark for
the referencing mode
"Software Sync" and
for the NC Retain Data
"ABSOLUTE
(MODULO)",
"INCREMENTAL
(SINGLETURN
ABSOLUTE)".
Note 1: The Encoder
Sub Mask must be
smaller than or equal
to the Encoder Mask.
Note 2: The Encoder
Mask must be an
integer multiple of the
Encoder Sub Mask.
Note 3: The Encoder
Sub Mask must be a
continuous sequence
of binary ones (2n-1),
e.g. 0x000FFFFF.

TwinCAT 3 Version: 1.1.0 117


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000109 Read/Write INC UINT32 1 s. ENUM (≥0) Homing Sensor Source
[} 162]
Sets the source of the
digital input of the
referencing cam.
0x00000110 Read/Write INC (encoder REAL64 1 [0.0 ... scaling/weight of the
simulation) 1000000.0] noise part for the
simulation encoder

118 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.5.2 "Index offset" specification for encoder state (Index group 0x5100 +
ID)

TwinCAT 3 Version: 1.1.0 119


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
(Hex) unit range
0x00000001 Read every INT32 Error state encoder
0x00000002 Read every REAL64 Actual position (charge Symbolic
with actual position access
compensation value) possible!
'ActPos'
0x00000003 Read every REAL64 Modulo actual position Symbolic
access
possible!
'ActPosModulo'
0x00000004 Read every INT32 Modulo actual rotation
0x00000005 Read every REAL64 Optional: Actual Base unit / s
velocity Symbolic
access
possible!
'ActVelo‘
0x00000006 Read every REAL64 Optional: Actual Base unit / s^2
acceleration Symbolic
access
possible!
'ActAcc‘
0x00000007 Read every INT32 Encoder actual
increments
0x00000008 Read every INT64 Software - actual
increment counter
0x00000009 Read/Write every UINT16 Reference flag
("calibrate flag")
0x0000000A Read every REAL64 Actual position
correction value
(measuring system
error correction)
0x0000000B Read every REAL64 Actual position without
actual position
compensation value
0x0000000C Read every REAL64 e.g. mm Actual position
compensation value
due to the dead time
compensation
0x0000000D Read every REAL64 s Sum of time shift for
encoder dead time
compensation
(parameterized and
variable dead
time)Note: A dead
time is specified in the
system as a positive
value.
0x0000000E Read every REAL64 e.g. mm Internal position offset
as a correction value
for a value reduction to
the base period
(modulo range)
0x00000010 Read every REAL64 e.g. mm/ Actual velocity without
s actual position
compensation value
0x00000012 Read every REAL64 e.g. mm Unfiltered actual
position (charge with
actual position
compensation value)
0x00000013 Read every REAL64 e.g. mm Filtered actual position
(offset with actual
position correction
value, without dead
time compensation)
0x00000014 Read Type: SoE, REAL64 e.g. mm/ Optional: actual drive Base Unit / s
CoE, MDP 742 s velocity (transferred
NEW from
directly from SoE, CoE
TC3.1
or MDP 742 drive)
B4020.30
0x00000015 Read every REAL64 e.g. mm/ Optional: Unfiltered Base Unit / s
s actual velocity

120 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
(Hex) unit range
0x00000016 Read every READ(16 bytes Read the actual
* N) position buffer
{
UINT32 ns ≥0 DcTimeStamp with 32
bits
UINT32 Reserve
REAL64 e.g. mm ±∞ Actual position for the
associated timestamp
} [N]
0x00000017 Read REAL64 e.g. mm Reading out the
MC_SetPosition offset

0x00000101 Read INC REAL64 e.g. mm Read back the position Cannot be
difference between the traced by
hardware latch being oscilloscope!
activated and
becoming valid

0x00000200 Read Write Function WRITE(24 Read "Touch Probe" Only for SAF-
group bytes) state (state of external port 501
"TouchProbeV latch)
2": - SERCOS/ {
SoE
UINT32 1 [1,2,3,4] Probe unit (probe 1, 2,
- EtherCAT/ 3, 4)
CoE
UINT32[5] Reserved
(CANopen
DS402) }
- SoftDrive READ(64
(TCom), bytes)
- MDP 511
{
(EL5101,
EL5151, UINT32 1 [0/1] Touch probe rising
EL5021, edge active?
EL7041, UINT32 1 [0/1] Touch probe rising
EL7342) edge became valid?
REAL64 e.g. mm Touch probe rising
edge position value
UINT32 1 ≥0 Touch probe rising
edge counter
(continuous mode)
UINT32 Reserved
UINT32 1 [0/1] Touch probe falling
edge active?
UINT32 1 [0/1] Touch probe falling
edge became valid?
REAL64 e.g. mm Touch probe falling
edge position value
UINT32 1 ≥0 Touch probe falling
edge counter
(continuous mode)
UINT32[5] Reserved
}
0x00000201 Read KL5101, UINT16 1 [0,1] "External latch Cannot be
SERCOS, function" active? traced by
AX2xxx, or oscilloscope!
ProviDrive
"Touch probe function"
active ? (edge-
independent)
0x00000201 Read CANopen UINT32[4] 1 [0,1] "External latch Cannot be
functions 1 to 4" traced by
active? oscilloscope!
or
"Touch probe
functions 1 to 4"
active?

TwinCAT 3 Version: 1.1.0 121


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
(Hex) unit range
0x00000202 Read KL5101, UINT16 1 [0,1] External latch value see also Axis
SERCOS, became valid? interface
AX2xxx, NcToPlc (state
or
ProviDrive double word)
touch probe latched?
(edge-independent)
0x00000202 Read CANopen UINT32[4] 1 [0,1] External latch values 1 see also Axis
to 4 became valid? interface
NcToPlc (state
or
double word)
touch probes 1 to 4
latched?
0x00000203 Read KL5101, UINT32 INC External / touch probe
SERCOS, hardware incremental
AX2xxx, latch value
ProviDrive
0x00000204 Read KL5101, UINT64 INC External / touch probe
SERCOS, Software incremental
AX2xxx, latch value
ProviDrive
0x00000205 Read KL5101, REAL64 e.g. mm External / touch probe Base Unit
SERCOS, position latch value
AX2xxx,
ProviDrive
0x00000205 Read CANopen REAL64[4] e.g. mm External touch probe Base Unit
values / position latch
values
0x00000206 Read KL5101, UINT32 INC Difference hardware Cannot be
SERCOS, incremental latch traced by
AX2xxx, values (NewLatch - oscilloscope!
ProviDrive LastLatch)
0x00000207 Read KL5101, UINT64 INC Difference software Cannot be
SERCOS, incremental latch traced by
AX2xxx, values (NewLatch - oscilloscope!
ProviDrive LastLatch)
0x00000208 Read KL5101, REAL64 e.g. mm Difference position Cannot be
SERCOS, latch values traced by
AX2xxx, (NewLatch - oscilloscope!
ProviDrive LastLatch) Base Unit

0x00000210 Read KL5101, UINT16 1 [0,1] "External latch Cannot be


AX2xxx, function" for rising traced by
ProviDrive edge active? oscilloscope!
or
"Touch probe function"
for rising edge active?
0x00000210 Read CANopen UINT16[4] 1 [0,1] "External latch Cannot be
function" for rising traced by
edge active? oscilloscope!
or
"Touch probe function"
for rising edge active?
0x00000211 Read KL5101, UINT16 1 [0,1] "External latch Cannot be
AX2xxx, function" for falling traced by
ProviDrive edge active? oscilloscope!
or
"Touch probe function"
for falling edge active?
0x00000211 Read CANopen UINT16[4] 1 [0,1] "External latch Cannot be
function" for falling traced by
edge active? oscilloscope!
or
"Touch probe function"
for falling edge active?

122 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Note
(Hex) unit range
0x00000212 Read CANopen UINT16 1 [0,1] Status of "Touch Cannot be
Probe 1" input signal traced by
oscilloscope!
From TC3.1
B4024.11
0x00000213 Read CANopen UINT16 1 [0,1] Status of "Touch Cannot be
Probe 2" input signal traced by
oscilloscope!
From TC3.1
B4024.11

TwinCAT 3 Version: 1.1.0 123


Target systems

3.1.1.5.4.5.3 "Index offset" specification for encoder functions (Index group


0x5200 + ID)

124 Version: 1.1.0 TwinCAT 3


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x0000001A Write every { Set actual position Base Unit
encoder/axis
UINT32 ENUM s. appendix Actual position type
[} 157] (s. appendix)
REAL64 mm ±∞ Actual position for
encoder/axis
Caution when using!
}
0x0000001B Write every VOID Re-initialization of the NEW from TC3
actual encoder
position
Note: Takes effect for
reference system
„ABSOLUTE
MULTITURN RANGE
(with single overflow)“
and „ABSOLUTE
SINGLETURN
RANGE (with single
overflow)“.

0x00000200 Write Function group { Activate "Touch Only for SAF-


"TouchProbeV2 Probe" (external latch) port 501
": UINT32 1 [1,2,3,4] Probe unit (probe 1, 2,
- SERCOS/ 3, 4)
SoE, UINT32 1 [0,1] Signal edge (0=rising
- EtherCAT/ edge, 1=falling edge)
CoE (CANopen
UINT32 1 [1,2] Probe mode (1=single,
DS402)
2=continuous, ...)
- SoftDrive
(TCom), UINT32 1 [1,2,3,4; Signal source (1=input
- MDP 511 128,129] 1, 2=input 2, ...)
(EL5101, UINT32 Reserved
EL5151,
UINT32 Reserved
EL5021,
EL7041, } 24 bytes
EL7342)
0x00000201 Write KL5101,SERC VOID Activate "External
OS,AX2xxx,PR Latch" or activate
OFIDrive "measuring probe
function" (typically
rising edge)
0x00000201 Write CANopen UINT32[4] Activate "External
Latch" 1 to 4 or
activate "measuring
probe function" 1 to 4
(typically rising edge)
0x00000202 Write KL5101,SERC VOID Activate "external
OSAX2xxx,PR latch" or activate
OFIDrive "measuring probe
function" (falling edge)
0x00000202 Write CANopen UINT32[4] Activate "external
latch" 1 to 4 or activate
"measuring probe
function" 1 to 4 (falling
edge)

TwinCAT 3 Version: 1.1.0 125


Target systems

Index-Offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000205 Write Function group { Deactivate "touch Only for SAF-
"TouchProbeV2 probe" (external latch) port 501
": UINT32 1 [1,2,3,4] Probe unit (probe 1, 2,
- SERCOS/ 3, 4)
SoE, UINT32 1 [0,1] Signal edge (0=rising
- EtherCAT/ edge, 1=falling edge)
CoE (CANopen
UINT32 Reserved
DS402)
- SoftDrive UINT32 Reserved
(TCom), UINT32 Reserved
- MDP 511
UINT32 Reserved
(EL5101,
EL5151, } 24 bytes
EL5021,
EL7041,
EL7342)
0x00000205 Write KL5101,SERC VOID Deactivate "external
OS,AX2xxx,PR latch" or deactivate
OFIDrive "measuring probe
function"
0x00000205 Write CANopen UINT32[4] Deactivate "external
latch" or deactivate
"measuring probe
function"

0x00000210 Write KL5101,SERC REAL64 e.g. mm ±∞ Set "External latch Only for
OS,AX2xxx,PR event" and "External EtherCAT:
OFIDrive latch position"

126 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.5.4 "Index offset" specification for cyclic encoder process data (Index
group 0x5300 + ID)

TwinCAT 3 Version: 1.1.0 127


Target systems

Index offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000000 Read/Write every (NC→IO) { STRUCT s. ENCODER-OUTPUT- Write command
encoder STRUCTURE (NC→IO, only optional!
interface 40 Byte)
Consider safety
NCENCODERSTRUCT_
aspects!
OUT2
INT32 INC ≥0 nDataOut1
INT32 INC ≥0 nDataOut2
UINT8 1 ≥0 nCtrl1
UINT8 1 ≥0 nCtrl2
UINT8 1 ≥0 nCtrl3
UINT8 1 ≥0 nCtrl4
INT32 INC ≥0 nDataOut3
INT32 INC ≥0 nDataOut4
INT32 INC ≥0 nDataOut5
INT32 INC ≥0 nDataOut6
UINT8 1 ≥0 nCtrl5
UINT8 1 ≥0 nCtrl6
UINT8 1 ≥0 nCtrl7
UINT8 1 ≥0 nCtrl8
INT32 1 ≥0 Reserved
INT32 1 ≥0 Reserved
} 40 bytes
0x00000000 Read/Write every { STRUCT Optional ENCODER- Write command
(NC→IO), OUTPUT-STRUCTURE only optional!
s. encoder
optional 64 bit (NC→IO, 80 Byte)
interface Consider safety
encoder NCENCODERSTRUCT_
aspects!
interface OUT3
(e.g. MDP513 NEW from TC3
with 64Bit) UINT64 INC ≥0 nDataOut1
UINT64 INC ≥0 nDataOut2
UINT64 INC ≥0 nDataOut3
UINT64 INC ≥0 nDataOut4
UINT64 INC ≥0 nDataOut5
UINT64 INC ≥0 nDataOut6
UINT64 INC ≥0 nDataOut7
UINT64 INC ≥0 nDataOut8
UINT16 1 ≥0 nCtrl1
UINT16 1 ≥0 nCtrl2
UINT16 1 ≥0 nCtrl3
UINT16 1 ≥0 nCtrl4
UINT16 1 ≥0 nCtrl5
UINT16 1 ≥0 nComCtrl
INT32 1 ≥0 reserved
} 80 bytes

128 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Write Every { STRUCT s. Bitwise access to Write command
(NC→IO) encoder only optional!
ENCODER-OUTPUT-
interface
STRUCTURE (NC→IO, Consider safety
40 Byte) aspects!
NCENCODERSTRUCT_
OUT2
UINT32 1 [0 … 39] ByteOffset
Relative address offset
[0..39] in output structure.
E.G.: To write “nControl1”
the ByteOffset must be 8.
UINT32 1 [0x00000000… BitSelectMask (BSM)
0xFFFFFFFF]
The mask defines write
enabled bits in a
DWORD. Zero bits are
protected and remain
unaffected.
UINT32 1 [0x00000000… Value
0xFFFFFFFF]
Only those bits in value
are overwritten where
BSM equals 1.
}

0x00000080 Read every (IO→NC) { STRUCT s. ENCODER-INPUT-


encoder STRUCTURE (IO→NC,
interface 40 Byte)
NCENCODERSTRUCT_I
N2
INT32 INC ≥0 nDataIn1
INT32 INC ≥0 nDataIn2
UINT8 1 ≥0 nState1
UINT8 1 ≥0 nState2
UINT8 1 ≥0 nState3
UINT8 1 ≥0 nState4 (Bit0: WcState,
Bit1: InputToggle)
INT32 INC ≥0 nDataIn3
INT32 INC ≥0 nDataIn4
INT32 INC ≥0 nDataIn5
INT32 INC ≥0 nDataIn6
UINT8 1 ≥0 nState5
UINT8 1 ≥0 nState6
UINT8 1 ≥0 nState7
UINT8 1 ≥0 nState8
INT32 [ns] ≥0 nDcInputTime (absolute/
relative DcInputShift for
deadtime compensation)
INT32 1 ≥0 Reserved
} 40 bytes

TwinCAT 3 Version: 1.1.0 129


Target systems

Index offset Access Group type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000080 Read every { STRUCT s. optional ENCODER- NEW from TC3
(NC→IO), encoder INPUT-STRUCTURE
optional 64 bit interface (IO→NC, 80 Byte)
encoder NCENCODERSTRUCT_I
interface N3
(e.g. MDP513 UINT64 INC ≥0 nDataIn1
with 64Bit) UINT64 INC ≥0 nDataIn2
UINT64 INC ≥0 nDataIn3
UINT64 INC ≥0 nDataIn4
UINT64 INC ≥0 nDataIn5
UINT64 INC ≥0 nDataIn6
UINT64 INC ≥0 nDataIn7
UINT64 INC ≥0 nDataIn8
UINT16 1 ≥0 nState1
UINT16 1 ≥0 nState2
UINT16 1 ≥0 nState3
UINT16 1 ≥0 nState4
UINT16 1 ≥0 nState5
UINT16 1 ≥0 nComState (Bit0:
WcState, Bit1:
InputToggle)
INT32 [ns] ≥0 nDcInputTime (absolute/
relative DcInputShift for
deadtime compensation)
} 80 bytes

130 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.6 Specification Controller

3.1.1.5.4.6.1 "Index offset" specification for controller parameter (Index group


0x6000 + ID)

TwinCAT 3 Version: 1.1.0 131


Target systems

Index offset Access Controller type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Read every UINT32 1 [1 ... 255] Controller ID
0x00000002 Read every UINT8[30+1] 1 30 symbol Controller name
0x00000003 Read every UINT32 1 s. ENUM (>0) Controller type [} 159]
0x0000000A Read/Write every UINT32 1 s. ENUM (>0) Controller mode DEFAULT:
1=STANDARD
0x0000000B Read/Write every REAL64 % [0.0 ... 1.0] Weight of the velocity pre
control (standard value:
1.0 = 100 %)

0x00000010 Read/Write every UINT16 1 0/1 Following error


monitoring positon?
0x00000011 Read/Write every UINT16 1 0/1 Following error
monitoring velocity?
0x00000012 Read/Write every REAL64 mm [0.0…1.0E.6] Max. following error
position
0x00000013 Read/Write every REAL64 s [0.0...600] Max. following error time
position
0x00000014 Read/Write every REAL64 mm/s [0.0…1.0E.6] Max. following error
velocity
0x00000015 Read/Write every REAL64 s [0.0…1.0E.6] Max. following error time
velocity

0x00000021 Read/Write every REAL64 1 [0.0...1000000. Scaling factor (multiplier) Reserved


0] for position differences function,
between master and no standard!
slave axis (conversion in
the same coordinate
system)

0x00000100 Read/Write P/PID (Pos., REAL64 1 [0.0...1.0] Maximum output (Standard


(velocity) limitation ( ) for controller value: 0.5 ==
total output 50%)
0x00000102 Read/Write P/PID (Pos.) REAL64 mm/s/ [0.0...1000.0] Proportional amplification Base unit / s /
mm factor kp resp. kv base unit
position control
0x00000103 Read/Write PID (Pos.) REAL64 s [0.0 ... 60.0] Integral action time Tn Position control
0x00000104 Read/Write PID (Pos.) REAL64 s [0.0 ... 60.0] Derivative action time Tv position control
0x00000105 Read/Write PID (Pos.) REAL64 s [0.0 ... 60.0] Damping time Td Position control
0x00000106 Read/Write PP (Pos.) REAL64 mm/s/ [0.0...1000.0] Add proportional Base unit / s /
mm amplification factor kp base unit
resp. kv that applies position control
above a limit velocity in
percent.
0x00000107 Read/Write PP (Pos.) REAL64 % [0.0...1.0] Threshold level velocity (Standard
in percent, above which value: 0.01 ==
the additional 1%)
proportional amplification
factor kp resp. kv applies.
0x00000108 Read/Write P/PID (Acc.) REAL64 s [0.0 ... 100.0] proportional amplification Acceleration
factor ka pre control
0x0000010A Read/Write every UINT32 1 ENUM Filter for maximum slope Reserved
of the nominal velocity function,
(acceleration restricted): no standard!
0: Off, 1: Velo, 2:
Pos+Velo
0x0000010B Read/Write every REAL64 mm/s^2 Filter value for the Reserved
maximum slope of the function,
nominal velocity (max. no standard!
acceleration)
0x0000010D Read/Write P/PID REAL64 mm [0.0 ... 10000.0] 'dead band' for position Reserved
error (position deviation) function
(for P/PID-controller with
velocity or torque
interface)

132 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Controller type Data type Phys. Definition Description Remarks
(Hex) unit range
0x0000010F Read/Write P/PP/PID REAL64 (mm/s) / [0.0...1000.0] Slave coupling control: Slave coupling
(Pos.) mm control
Proportional gain kcp for
slave-control
position deviation
between master and
slave

0x00000110 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset


calibration:
active/passive
0x00000111 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset
calibration:
hold mode
0x00000112 Read/Write P (Pos.) UINT16 1 0/1 Automatic offset
calibration:
fading mode
0x00000114 Read/Write P (Pos.) REAL64 % [0.0 ... 1.0] Automatic offset (Standard
calibration: value: 0.05 ==
5%)
pre control limit
0x00000115 Read/Write P (Pos.) REAL64 s [0.1 ... 60.0] automatic offset
calibration:
time constant
0x00000116 Read/Write PID (Pos.) REAL64 % [0.0...1.0] Maximum output
limitation ( ) for I- part in
percent (default setting:
0.1 == 10 %)
0x00000117 Read/Write PID (Pos.) REAL64 % [0.0...1.0] Maximum output
limitation ( ) for D- part in
percent (default setting:
0.1 == 10 %)
0x00000118 Read/Write PID (Pos.) UINT16 1 0/1 Switch off the I-part
during an active
positioning process (as
far as I-part active)?
(default setting: 0 =
FALSE)
0x00000120 Read/Write P/PID (Pos.) REAL64 s ≥0 PT-1 filter time for Reserved
position error (position- function,
difference) no standard!

0x00000202 Read/Write P/PID (velocity) REAL64 1 [0.0...1000.0] Proportional amplification Velocity control
factor kp resp. kv
0x00000203 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Integral-action time Tn Velocity control
0x00000204 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Derivative action time Tv Velocity control
0x00000205 Read/Write PID (velocity) REAL64 s [0.0 ... 60.0] Damping timeTd Velocity control
0x00000206 Read/Write PID (velocity) REAL64 % [0.0...1.0] Maximum output Velocity control
limitation ( ) for I-part in
percent (default setting:
0.1 == 10 %)
0x00000207 Read/Write PID (velocity) REAL64 % [0.0...1.0] Maximum output Velocity control
limitation ( ) for D-part in
percent (default setting:
0.1 = 10 %)
0x0000020D Read/Write P/PID (velocity) REAL64 mm/s [0.0 ... 10000.0] 'dead band' for velocity Reserved
error (velocity deviation) function
(for P/PID-controller with
velocity or torque
interface)
0x00000220 Read/Write P/PID (velocity) REAL64 s ≥0 PT-2 filter time for Velocity control,
velocity error (velocity- no standard!
difference)
0x00000221 Read/Write P/PID (velocity) REAL64 s ≥0 PT-1 filter time for Reserved
velocity error (velocity- function,
difference) no standard!

TwinCAT 3 Version: 1.1.0 133


Target systems

Index offset Access Controller type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000250 Read/Write P/PI (observer) UINT32 1 s. ENUM (≥0) OBSERVER mode [} 159]
for controller with torque
interface
0: OFF (default)
1: LUENBERGER
0x00000251 Read/Write P/PI (observer) REAL64 Nm / A >0.0 Motor:
torque constant KT
0x00000252 Read/Write P/PI (observer) REAL64 kg m2 >0.0 Motor:
moment of inertia JM
0x00000253 Read/Write P/PI (observer) REAL64 Hz [100.0 ... Bandwidth f0
2000.0] Default:
500
0x00000254 Read/Write P/PI (observer) REAL64 1 [0.0 ... 2.0] Correction factor kc
Default: 1.0
0x00000255 Read/Write P/PI (observer) REAL64 s [0.0 ... 0.01] Velocity filter (1. order):
Default: 0.001
filter time constant T

0x00000A03 Read/Write PID (MW) REAL64 cm^2 [0.0 ...1000000] Cylinder area AA of side
A in cm^2
0x00000A04 Read/Write PID (MW) REAL64 cm^2 [0.0 ...1000000] Cylinder area AB of side
B in cm^2
0x00000A05 Read/Write PID (MW) REAL64 cm^3/s [0.0 ...1000000] Nominal volume flow
Qnenn in cm^3/s
0x00000A06 Read/Write PID (MW) REAL64 bar [0.0 ...1000000] nominal pressure resp.
valve pressure reduction
Pnenn in bar
0x00000A07 Read/Write PID (MW) UINT32 1 [1 ... 255] Axis ID for the system
pressure Po

134 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.6.2 "Index offset" specification for controller state (Index group 0x6100
+ ID)

TwinCAT 3 Version: 1.1.0 135


Target systems

Index offset Access Controller type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000001 Read every INT32 Error state controller
0x00000002 Read every REAL64 e.g. mm/ Controller output in Base Unit / s
s absolute units
Symbolic
access
possible!
"CtrlOutput"
0x00000003 Read every REAL64 % Controller output in Cannot be
percent traced by
oscilloscope!
0x00000004 Read every REAL64 V Controller output in Cannot be
volts traced by
oscilloscope!

0x0000000D Read every REAL64 mm Following error Base Unit


position (without dead
time compensation)
0x0000000E Read every REAL64 mm Following error Base Unit
position (without set
position correction)
0x0000000F Read every REAL64 mm Following error Base Unit
position (with set
Symbolic
position correction and
access
dead time
possible!
compensation)
"PosDiff"
0x00000010 Read every REAL64 mm Peak hold value for Base Unit
maximum negative
following error of the
position
0x00000011 Read every REAL64 mm Peak hold value for Base Unit
minimum positive
following error of the
position
0x00000012 Read every REAL64 mm/s Following error Base Unit / s
velocity

0x00000021 Read every REAL64 mm Difference (deviation) Base Unit


between the following
Symbolic
error from master and
access possible
slave axis (master
via axis!
error minus slave
error) "PosDiffCouple"
0x00000022 Read every REAL64 mm PeakHold value for the Base Unit
maximum negative
difference between
master and slave axis
following error of the
position
0x00000023 Read every REAL64 mm PeakHold value for the Base Unit
maximum positive
difference between
master and slave axis
following error of the
position

0x00000101 Read P/PID (pos.) REAL64 e.g. mm/ P-part of the controller
s in absolute units
0x00000102 Read PID (pos.) REAL64 e.g. mm/ I-part of the controller
s in absolute units
0x00000103 Read PID (pos.) REAL64 e.g. mm/ D-part of the controller
s in absolute units
0x00000104 Read PID (pos.) UINT16 1 0/1 Limitation of the I-part
active?
0x00000105 Read PID (pos.) UINT16 1 0/1 Limitation of the D-part
active?
0x00000106 Read PID (pos.) UINT16 1 0/1 ARW measures for the ARW: Anti
I-part active? Reset Windup

136 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Controller type Data type Phys. Definition Description Note
( Hex ) unit range
0x0000010F Read P/PP/PID REAL64 e.g. mm/ Proportion of NEW
(veloc.) s automatic offset
compensation in
absolute units

0x00000110 Read PID (pos.) REAL64 e.g. mm/ Acceleration pre- Acceleration
s control Yacc of the pre-control
controller in absolute
units
Note: function
depends on controller
type!
0x00000111 Read PP (Pos.) REAL64 mm/s/ ≥0 Internal interpolated PP controller
mm proportional gain kp or
kv

0x0000011A Read P (Pos.) UINT32 1 Set velocity filter: List!Reserved


0x0000011B REAL64 mm function,
InternalPhase
0x0000011C REAL64 mm/s no standard!
InternalPosSollError!
0x0000011D REAL64 mm/s
TestVeloSoll
0x0000011E REAL64 mm/s^2
InternalLimitedVeloSol
0x0000011F REAL64 mm
l
0x00000120 REAL64 mm
InternalAccSollRel
0x00000121 REAL64 mm/s
InternalPosSollRel
0x00000122 REAL64 mm/s^2
PosSollCorrected!
0x00000123 REAL64 mm/s
VeloSollCorrected!
0x00000124 REAL64 mm/s^2
AccSollCorrected!
TestVeloSollCorrected
TestAccSollCorrected

0x00000201 Read P,PID (velocity) REAL64 e.g. mm/ Velocity part of the Base Unit / s
s controller
0x00000202 Read P,PID (velocity) REAL64 % Velocity part of the Cannot be
controller in percent traced by
oscilloscope!
0x00000203 Read P,PID (velocity) REAL64 V Velocity part of the Cannot be
controller in volts traced by
oscilloscope!
0x00000201 Read P/PID (velocity) REAL64 e.g. mm/ P-part of the controller
s in absolute units
0x00000202 Read P/PID (velocity) REAL64 e.g. mm/ I-part of the controller
s in absolute units
0x00000203 Read P/PID (velocity) REAL64 e.g. mm/ D-part of the controller
s in absolute units
0x00000204 Read P/PID (velocity) UINT16 1 0/1 Limitation of the I-part
active?
0x00000205 Read P/PID (velocity) UINT16 1 0/1 Limitation of the D-part
active?
0x00000206 Read P/PID (velocity) UINT16 1 0/1 ARW measures for the ARW: Anti
I-part active? Reset Windup
0x0000020A Read P/PID (velocity) REAL64 e.g. mm/ Total input size of the
s velocity controller

0x00000250 Read P/PI (observer) REAL64 e.g. mm Observer: position


difference (actual
position - observer
position
0x00000251 Read P/PI (observer) REAL64 e.g. mm Observer: position

0x00000252 Read P/PI (observer) REAL64 e.g. mm/ Observer: velocity 2


s (for P-part)
0x00000253 Read P/PI (observer) REAL64 e.g. mm/ Observer: velocity 1
s (for I-part)
0x00000254 Read P/PI (observer) REAL64 e.g. mm/ Observer: acceleration
s^2

TwinCAT 3 Version: 1.1.0 137


Target systems

Index offset Access Controller type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000255 Read P/PI (observer) REAL64 A Observer: motor actual
current

0x00000256 Read P/PI (observer) UINT16 1 0/1 Observer: limitation of


the I-part active?

0x00000A00 Read PID (MW) REAL64 % [-1.0...1.0] Calculation of the set


velocity (pre-control) in
percent
0x00000A01 Read PID (MW) REAL64 e.g. mm/ P-part of the controller
s in absolute units or
percent (according to
output weight)
0x00000A02 Read PID (MW) REAL64 e.g. mm/ I-part of the controller
s in absolute units or
percent (according to
output weight)
0x00000A03 Read PID (MW) REAL64 e.g. mm/ D-part of the controller
s in absolute units or
percent (according to
output weight)
0x00000A04 Read PID (MW) UINT16 1 0/1 Limitation of the I-part
active?
0x00000A05 Read PID (MW) UINT16 1 0/1 Limitation of the D-part
active?

0x00000A10 Read PID (pos.) REAL64 e.g. mm/ Acceleration pre- Acceleration
s control Yacc of the pre-control
controller in absolute
units

3.1.1.5.4.6.3 "Index offset" specification for controller functions (Index group


0x6200 + ID)
Index offset Access controller type Data type Phys. Definition Description Remarks
(Hex) unit range

138 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.7 Specification Drive

3.1.1.5.4.7.1 "Index offset" specification for drive parameter (Index group


0x7000 + ID)

TwinCAT 3 Version: 1.1.0 139


Target systems

Index offset Access Drive type Data type Phys. Definition Description Note
( Hex ) Unit range
0x00000001 Read every UINT32 1 [1 ... 255] Drive ID
0x00000002 Read every UINT8[30+1] 1 30 characters Drive name
0x00000003 Read every UINT32 1 s. ENUM (>0) Drive type [} 164]
0x00000004 Read/Write every UINT32 1 Byteoffset Input address offset change I/O
(IO-Input-Image) address
0x00000005 Read/Write every UINT32 1 Byteoffset Output address offset change I/O
(IO-Output-Image) address
0x00000006 Read/Write every UINT16 1 [0,1] motor polarity Writing is not
allowed if the
controller
enable has
been issued.
0x0000000A Read/Write every UINT32 1 s. ENUM (>0) drive mode Default:
1=
STANDARD
0x0000000B Read/Write every REAL64 % [-1.0 ... 1.0] Minimum output limit
(output limitation)
(default setting: -1.0
== -100%)
0x0000000C Read/Write every REAL64 % [-1.0 ... 1.0] Maximum output limit
(output limitation)
(default setting: 1.0 ==
100%)
0x0000000D Read every UINT32 INC Maximum number of
output increments
(output mask)
0x00000010 Read/Write every UINT32 1 Internal Drive Control Reserved!
double word to
determine the drive
operation modes
0x00000011 Read/Write every UINT32 1 ≥5 Internal drive reset Reserved!
counter
(time in NC cycles for
enable and reset)
0x00000020 Read/Write every UINT32 1 see ENUM (≥0) Drive dead time
see appendix compensation mode
0: Off (default)
1: On (with velocity)
2: On (with velocity
and acceleration)
0x00000021 Read/Write every UINT32 1 Control double word
(32 bits) for the drive
dead time
compensation:
Bit 0 = 0: relative IO
times (default)
Bit 0 = 1: absolute IO
times
0x00000022 Read/Write every INT32 ns [±1.0E+9] Sum of the
parameterized time
shifts for the drive
dead time
compensation
(typically positive
numerical values)
0x00000031 Read/Write every REAL64 e.g. %/ [-1.0E+30 ... Scaling factor for NEW from
INC 1.0E+30] actual torque value of TC3.1
drive
(or actual value of
force or current
respectively)
e.g. AX5xxx: 0.1 =>
±100%

140 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Drive type Data type Phys. Definition Description Note
( Hex ) Unit range
0x00000032 Read/Write every REAL64 s [0.0 ... 60.0] P-T1 filter time for NEW from
actual torque value TC3.1
(or actual value of
force or current
respectively)
0x00000033 Read/Write every REAL64 s [0.0 ... 60.0] P-T1 filter time for NEW from
temporal derivation of TC3.1
the actual torque value
(or actual value of
force or current
respectively)

0x00000101 Read/Write Servo REAL64 e.g. mm/ >0.0 Reference velocity at Base Unit / s
s reference output
(velocity pre-control)
0x00000102 Read/Write Servo REAL64 % [0.0 ... 5.0] reference output in
percent
0x00000103 Read Servo REAL64 e.g. mm/ >0.0 resulting velocity at Base Unit / s
s 100% output
0x00000104 Read/Write Servo REAL64 e.g. mm/ ±∞ velocity offset (DAC Base Unit / s
s offset) for drift
calibration (offset
calibration) of the axis
0x00000105 Read/Write Servo (Sercos, REAL64 1 [0.0 ... velocity scaling For
Profi Drive, 100000000.0] (scaling factor to react Sercos, Profi
AX200x, to the weight in the Drive, AX200x,
CANopen) drive) CANopen
0x00000106 Read/Write Profi Drive UINT32 0.001 * ≥0 Profibus/Profi Drive Only for Profi
DSC 1/s DSC: position control Drive DSC
gain Kpc
0x00000107 Read/Write Profi Drive REAL64 1 ≥ 0.0 Profibus/Profi Drive Only for Profi
DSC DSC: scaling for Drive DSC
calculating 'XERR'
(Default: 1.0)
0x00000109 Read/Write Servo REAL64 1 [0.0 ... Position scaling For Sercos,
100000000.0] (scaling factor to react CANopen
to the weight in the
drive)
0x0000010A Read/Write Servo REAL64 1 [0.0 ... Acceleration scaling For
100000000.0] (scaling factor to react Sercos, Profi
to the weight in the Drive, AX200x,
drive) CANopen
0x0000010B Read/Write Servo REAL64 1 [0.0 ... Torque scaling (rotary For
100000000.0] motor) or force scaling Sercos, Profi
(linear motor) (scaling Drive, AX200x,
factor for reacting to CANopen
weighting in the drive)
for "TorqueOffset"
(additive moment as
pre-control)
0x0000010C Read/Write Servo REAL64 1 [0.0 ... Torque scaling (rotary For
100000000.0] motor) or force scaling Sercos, Profi
(linear motor) (scaling Drive, AX200x,
factor for reacting to CANopen
weighting in the drive)
From TC 3.1
for "SetTorque"
B4024.2
(e.g.
MC_TorqueControl)
with Drive OpMode
CST)
0x0000010D Read/Write Servo (Sercos, REAL64 s [0.0 ... 1.0] Damping time for drive For Sercos,
CANopen) velocity output CANopen
0x0000010E Read/Write Servo (Sercos, REAL64 s [0.0 ... 1.0] Damping time for drive For Sercos,
CANopen) acceleration output CANopen
0x0000010F Read/Write Servo (Sercos, REAL64 s [0.0 ... 1.0] Damping time for drive For Sercos,
CANopen) torque output or force CANopen
output

TwinCAT 3 Version: 1.1.0 141


Target systems

Index offset Access Drive type Data type Phys. Definition Description Note
( Hex ) Unit range
0x00000120 Read/Write Servo/ UINT32 1 ≥0 Table ID Only for
hydraulics/ KL4xxx,
(0: no table)
M2400,
Universal
0x00000121 Read/Write Servo/ UINT32 1 ≥0 Interpolation type 0: Only for
hydraulics Linear KL4xxx,
2: Spline M2400,
Universal
0x00000122 Read/Write Servo/ REAL64 % [-1.0 ... 1.0] Output offset in Only for
hydraulics percent KL4xxx,
M2400,
Note:
Universal
Acts according to the
characteristic
evaluation!

0x00000151 Read/Write Servo / non- REAL64 1 [0.0 ... 100.0] Quadrant


linear compensation factor
(relationship between
quadrant I and III)
0x00000152 Read/Write Servo / non- REAL64 1 [0.01 ... 1.0] Velocity reference
linear point in percent (1.0
== 100 %)
0x00000153 Read/Write Servo / non- REAL64 1 [0.01 ... 1.0] Output reference point
linear in percent (1.0 ==
100%)

0x00000301 Read/Write Stepper motor UINT8 Bit mask: cycle 1


0x00000302 Read/Write Stepper motor UINT8 Bit mask: cycle 2
0x00000303 Read/Write Stepper motor UINT8 Bit mask: cycle 3
0x00000304 Read/Write Stepper motor UINT8 Bit mask: cycle 4
0x00000305 Read/Write Stepper motor UINT8 Bit mask: cycle 5
0x00000306 Read/Write Stepper motor UINT8 Bit mask: cycle 6
0x00000307 Read/Write Stepper motor UINT8 Bit mask: cycle 7
0x00000308 Read/Write Stepper motor UINT8 Bit mask: cycle 8
0x00000310 Read/Write Stepper motor UINT8 Bit mask: holding
current

142 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.7.2 "Index offset" specification for drive state (Index group 0x7100 +
ID)

TwinCAT 3 Version: 1.1.0 143


Target systems

Index offset Access Drive type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000001 Read every INT32 Error state drive
0x00000002 Read every REAL64 e.g. mm/ Total output in Base unit / s
s absolute units Symbolic
access
possible!
"DriveOutput"
0x00000003 Read every REAL64 % Total output in percent
0x00000004 Read every REAL64 V Total output in volts Cannot be
traced by
oscilloscope!
0x00000005 Read every REAL64 e.g. mm/ PeakHold value for Base Unit / s
s maximum negative
total output
0x00000006 Read every REAL64 e.g. mm/ PeakHold value for Base Unit / s
s maximum positive total
output
0x00000007 Read every REAL64 e.g. Actual torque or actual from TC3.1
100% = force respectively B4022
1000, (typically 100% =
Symbolic
e.g. Nm 1000)
access
or N
possible!
"ActTorque"
0x00000008 Read every REAL64 e.g. Nm/ ±∞ Actual torque change from TC3.1
s or N/s or actual force change B4024
respectively
(time derivative of the
actual torque or actual
force respectively)

0x0000000C Read every REAL64 e.g. mm Set position correction


value for drive output
on account of dead
time compensation
0x0000000D Read every REAL64 s Sum of the time shifts
for drive dead time
compensation
(parameterized and
variable dead time)
Note: a dead time is
specified in the system
as a positive value.

0x00000013 Read every REAL64 % Total output in percent


(based on non-linear
characteristic curve!)
0x00000014 Read every REAL64 V Total output in volt Cannot be
(based on non-linear traced by
characteristic curve!) oscilloscope!

0x0000011A Read Servo (Sercos, REAL64 e.g. mm Optional output NEW


CANopen) filtering: For Sercos,
Filtered set position CANopen
0x0000011E Read Servo (Sercos, REAL64 e.g. mm/ Optional output NEW
CANopen) s filtering: For Sercos,
Filtered set velocity CANopen
0x0000011F Read Servo (Sercos, REAL64 e.g. mm/ Optional output NEW
CANopen) s^2 filtering: For Sercos,
Filtered set CANopen
acceleration / set
deceleration

144 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Drive type Data type Phys. Definition Description Note
( Hex ) unit range
0x00000200 ReadWrite READ: Reading the state of from TC3.1
the digital inputs 1 to 8 B4024.12
UINT32 1 0/1 State of the selected Only for SAF-
input Port 501!
WRITE:
UINT32 1 [1…8] Selection of input 1 to
8

3.1.1.5.4.7.3 "Index offset" specification for drive functions (Index group 0x7200
+ ID)
Index offset Access Drive type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000102 Write SERVO { Remove and delete the Only for SAF-
characteristic drive table port 501!
ULONG 1 >0 Table-ID
s.a. axis function with
index offset 0x00000012
}

TwinCAT 3 Version: 1.1.0 145


Target systems

3.1.1.5.4.7.4 "Index offset" specification for cyclic drive process data (Index
group 0x7300 + ID)

146 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access Drive type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000000 Read/Write every (NC→IO) { STRUCT s. DRIVE-OUTPUT- Write command
drive interface STRUCTURE (NC→IO, only optional!
40 Byte)
Consider safety
NCDRIVESTRUCT_OUT
aspects!
2
INT32 INC ≥0 nOutData1
INT32 INC 2^31 nOutData2
UINT8 1 ≥0 nControl1
UINT8 1 ≥0 nControl2
UINT8 1 ≥0 nControl3
UINT8 1 ≥0 nControl4
INT32 INC ≥0 nOutData3
INT32 INC ≥0 nOutData4
INT32 INC ≥0 nOutData5
INT32 INC ≥0 nOutData6
UINT8 1 ≥0 nControl5
UINT8 1 ≥0 nControl6
UINT8 1 ≥0 nControl7
UINT8 1 ≥0 nControl8
INT32 1 ≥0 Reserved
INT32 1 ≥0 Reserved
}
0x00000001 Write every (NC→IO) { STRUCT s. Bitwise access to DRIVE- Write command
drive interface OUTPUT-STRUCTURE only optional!
(NC→IO, 40 Byte)
Consider safety
NCDRIVESTRUCT_OUT
aspects
2
UINT32 1 [0 … 39] ByteOffset
Relative address offset
[0..39] in output structure.
E.G.: To write “nControl1”
the ByteOffset must be 8.
UINT32 1 [0x00000000… BitSelectMask (BSM)
0xFFFFFFFF]
The mask defines write
enabled bits in a
DWORD. Zero bits are
protected and remain
unaffected.
UINT32 1 [0x00000000… Value
0xFFFFFFFF]
Only those bits in value
are overwritten where
BSM equals 1.
}

TwinCAT 3 Version: 1.1.0 147


Target systems

Index offset Access Drive type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000080 Read every (IO→NC) { STRUCT s. DRIVE-INPUT-
drive interface STRUCTURE (IO→NC,
40 Byte)
NCDRIVESTRUCT_IN2
INT32 INC ≥0 nInData1
INT32 INC ≥0 nInData2
UINT8 1 ≥0 nStatus1
UINT8 1 ≥0 nStatus2
UINT8 1 ≥0 nStatus3
UINT8 1 ≥0 nStatus4
INT32 INC ≥0 nInData3
INT32 INC ≥0 nInData4
INT32 INC ≥0 nInData5
INT32 INC ≥0 nInData6
UINT8 1 ≥0 nStatus5
UINT8 1 ≥0 nStatus6
UINT8 1 ≥0 nStatus7
UINT8 1 ≥0 nStatus8
INT32 1 ≥0 Reserved
INT32 1 ≥0 Reserved
}

148 Version: 1.1.0 TwinCAT 3


Target systems

3.1.1.5.4.8 Specification Tables

3.1.1.5.4.8.1 "Index offset" specification for table parameter (Index group


0xA000 + ID)

TwinCAT 3 Version: 1.1.0 149


Target systems

Index offset Access table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000001 Read every UINT32 1 [1 ... 255] Table ID
0x00000002 Read every UINT8[30+1] 1 30 symbol Table name
0x00000003 Read every UINT32 1 s. ENUM (>0) Table sub type [} 166]
0x00000004 Read every UINT32 1 s. ENUM (>0) Table main type [} 166]

0x00000010 Read every UINT32 1 [0... 16777216] Number of lines (n)


0x00000011 Read every UINT32 1 [0... 16777216] Number of columns (m)
0x00000012 Read every UINT32 1 ≥0 Number of total elements
(n*m)
0x00000013 Read equidistant Tab. REAL64 e.g. mm ≥0.0 Step width (position Base unit
delta) (equidistant table )
0x00000014 Read cyclic Tab. REAL64 e.g. ≥0.0 Master period (cyclic Base unit
degree table )
0x00000015 Read cyclic Tab. REAL64 e.g. ≥0.0 Slave difference per Base unit
degree master period (cyclic
table )

0x0000001A Read /Write "Motion { Activation mode for


Function" online change from table
data (only MF)
UINT32 ENUM s. appendix Activation mode:
0: 'instantaneous'
(default)
1: 'master cam pos.'
2: 'master' axis pos.'
3: 'next cycle'
4: 'next cycle once'
5: 'as soon as possible'
6: 'off'
7: 'delete queued data'
REAL64 e.g. mm ±∞ Activation position
UINT32 ENUM s. appendix Master scaling type
0: user defined (default)
1: scaling with auto offset
2: off
UINT32 ENUM s. appendix Slave scaling type
0: user defined (default)
1: scaling with auto offset
2: off
}

0x00000020 Read /Write every { Write single value [n,m]:


UINT32 1 [0 ... 16777216] n-th line
UINT32 1 [0 ... 16777216] m-th column
REAL64 e.g. mm ±∞ Single value Base unit
}
0x00000021 ReadWrite every *REAL64 e.g. mm ±∞ Read slave position to
the given master position
(relates only to the "row
values" of the table)

150 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000022 ReadWrite "Motion Write Read the "Motion Only line by line
Function" Function" as fixed values possible!
("scatter plot") (multiple
{ integer)
UINT16 1 0/1 Initialization of data (copy
of actual data)?
UINT16 1 Bitmask (≥0) Select bit mask (number
of columns is one column
for the master position
plus number of bits):
Bit 0: Pos (Slave)
Bit 1: Velo (Slave)
Bit 2: Acc (Slave)
Bit 3: Jerk (Slave)
REAL64 e.g. mm ±∞ Startposition (Master)
REAL64 e.g. mm > 0.0 Inkrement
}
Read
{
REAL64[x*m] e.g. mm ±∞ Generating the values of
x rows beginning with the
master start position:
(x*m)-values (one or
more rows)
}
0x00000023 ReadWrite every Write Read slave values to
given master position
(relates only to the "row
values" of the table)
REAL64 e.g. mm ±∞ Master position
Read
{
REAL64 e.g. mm ±∞ Slave position
REAL64 mm/s ±∞ Slave velocity
REAL64 mm/s^2 ±∞ Slave acceleration
}

0x00000050 Read /Write every REAL64 [64] 1 ±∞ Characteristic table


values [} 168]
0x00000050 ReadWrite every Write Read the characteristic
table values in
dependency to the
nominal master velocity
REAL64 [64] ... ±∞ Optional nominal master
velocity
"fMasterVeloNom"
(normed => 1.0 mm/s),
the other values are not
used
Read
REAL64 [64] ... ±∞ Read the characteristic
table values [} 168]

TwinCAT 3 Version: 1.1.0 151


Target systems

Index offset Access table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00000115 Write monoton linear, { Set/change the table
monoton zykl., scaling:
REAL64 1 [±1000000.0] Original wightning of the
table
REAL64 e.g. mm [±1000000.0] Position offset of the
master column
REAL64 1 [±1000000.0] Scaling of the master
column
REAL64 e.g. mm [±1000000.0] Position offset of the
slave column
REAL64 1 [±1000000.0] Scaling of the slave
column
REAL64 e.g. mm [±1000000.0] Lower area boundary
(start position)
REAL64 e.g. mm [±1000000.0] Upper area boundary
(end position)
}

0x01000000 Read/ every { e.g. mm ±∞ Read/write x lines from Only line by line
+n-te start line Write[<=16777 REAL64[x*m] } the n-th line: (x*m)-values possible!
216] (one or more lines )value (multiple
range n: [0 ... 16777216] integer)

0x02000000 Read/ every { e.g. mm ∞ Read/write x columns Only column by


+m-te Write[<=16777 REAL64[x*n] } from m-th column: (x*n)- column
Startspold 216] values (one or more possible!
columns )value range m: (multiple
[0 ... 16777216] integer)

0x05000000 Read/ "Motion { Read/write x lines from Only line by line


+n-te start line Write[<=16777 Function"(law the n-th line: (x*m)-values possible!
216] of (one or more lines ) value (multiple
motion)Data:ST range n: [0 ... 16777216] integer)
RUCT[x*m] UINT32 1 Absolute point index
(not checked)
UINT16 ENUM Function type
1: Polynom 1
15: Polynom 5
UINT16 ENUM Point type
0: default
1: ignore
INT32 1 Relative address index to
target point
(default: 1)
REAL64 mm Master position
REAL64 mm Slave position
REAL64 mm/s Slave velocity
REAL64 mm/s^2 Slave acceleration
REAL64 mm/s^3 Slave jerk
}

152 Version: 1.1.0 TwinCAT 3


Target systems

Index offset Access table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x06000000 Read/ "Motion { Read/write x columns Only column by
+m-te Write[<=16777 Function"(law from m-th column: (x*n)- column
Startspold 216] of values (one or more possible!
motion)Data:ST columns )value range m: (multiple
RUCT[x*n] [0 ... 16777216] integer)
UINT32 1 Absolute point index
(not checked)
UINT16 ENUM Function type
1: Polynom 1
15: Polynom 5
UINT16 ENUM Point type
0: default
1: ignore
INT32 1 Relative address index to
target point
(default: 1)
REAL64 mm Master position
REAL64 mm Slave position
REAL64 mm/s Slave velocity
REAL64 mm/s^2 Slave acceleration
REAL64 mm/s^3 Slave jerk
}

3.1.1.5.4.8.2 "Index offset" specification for table state (Index group 0xA100 +
ID)
Index offset Access Table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x0000000A Read every INT32 1 ≥0 'User Counter' Cannot be
(number of table user) traced by
oscilloscope!

TwinCAT 3 Version: 1.1.0 153


Target systems

3.1.1.5.4.8.3 "Index offset" specification for table functions (Index group 0xA200
+ ID)
Index offset Access Table type Data type Phys. Definition Description Remarks
(Hex) unit range
0x00010000 Write every { Generates table with Table types:
dimension (n*m): 1,2,3,4
UINT32 1 s. ENUM (>0) Dimension: at
Table type [} 166] (s.
least 2x1
appendix)
UINT32 1 [2...16777216] Quantity of lines
UINT32 1 [1...16777216] Quantity of columns
}

0x00010001 Write valve diagram { Generates valve diagram Table types: 1,3
table with dimension Dimension: at
(n*m): least 2x1
UINT32 1 s. ENUM (>0) Table type [} 166] (s.
appendix)
UINT32 1 [2...16777216] Quantitiy of lines
UINT32 1 [1...16777216] Quantitiy of columns
}

0x00010010 Write "Motion { Generates "Motion Table types: 3,4


Function" Function" table with Dimension: at
(law of motion) dimension (n*m): least 2x1
UINT32 1 s. ENUM (>0) Table type (s. appendix)
UINT32 1 [2...16777216] Quantity of lines
UINT32 1 [1...16777216] Quantity of columns
}

0x00020000 Write every VOID Deletes table with Table types:


dimension (n*m) 1,2,3,4
0x00030000 Write every VOID Initialized table
Initialization is no longer
needed, because now it
happens automatically in
the following casesa) by
coupling with table b) by
selecting the slave
position (s. table para.)

3.1.1.5.4.9 Appendix

Enum Channel types


Define Channel types
1 Standard
2 Interpreter
3 FIFO
4 Kinematic transformation

Enum Interpreter types


Define Interpreter types
0 NOT DEFINED
1 NC Interpreter DIN 66025 (GST)
2 NC Interpreter DIN 66025 (Classic Dialect)

154 Version: 1.1.0 TwinCAT 3


Target systems

Enum Interpreter Operation modes


Define interpreter/channel operation mode
0x0 Default (deactivates the other modes)
0x1 Single block mode in the NC core (Block execution task/SAF)
0x1000 reserved
0x2000 reserved
0x4000 Single block mode in the interpreter

Enum Interpolation load log mode


Define Load log mode
0 Loader log off
1 Source only
2 Source & Compiled

Enum Interpolation Trace mode


Define Trace mode
0 Trace off
1 Trace line numbers
2 Trace Source

Enum Interpreter state

moved to: System Manager interface for the interpreter - interpreter element

Enum Group types


Define Group types
0 NOT DEFINED
1 PTP-Group + x Slave
2 1D-Group + x Slave
3 2D-Group + x Slave
4 3D-Group + x Slave
5 High/low speed + x Slave
6 Low cost stepper motor (dig. IO) + x Slave
7 Table Group + x Slave
9 Encoder Group + x Slave
11 FIFO Group + x Slave
12 Kinematic Transformation Group + x Slave

Enum Curve velocity reduction method

moved to: System Manager interface for the interpreter - group element

Enum Axis types


Define Axis types
0 NOT DEFINED
1 Continuous axis (Servo)
2 Discrete axis (high/low speed)
3 Continuous axis (stepper motor)
5 Encoder axis
6 Continuous axis (with operation mode switch for position/pressure
control)
7 Time Base Generator
100

TwinCAT 3 Version: 1.1.0 155


Target systems

Enum Stepper motor operation mode


Define Stepper motor operation mode
0 NOT DEFINED
1 2-phase excitation (4 cycles)
2 1-2-phase excitation (6 cycles)
3 Power section

Enum Override types for PTP axes (velocity override)


Define Override types
1 Reduced
Old variant, replaced by "(3) Reduced (iterated)"
2 Original
Old variant, replaced by "(4) Original (iterated)"
3 Reduced (iterated)
Default value: the override value is related to the velocity which is
internally reduced in a special case. This results in a directly
proportional velocity (=> linear relationship) for the entire override
range from 0 to 100%.
4 Original (iterated)
The override value is always referred to the velocity programmed
by the user. If this velocity cannot be driven, however, then a
maximum override value results from which no higher velocity can
be reached (=> limitation).

Enum Group/axis start types


Define Group/axis start types
0 NOT DEFINED
1 Absolute start
2 Relative start
3 Continuous start positive
4 Continuous start negative
5 Modulo start (OLD)
261 Modulo start on the shortest distance
517 Modulo start in positive direction (with modulo tolerance window)
773 Modulo start in negative direction (with modulo tolerance window)
4096 Stop and lock (axis locked for motion commands)
8192 Halt (without motion lock)

Enum Command buffer types (buffer mode) for universal axis start (UAS)
Define Buffer mode
0 ABORTING (default) (instantaneous, aborts current movement and
deletes any buffered commands)
1 BUFFERED
(stored in command buffer to be executed after an active
movement)
18 BLENDING LOW
(buffered, no stop, runs through intermediate target position at the
lowest velocity of two commands)
19 BLENDING PREVIOUS
(buffered, no stop, runs through intermediate target position at the
velocity of the active command)
20 BLENDING NEXT
(buffered, no stop, runs through intermediate target position at the
velocity of the buffered command)
21 BLENDING HIGH
(buffered, no stop, runs through intermediate target position at the
highest velocity of two commands)

156 Version: 1.1.0 TwinCAT 3


Target systems

Enum End position types (new end position)


Define End position types
0 NOT DEFINED
1 Absolute position
2 Relative position
3 Continuous position positive
4 Continuous position negative
5 Modulo position

Enum Command types for new end position with new velocity (new end position and/or new velocity)
Define Command types for new end position with new velocity
0 NOT DEFINED
1 Position (instantaneous)
2 Velocity (instantaneous)
3 Position and velocity (instantaneous)
9 Position (switching position)
10 Velocity (switching position)
11 Position and velocity (switching position)

Enum Actual position types (set actual position)


Define Actual position types
0 NOT DEFINED
1 Absolute position
2 Relative position
5 Modulo position

Enum Compensation types (section compensation or superimposed)


Define Compensation types
0 NOT DEFINED
1 VELOREDUCTION_ADDITIVEMOTION
The max. velocity VelocityDiff is reduced. The path over which the
compensation trip is effective consists of length + distance.
2 VELOREDUCTION_LIMITEDMOTION
The max. velocity VelocityDiff is reduced. The path over which the
compensation trip is effective is defined by the Length parameter.
3 LENGTHREDUCTION_ADDITIVEMOTION
The max. available path is reduced and consists of length +
distance. The system tries to utilize the max. veloc. VelocityDiff.
4 LENGTHREDUCTION_LIMITEDMOTION
The max. available path is reduced and is limited by the Length
parameter. The system tries to utilize the max. veloc. VelocityDiff.

TwinCAT 3 Version: 1.1.0 157


Target systems

Enum Slave types


Define Slave types
0 NOT DEFINED
1 Linear
2 Flying saw (velocity, jerk restricted profile)
3 Flying saw (position and velocity, jerk restricted profile)
5 Synchronization generator (velocity, jerk restricted profile)
6 Synchronization generator (position and velocity, jerk restricted
profile)
10 Tabular
11 Multi-tabular
13 'Motion Function' (MF)
15 Linear with cyclic gearing factor change (ramp filter for acceleration
limits)
100 Specific

Enum Slave decoupling types (for subsequent axis command)


Define Slave decoupling types (for subsequent axis command)
0 Stop, E-stop or P-stop (default)
(STOP)
1 Oriented stop (O-stop)
(ORIENTEDSTOP)
2 Reduce any acceleration to 0 (force-free) and continue to endless
target position
(ENDLESS)
3 Continue to endless target position at new requested velocity
(ENDLESS_NEWVELO)
4 New end position
(NEWPOS)
5 New end position and new requested velocity
(NEWPOSANDVELO)
6 Logical decoupling and stopping of axis immediately without
velocity ramp
(INSTANTANEOUSSTOP)

158 Version: 1.1.0 TwinCAT 3


Target systems

Enum Controller types


Define Controller types
0 NOT DEFINED
1 P-controller (standard)
(Position)
2 PP-controller (with ka)
(Position)
3 PID-controller (with ka)
(Position)
5 P-controller
(Velocity)
6 PI controller
(Velocity)
7 High/low speed controller
(Position)
8 Stepper motor controller
(Position)
9 SERCOS controller
(Position in the drive)
10 RESERVED
11 RESERVED
12 RESERVED
13 RESERVED
14 TCom Controller (Soft Drive)
(Position in the drive)

Enum Controller Observer mode


Define Controller observer mode
0 No observer active (default)
1 "Luenberger" observer (classic observer design)

TwinCAT 3 Version: 1.1.0 159


Target systems

Enum Encoder types


Define Encoder types
0 NOT DEFINED
1 Simulation Encoder
(Incremental)
2 M3000 Encoder (Multi/Single-Turn)
(Absolute)
3 M31x0 / M2000 Encoder
(Incremental)
4 MDP 511 Encoder: EL7041, EL7342, EL5101, EL5151, EL2521,
EL5021, IP5101
(Incremental)
5 MDP 500/501 Enc.: EL5001, IP5009, KL5001 (SSI)
(Absolute)
6 MDP 510 Encoder: KL5051, KL2502-30K Encoder (BiSSI)
(Incremental)
7 KL30xx Encoder (Analog)
(Absolute)
8 SERCOS and EtherCAT SoE (Position)
(Incremental)
9 SERCOS and EtherCAT SoE (Position and velocity)
(Incremental)
10 Binary encoder (0/1)
(Incremental)
11 M2510 Encoder
(Absolut)
12 FOX50 Encoder
(Absolute)
14 AX2000 (Lightbus)
(Incremental)
15 Provi-Drive MC (Simodrive 611U)
(Incremental)
16 Universal encoder (variable bit mask)
(Incremental)
17 NC rear panel
(Incremental)
18 Special CANopen type (e.g. Lenze Drive 9300)
(Incremental)
19 MDP 513 (DS402): CANopen and EtherCAT CoE (AX2xx-B1x0/
B510, EL7201)
(Incremental)
20 AX2xx-B900 (Ethernet)
(Incremental)
21 KL5151 Encoder
(Incremental)
24 IP5209 Encoder
(Incremental)
25 KL2531/KL2541 Encoder (Stepper Motor)
(Incremental)
26 KL2532/KL2542 Encoder (DC motor), KL2535/KL2545 (PWM
current terminal)
(Incremental)
27 Time base encoder (Time Base Generator)
(Incremental)
28 TCom Encoder (Soft Drive)
(Incremental)

160 Version: 1.1.0 TwinCAT 3


Target systems

Enum Encoder mode


Define Encoder mode
0 NOT DEFINED
1 Determination of position
2 Determination of position and velocity
3 Determination of position, velocity and acceleration

Enum Encoder evaluation direction (log. counting direction)


Define Encoder evaluation direction (log. counting direction)
0 Evaluation in positive and negative counting direction (default
configuration, i.e. compatible with the previous state)
1 Evaluation only in positive counting direction
2 Evaluation only in negative counting direction
3 Evaluation neither in positive nor in negative counting direction
(evaluation blocked)

Not for all encoder types; only for KL5101, KL5151, KL2531, KL2541, IP5209, Universal encoder,
etc.

Encoder types
Encoder evaluation direction KL5101, ... Universal Encoder other types
(log. counting direction)
0: positive and negative √ √ —
1: only positive √ √ —
2: only negative √ √ —
3: blocked √ √ —

Enum Encoder sign interpretation (data type)


Define Sign interpretation (data type) of the encoder actual incre-
ments
0 NOT DEFINED (default configuration, i.e. compatible with the
previous state)
1 UNSIGNED: unsigned interpretation of the encoder actual
increments
2 SIGNED: signed interpretation of the encoder actual increments

For KL30xx/KL31xx only for the time being

Enum Encoder absolute dimensioning system


Define Encoder absolute dimensioning system
0 INC: Incremental absolute dimension system with underflow and
overflow offset (default, i.e. compatible with the previous state)
1 ABS: Absolute dimension system without underflow and overflow
offset (no underflow or overflow of the encoder allowed)
2 ABS MODULO: Conditionally absolute dimension system, since it
has underflow and overflow offset (absolute value that modulo
(endless) continues)

Not for all encoder types; only for Profi Drive MC, M3000, KL5001/EL5001, IP5009, SERCOS,
UNIVERSAL, etc.

TwinCAT 3 Version: 1.1.0 161


Target systems

Enum referencing mode for incremental encoder


Define Parameter text Referencing mode for incremental encoder
0 Default NOT DEFINED (default assignment, i.e. compatible with the
previous status)
1 Homing Sensor Only (PLC cam or digital input) Latch event: shutdown of the PLC cam (negative edge)
2 Hardware Sync (feedback reference pulse) Latch event: hardware sync pulse (zero track)
3 Hardware Latch 1 (pos. Edge) Latch event: external hardware latch with positive edge (measuring
probe or, respectively, measurement on the fly with positive edge)
4 Hardware Latch 1 (neg. Edge) Latch event: external hardware latch with negative edge
(measuring probe or, respectively, measurement on the fly with
negative edge)
5 Software Sync Latch event: synthetically emulated software sync pulse (software
zero track); PREREQUISITE: absolute per motor revolution, e.g.
resolver!
6 Hardware Latch 1 (pos. Edge), Drive defined Latch event: hardware latch event defined in the drive with positive
edge (e.g. for SoftDrive)
7 Hardware Latch 1 (neg. edge), Drive defined Latch event: hardware latch event defined in the drive with
negative edge (e.g. for SoftDrive)
20 Application (PLC code) User-specific implementation of referencing (PLC code): user
request is signaled to the PLC by means of the ApplicationRequest
bit

: latch event
Encoder types 0: not defined 1: PLC cam (neg. 2: hardware sync 3: external hard- 4: external hard- 5: software sync
edge) pulse (zero/C- ware latch with ware latch with pulse (software
track) pos. edge neg. edge zero track)
AX2xxx-B200 — √ √ √ √ √ (resolver only)
(Lightbus)
AX2xxx-B510 — √ — — — √
(CANopen) (resolver only)
(see "Reference
mask" parameter)
AX2xxx-B1x0 — √ √ √ √ √
(EtherCAT) (resolver only)
(fixed 20-bit)
AX2xxx-B900 — √ √ √ √ √ (resolver only)
(Ethernet)
Sercos — √ √ √ √ √ (see "Reference
(AX5xxx specific mask" parameter)
implemented)
Profi Drive — √ √ √ √ √
KL5101 — √ √ √ √ √
IP5109
KL5111 — √ √ — — √
KL5151 — √ √ √ √ √ (not meaningful)
IP5209 — √ √ — — √ (not meaningful)
CANopen (e.g. — √ — √ (input E1) √ (input E2) √ (resolver only)
Lenze) (fixed 16-bit)
other types — — — — — —

Enum Homing Sensor Source

The parameter sets the source of the digital input of the referencing cam (homing sensor). At the same time
it is determined whether the signal is Active High or Active Low.

162 Version: 1.1.0 TwinCAT 3


Target systems

Define Parameter text Homing Sensor Source


0 Default: PLC cam (MC_Home) Referencing cam is provided by the PLC. Input
bCalibrationCam of the MC_Home function block.
1 Digital Input 1 (Active High), device Drive->Inputs->nState8.bit0
dependent mapping or E1 of MDP703/733 device
e.g. 7031,7041,7201,7411
2 Digital Input 2 (Active High), device Drive->Inputs->nState8.bit1
dependent mapping or E2 of MDP703/733 device
e.g. L7031,7041,7201,7411
3 Digital Input 3 (Active High) Drive->Inputs->nState8.bit2
4 Digital Input 4 (Active High) Drive->Inputs->nState8.bit3
5 Digital Input 5 (Active High) Drive->Inputs->nState8.bit4
6 Digital Input 6 (Active High) Drive->Inputs->nState8.bit5
7 Digital Input 7 (Active High) Drive->Inputs->nState8.bit6
8 Digital Input 8 (Active High) Drive->Inputs->nState8.bit7
9 Digital Input 1 (Active Low), device Drive->Inputs->nState8.bit2
dependent mapping
10 Digital Input 2 (Active Low), device Drive->Inputs->nState8.bit0
dependent mapping or E1 of MDP703/733 device
e.g. L7031,7041,7201,7411
11 Digital Input 3 (Active Low) Drive->Inputs->nState8.bit1
or E2 of MDP703/733 device
e.g. L7031,7041,7201,7411
12 Digital Input 4 (Active Low) Drive->Inputs->nState8.bit2
13 Digital Input 5 (Active Low) Drive->Inputs->nState8.bit3
14 Digital Input 6 (Active Low) Drive->Inputs->nState8.bit4
15 Digital Input 7 (Active Low) Drive->Inputs->nState8.bit5
16 Digital Input 8 (Active Low) Drive->Inputs->nState8.bit6

Digital Input [1-8]

A digital input linked to the NC process is used. For this purpose, a general Drive Status Byte with 8 digital
inputs is defined in the process image (Drive->Inputs->nState8), which can serve as a signal source for the
homing sensor. A digital input to be used must therefore be mapped manually to the desired position in this
byte.

The digital inputs 1 and 2 may differ depending on the hardware used. For the MDP703/733
hardware (e.g. EL7031, EL7041, EL7201, EL7411) the direct digital inputs E1 and E2 of the
terminal are used instead, which are located in the Drive.nState2 byte of the terminal at bit position
3 (E1) and 4 (E2). The lower two bits of Drive.nState8 are not assigned in this case.

TwinCAT 3 Version: 1.1.0 163


Target systems

Enum Drive types


Define Drive types
0 NOT DEFINED
1 Analog Servo Drive: M2400 DAC 1
(Analog)
2 Analog Servo Drive: M2400 DAC 2
(Analog)
3 Analog Servo Drive: M2400 DAC 3
(Analog)
4 Analog Servo Drive: M2400 DAC 4
(Analog)
5 MDP 252 Drive: Analog Servo Drive: KL4xxx, KL2502-30K
(Analog)
6 MDP 252 Drive: Analog Servo Drive (non-linear): KL4xxx,
KL2502-30K
(Analog)
7 High/low speed drive
(Digital)
8 Stepper motor drive
(Digital)
9 SERCOS-Drive
(Digital)
10 MDP 510 Drive: KL5051 (BiSSI-Interface)
(Digital)
11 AX2000 (Lightbus)
(Digital)
12 Provi-Drive MC (Simodrive 611U)
(Digital)
13 Universal Drive
(Analog)
14 NC rear panel
(Analog)
15 Special CANopen type (e.g. Lenze Drive 9300)
(Digital)
16 MDP 742 (DS402): CANopen and EtherCAT CoE (AX2xx-B1x0/
B510)
(Digital)
17 AX2xx-B900 Drive (Ethernet)
(Digital)
20 KL2531/KL2541 Encoder (Stepper Motor)
(Digital)
21 KL2532/KL2542 Encoder (DC motor), KL2535/KL2545 Encoder
(PWM current terminal)
(Digital)
22 TCom Drive (Soft Drive)
(Digital)
23 MDP 733 Drive: Profile MDP 733 (EL7332, EL7342, EP7342)
(Digital)
24 MDP 703 Drive: Profile MDP 703 (EL7031, EL7041, EP7041)
(Digital)

Enum Drive-Output-Start types


Define Enum Drive-Output-Start types
0 NOT DEFINED
1 Output value in percent
2 Output as velocity, e.g. m/min

164 Version: 1.1.0 TwinCAT 3


Target systems

Enum Drive Operation Mode


Define Drive Operation Mode (generic operation modes independent
from drive)
0 DEFAULT Mode
(reactivates the NC default operation mode if mode is known)
1 (standard type) torque control
2 (standard type) velocity control with feedback 1
3 (standard type) velocity control with feedback 2
4 (standard type) position control with feedback 1 (lag less)
5 (standard type) position control with feedback 2 (lag less)
6 (CANopen/CoE specific) torque control with commutation angle
17 (oversampling type) torque control using dynamic container
18 (oversampling type) velocity control with feedback 1 using dynamic container
19 (oversampling type) velocity control with feedback 2 using dynamic container
20 (oversampling type) position control with feedback 1 (lag less) using dynamic container
21 (oversampling type) position control with feedback 2 (lag less) using dynamic container
38 (CANopen/CoE specific) IO drive controlled homing mode (for third party devices)
100 (Sercos/SoE specific) Sercos/SoE primary operation mode 0 (s. S-0-0032)
101 (Sercos/SoE specific) Sercos/SoE secondary operation mode 1 (s. S-0-0033)
102 (Sercos/SoE specific) Sercos/SoE secondary operation mode 2 (s. S-0-0034)
103 (Sercos/SoE specific) Sercos/SoE secondary operation mode 3 (s. S-0-0035)
104 (Sercos/SoE specific) Sercos/SoE secondary operation mode 4 (s. S-0-0284)
105 (Sercos/SoE specific) Sercos/SoE secondary operation mode 5 (s. S-0-0285)
106 (Sercos/SoE specific) Sercos/SoE secondary operation mode 6 (s. S-0-0286)
107 (Sercos/SoE specific) Sercos/SoE secondary operation mode 7 (s. S-0-0287)

Enum Moving phases / Movement state for master axes


Define Moving phases / Movement state (distinction between internal
and external setpoint generation)
Internal setpoint generation
0 Setpoint generator not active (INACTIVE)
1 Setpoint generator active (RUNNING)
2 Velocity override is zero (OVERRIDE_ZERO)
3 Constant velocity (PHASE_VELOCONST)
4 Acceleration phase (PHASE_ACCPOS)
5 Deceleration phase (PHASE_ACCNEG)
External setpoint generation:
41 External setpoint generation active (EXTSETGEN_MODE1)
42 Internal and external setpoint generation active
(EXTSETGEN_MODE2)

Enum Moving phases / Movement state for slave axes


Define Moving phases / Movement state
0 Slave generator not active (INACTIVE)
11 Slave is in a movement pre-phase (PRE-PHASE)
12 Slave is synchronizing (SYNCHRONIZING)
13 Slave is synchronized and moves synchronously (SYNCHRON)

Only for slaves of the type synchronization generator for the time being

TwinCAT 3 Version: 1.1.0 165


Target systems

Enum Table main types


Define Table main types
1 (n*m) Cam plate tables (Camming)
10 (n*m) Characteristic curves tables (Characteristics) (e.g. hydraulic
valve characteristic curves)
Only non-cyclic table sub-types (1, 3) are supported!
16 (n*m) "Motion Function" tables (MF)
Only non-equidistant table sub-types (3, 4) are supported!

Enum Table sub-types


Define Table sub types
1 (n*m) Table with equidistant master positions and no cyclic
continuation of the master profile (equidistant linear)
2 (n*m) Table with equidistant master positions and cyclic
continuation of the master profile (equidistant cyclic)
3 (n*m) Table with non-equidistant, but strictly monotonously
increasing master positions and a non-cyclic continuation of the
master profile (monotonously linear)
4 (n*m) Table with non-equidistant, but strictly monotonously
increasing master positions and a cyclic continuation of the master
profile (monotonously cyclic)

Enum Table interpolation types


Define Table interpolation types between the reference points
0 Linear interpolation (NC_INTERPOLATIONTYPE_LINEAR)
(Standard)
1 4-point interpolation (NC_INTERPOLATIONTYPE_4POINT) (for
equidistant table types only)
2 Cubic spline interpolation of all reference points ("global spline")
(NC_INTERPOLATIONTYPE_SPLINE
3 Sliding cubic spline interpolation via n interpolation points ("local
spline") (NC_INTERPOLATIONTYPE_SLIDINGSPLINE)

Enum table operation mode


Define Table operation mode for adding, exchange and removal of ta-
bles
0 (default)
1 Additive – addition of a further table
2 Exchange – replacement of an existing table with a new table
3 Remove – removal of an existing table

166 Version: 1.1.0 TwinCAT 3


Target systems

Structure of tabular (cam) coupling informationen


Tables (CAM) Coupling information
nTableID; 1. cam table ID
nTableMainType; 2. e.g. CAMMING, CHARACTERISTIC,
MOTIONFUNCTION
nTableSubType; 3. e.g. EQUIDIST_LINEAR,
EQUIDIST_CYCLE,
NONEQUIDIST_LINEAR,
NONEQUIDIST_CYCLE
nInterpolationType; 4. e.g. LINEAR, 4POINT, SPLINE

nNumberOfRows; 5. number of rows/elements


nNumberOfColumns; 6. number of columns
fMasterCamStartPos 7. master camming start position (first point in
tabular)
fSlaveCamStartPos 8. slave camming start position (first point in
tabular)
fRawMasterPeriod; 9. master period/cycle (raw value, not scaled)
fRawSlaveStroke; 10. slave difference per master period/cycle
(raw value, not scaled)
fMasterAxisCouplingPos 11. total absolute master offset of cam origin
when slave has been coupled
fSlaveAxisCouplingPos 12. total absolute slave offset of cam origin
when slave has been coupled
nMasterAbsolute 13. master absolute position (0/1)
nSlaveAbsolute 14. slave absolute position (0/1)
fMasterOffset; 15. total master offset
fSlaveOffset; 16. total slave offset
fMasterScaling; 17. total master scaling
fSlaveScaling; 18. total slave scaling
fSumOfSlaveStrokes 19. sum of the slave srokes up to
“fActualMasterAxisPos”
fSumOfSuperpositionDistance 20. sum of superposition distance (position
compensation offset)
fActualMasterAxisPos; 21. actual master axis setpos (absolute)
fActualSlaveAxisPos; 22. actual slave axis setpos (absolute)
fActualMasterCamPos; 23. actual master cam setpos
fActualSlaveCamPos; 24. actual master cam setpos
nSlaveStateDWord 25. slave state DWORD (s. AxisRef)
... ... ...

TwinCAT 3 Version: 1.1.0 167


Target systems

Structure of the characteristic values


Characteristic values
fMasterVeloNom; 1. master nominal velocity (standardized: =>
1.0)
fMasterPosStart; 2. master start position
fSlavePosStart; 3. slave start position
fSlaveVeloStart; 4. slave start velocity
fSlaveAccStart; 5. slave start acceleration
fSlaveJerkStart; 6. slave start jerk
fMasterPosEnd; 7. master end position
fSlavePosEnd; 8. slave end position
fSlaveVeloEnd; 9. slave end velocity
fSlaveAccEnd; 10. slave end acceleration
fSlaveJerkEnd; 11. slave end jerk
fMPosAtSPosMin; 12. master pos. at slave min. position
fSlavePosMin; 13. slave minimum position
fMPosAtSVeloMin; 14. master pos. at slave min. velocity
fSlaveVeloMin; 15. slave minimum velocity
fMPosAtSAccMin; 16. master pos. at slave min. acceleration
fSlaveAccMin; 17. slave minimum acceleration
fSVeloAtSAccMin; 18. slave velocity at slave min. acceleration
fSlaveJerkMin; 19. slave minimum jerk
fSlaveDynMomMin; 20. slave minimum dynamic momentum (NOT
SUPPORTED YET!)
fMPosAtSPosMax; 21. master pos. at slave max. position
fSlavePosMax; 22. slave maximum position
fMPosAtSVeloMax; 23. master pos. at slave max. velocity
fSlaveVeloMax; 24. slave maximum velocity
fMPosAtSAccMax; 25. master pos. at slave max. acceleration
fSlaveAccMax; 26. slave maximum acceleration
fSVeloAtSAccMax; 27. slave velocity at slave max. acceleration
fSlaveJerkMax; 28. slave maximum jerk
fSlaveDynMomMax; 29. slave minimum dynamic momentum (NOT
SUPPORTED YET!)
fSlaveVeloMean; 30. slave mean absolute velocity
fSlaveAccEff; 31. slave effective acceleration
nCamTableID; 32. Cam table ID
nNumberOfRows; 33. Number of rows/entries e.g. number of
points
nNumberOfColums; 34. Number of columns (typically1 or 2)
nCamTableType; 35. cam table type (10=EQUIDIST,
11=NONEQUIDIST, 22=MOTIONFUNC,
23=CHARACTERISTIC)
nPeriodic; 36. linear or cyclic/periodic
nReserved 37. reserved

Enum Axis control loop switch types


Define Axis control loop switch types
0 NOT DEFINED
1 Simple switching (similar to an axis reset)
(STANDARD)
2 Switching/synchronization by means of I/D-part of the controller to
an internal initial value (jerk-free/smooth)
3 Switching/synchronization by means of I/D-part of the controller to
a parameterizable initial value

168 Version: 1.1.0 TwinCAT 3


Target systems

3.1.2 AmsNAT

3.1.2.1 Introduction
For a better understanding of the AmsNAT function it is important to know the difference between ADS and
AMS and to know what an ADS route is.

ADS (Automation Device Specification) is the TwinCAT communication protocol that specifies the interaction
between two ADS devices. For example, it defines what operations can be executed on another ADS device,
what parameters are necessary for that and what return value is sent after execution.

AMS (Automation Message Specification) specifies the exchange of the ADS data. A major component of
the communication protocol is the AmsNetId. This is specified in the AMS/ADS package for the source and
target device. An ADS device can be explicitly addressed using the AmsNetId.

A route between two devices must be setup in TwinCAT so that they can communicate. This route is
configured on both sides and typically contains the route name, the AmsNetId and the address of the
communication partner as well as the type of connection. The configuration of new routes and an overview of
existing routes in a TwinCAT system are shown in the following figure.

If the hardware should be scanned on the target, relative NetIDs have to be used:

TwinCAT 3 Version: 1.1.0 169


Target systems

3.1.2.2 General description


The AmsNAT function enables XAE systems to establish routes to two or more controllers having the same
AmsNetId (Figure 2). Beyond that, AmsNAT offers a solution with which different ADS devices with the same
AmsNetId can communicate with one another via ADS. Virtual AmsNetIds are used with AmsNAT. A virtual
AmsNetId is a unique address for a connected ADS device that is replaced by the real AmsNetId of the
target system during communication. This means that the AmsNAT function ensures, in all communication
that takes place via ADS, that the AmsNetId of the target system is replaced.

170 Version: 1.1.0 TwinCAT 3


Target systems

Fig. 1: Communication with/between TwinCAT systems with the same NetId

3.1.2.3 Motivation
A frequently occurring application in series mechanical engineering is the cloning (i.e. the making of a 1:1
copy) of a controller. When using TwinCAT, the result of this is that all cloned instances possess the same
AmsNetId. This is not a problem at first. However, if the cloned instances are to be connected in parallel with
the same engineering system or are to communicate with one another by ADS, this is initially impossible
because the AmsNetId is not unique. The AmsNAT function removes precisely this restriction by virtue of the
fact that the systems work with virtual AmsNetIds. These can be configured with very little effort.

The AmsNAT function can be used for any route to an ADS device. This provides a high degree of flexibility
and the AmsNetIds no longer have to be adapted to the machine computers, which leads to a significant
reduction in time and effort for configuration.

3.1.2.4 Functioning
The way AmsNAT functions will now be explained on the bases of a typical application. In the application
case, a TwinCAT engineering system and two TwinCAT runtimes exist with the same AmdNetId and IP
address. The configuration is illustrated in Figure 3. The engineering system is to send an AdsRead
command to PLC 1, from which a corresponding response is expected. Since both runtimes possess an

TwinCAT 3 Version: 1.1.0 171


Target systems

identical IP address, two IP NATs are additionally used. Their task is to implement unambiguous addressing.
In order to do so, the first three positions of the local IP address are replaced by the first three positions of
the global IP address or vice versa, depending on the direction of communication.

In the first step of the application example, the engineering system sends an AdsRead command to PLC 1.
Since this AmdNetId is a virtual one, the TwinCAT system service replaces it by the remote AmsNetId
5.19.8.122.1.1 with the help of its routing table. This is the real AmsNetId existing on the system. It is entered
in the field "AmsNetId Target" of the AMS packet.

Fig. 2: Sequence for sending an AdsRead command using AmsNAT

The TwinCAT system service of PLC 1 relays the AMS packet unchanged. PLC 1 executes the AdsRead
command and then sends the corresponding response to the engineering system. Figure 4 shows the
communication sequence for the response.

Fig. 3: Sequence for sending the response to an AdsRead command

172 Version: 1.1.0 TwinCAT 3


Target systems

For the response, the TwinCAT system service of PLC 1 initially relays the AMS packet unchanged. It
subsequently reaches the TwinCAT system service of the engineering system. Since the real AmsNetId of
PLC 1 is entered in the field "AmsNetId Source" of the AMS packet, it must be replaced by the virtual
AmsNetId on the basis of the routing table. The engineering system can then clearly assign and process the
response.

When using the AmsNAT function the transmitted data are not changed, only the AMS header. Therefore it
should be noted that if configuration data contain the AmsNetId this can lead to the virtual AmsNetId being
used. One possibility for the engineering of I/O devices is the use of relative AmsNetIds. In this case the last
two characters of the AmsNetId are taken into account and the first four characters are ignored.

3.1.2.5 Configuration
To configure AmsNAT, open the file StaticRoutes.xml, which is located in the TwinCAT installation directory
under the path TwinCAT\3.1\Target. In this file, define the attribute "RemoteNetId" for each route as shown
subsequent.
<?xml version="1.0" encoding="UTF-8"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2015/12/TcConfig">
<RemoteConnections>
<Route>
<Name>CX-111111</Name>
<Address>10.0.10.8</Address>
<NetId RemoteNetId="5.19.8.122.1.1">10.0.10.8.1.1</NetId>
<Type>TCP_IP</Type>
</Route>
<Route>
<Name>CX-222222</Name>
<Address>10.0.20.8</Address>
<NetId RemoteNetId="5.19.8.122.1.1">10.0.20.8.1.1</NetId>
<Type>TCP_IP</Type>
</Route>
</RemoteConnections>
</TcConfig>

The actual AmsNetId assigned to the remote ADS device is specified with the attribute "RemoteNetId". It
does not have to be unique. Only the AmsNetId of the target system defined in the field <NetId> is known in
the TwinCAT system with configured AmsNAT function.

Restart the TwinCAT system service in order to activate the preset configuration of the AmsNAT function. To
do this, switch the TwinCAT system from Run mode to Config mode. If TwinCAT is already in Config mode,
reopen this in order to load the settings made.

3.1.3 ADS-over-MQTT

3.1.3.1 Overview
Beckhoff ADS (Automation Device Specification) is a communication protocol developed by Beckhoff for
efficient data exchange in industrial automation systems. It serves as the backbone for the integration of
devices and software into the PC-based control technology from Beckhoff.

From the perspective of the ADS protocol, ADS-over-MQTT is an additional transport channel over which
ADS can be transported. Decoupling communication via an MQTT message broker results in a number of
advantages, particularly in terms of scalability and flexibility when integrating additional ADS applications.
Security mechanisms such as TLS can be used at the transport layer to secure the communication
connection.

With ADS-over-MQTT, the entire data exchange is transparent for the ADS applications, because only the
ADS router needs to know and hold the corresponding information on the MQTT transport channel. In
particular, this also enables easy retrofitting for existing applications.

The main use case for ADS-over-MQTT is a classic remote maintenance and remote diagnostics scenario,
where the TwinCAT engineering environment (TwinCAT XAE) needs to connect to one or more controllers
for remote debugging. The following diagram illustrates the architecture being created here.

TwinCAT 3 Version: 1.1.0 173


Target systems

However, there are many other use cases for ADS-over-MQTT, especially when it comes to the aggregation
of multiple distributed PLC systems.

This document provides an overview of the usage possibilities as well as a technical description of how a
"virtual ADS network" can be configured over an MQTT message broker.

Benefits of an MQTT-based ADS network


• Subnets, NAT-based networks and firewalls:
Incoming TCP/IP connections are used in both directions in a classic ADS setup. This makes it
necessary for the devices to be located in the same network in the normal case. In distributed systems
with different subnets this leads to complex configurations in order to make the ADS routes available.
In the case of MQTT-based ADS networks, only an outgoing TCP/IP connection is used by the
devices. This allows the broker in the higher-level network to broker between all devices. Due to the
outgoing connections, a typical firewall can be used and no incoming ports need to be registered.

174 Version: 1.1.0 TwinCAT 3


Target systems

• Access control:
After creating the appropriate routes, bidirectional communication can be executed in a classic ADS
setup. An access by device A, which accesses B, also allows device B to access A. The MQTT-based
ADS network can be configured so that device A can access B, but not the other way around.
• Security / encryption:
The communication from TwinCAT to the broker can be encrypted by TLS (with certificates or
PreSharedKey (PSK)). In this case, the transporting MQTT protocol is encrypted, so the ADS protocol
can be transmitted unencrypted in the payload.
• Retrofitting:
ADS-over-MQTT is transparent for the ADS applications, which means that they do not need to be
changed.

NOTICE
ADS access means full access
As described in Security Advisory 2017-01, ADS offers full access to a device.
Secure ADS offers authorization as well as encryption for the communication; therefore, it represents a
transport encryption. Hence, if an ADS route exists, then full access exists.
Dedicated, role-related access to individual files is offered by solutions such as OPC UA.

3.1.3.2 Installation

3.1.3.2.1 System Requirements


The following system requirements apply for the installation and operation of this product.

Technical data Description


Operating system Windows 10
Windows Server 2022
TwinCAT/BSD
TwinCAT/Linux®
Target platforms PC architecture (x86, x64, Arm®)
TwinCAT version TwinCAT 3 (from Build 4022.0)
TwinCAT installation level TwinCAT 3 XAE, XAR, ADS
Required TwinCAT license ---

MQTT Message Broker


To use this product, an MQTT message broker is required via which the communication connection
is established. Any MQTT message broker can be used, e.g. Mosquitto or HiveMQ. The use of
managed cloud services, such as AWS IoT Core, is also possible.

Plugin for Mosquitto Message Broker


The supplied plugin for the Mosquitto Message Broker is currently only available for the Windows
operating system.

3.1.3.2.2 Installation
The ADS-over-MQTT feature is a fixed part of the basic TwinCAT installation, both on XAE, XAR and ADS
installations, and no further installations are required on the TwinCAT side. To install the MQTT message
broker, please consult the documentation for your message broker software.

TwinCAT 3 Version: 1.1.0 175


Target systems

3.1.3.3 Technical introduction

3.1.3.3.1 Quick Start


This documentation article is intended to allow you an initial, quick start in how to use this product. Carry out
the following steps to establish an ADS-over-MQTT connection to an MQTT message broker and to send
and receive ADS messages.

Message Broker installation


This document assumes that you have a locally installed and working MQTT message broker. As
an example we use the Mosquitto Message Broker here, but you can use any message broker.

Overview

For demonstration purposes, two TwinCAT devices are to establish an ADS-over-MQTT connection with the
message broker. We then use TwinCAT XAE (Engineering) on the first device to establish a connection to
the second system via the ADS-over-MQTT route. To keep the installation scenario as simple as possible,
both devices should be on the same network.

Device 1:
• Mosquitto Message Broker
• TwinCAT 3 XAE

Device 2:
• TwinCAT 3 XAE or XAR

Note the IP address or the host name of Device 1. In the latter case, make sure that the name resolution
works in your network.

Message Broker setup

The Mosquitto Message Broker has been delivered since version 2.x with a configuration that requires
security measures to be set up to ensure secure operation of the message broker. In the following, we will
show you how to modify the Mosquitto Message Broker configuration so that an unsecured communication
connection can be established with the broker. However, this should be done exclusively for testing
purposes in a trusted operating environment. For productive operation, we recommend using a secure
broker configuration.
1. Install the Mosquitto Message Broker on your system.
2. Make a backup of the mosquitto.conf file from the Mosquitto installation directory. This is typically located
at C:\Program Files\mosquitto.
3. Open the mosquitto.conf file with a text editor of your choice and remove the existing content. Add the
following content and save the file.
listener 1883
allow_anonymous true
4. Restart the Mosquitto Message Broker, either via the corresponding Windows service or manually via the
console or mosquitto.exe.
ð You have now configured the Mosquitto Message Broker to listen for incoming client connections on port
1883 and it does not require any security (neither user authentication nor client certificates).

Windows firewall on Device 1


Please enable the standard MQTT port 1883/tcp as an incoming port in the Windows firewall of
Device 1 so that Device 2 can establish a connection to the message broker.

You can now start configuring TwinCAT.

Configuration of the first TwinCAT device

The TwinCAT ADS router on this device should now establish a route to the local message broker. Create a
new XML file, e.g. with Notepad, and insert the following content.

176 Version: 1.1.0 TwinCAT 3


Target systems

<?xml version="1.0" encoding="ISO-8859-1"?>


<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2015/12/TcConfig">
<RemoteConnections>
<Mqtt>
<Address Port="1883">127.0.0.1</Address>
<Topic>VirtualAmsNetwork1</Topic>
</Mqtt>
</RemoteConnections>
</TcConfig>

Save this XML file under any name in the following directory and restart TwinCAT for the changes to take
effect.
\TwinCAT\3.1\Target\Routes

Configuration of the second TwinCAT device

The TwinCAT ADS router on this device should establish a route to the message broker on device 1. Create
a new XML file, e.g. with Notepad, and insert the following content.
<?xml version="1.0" encoding="ISO-8859-1"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2015/12/TcConfig">
<RemoteConnections>
<Mqtt>
<Address Port="1883">%IPAddress%</Address>
<Topic>VirtualAmsNetwork1</Topic>
</Mqtt>
</RemoteConnections>
</TcConfig>

Replace the entry %IPAddress% with the IP address or the host name of device 1. Save this XML file under
any name in the following directory and restart TwinCAT for the changes to take effect.
\TwinCAT\3.1\Target\Routes

Connecting the engineering

Now start TwinCAT XAE on Device 1 and create a new TwinCAT project. Alternatively, you can also open an
existing project. For this tutorial, we only need the toolbar to establish a connection to a remote ADS device.

You will now find TwinCAT Device 2 in the toolbar and can establish a connection to it.

Next steps

After you have successfully established an ADS-over-MQTT connection to the message broker, we
recommend that you reset the Mosquitto Message Broker to its default settings. For this, please take the
backup file of mosquitto.conf that you created in the previous steps. This file, together with the broker
documentation, is a good basis for further steps, e.g. to set up a secure message broker operating
environment considering client/server certificates and user authentication.

3.1.3.3.2 Virtual networks


When configuring ADS-over-MQTT, so-called "virtual networks" can be defined. This allows ADS devices to
be distributed into independent networks. Only the devices within a network can communicate with each
other. At MQTT level, this distribution takes place on the basis of a common basic topic.

TwinCAT 3 Version: 1.1.0 177


Target systems

These virtual networks can be defined at client level using the ADS-over-MQTT configuration file [} 180]
and, if required, access rights can be assigned using the TcMqttPlugin [} 182] for the Mosquitto Message
Broker.

3.1.3.3.3 Communication flow


To enable data exchange and Device Discovery via ADS-over-MQTT, all ADS devices use a uniform topic
structure on the message broker. The topic structure depends on the name of the configured virtual network
[} 177] and the AMS Net ID of the respective device.

Type Topic
Discovery <NetworkName>/<AmsNetId>/info
Communication <NetworkName>/<AmsNetId>/ams
<NetworkName>/<AmsNetId>/ams/res

Each ADS device therefore has its own "topic area" on the message broker. The following figure illustrates
this relationship.

178 Version: 1.1.0 TwinCAT 3


Target systems

Discovery

A connecting TwinCAT ADS router sends a retain message with device information to its discovery topic, at
the same time it subscribes to the topic <NetworkName>/+/info, so that it is informed about all other
connected routers.

The messages to the discovery topic contain an XML structure with device information, for example the host
name and the TwinCAT version used:
<info>
<online name="EC2AMAZ-2RRSQS6" osVersion="10.0.20348" osPlatform="2"
tcVersion="3.1.4026.10">true</online>
</info>

If the message broker does not support retain messages, this can be taken into account in the ADS-over-
MQTT configuration file [} 180]. In this case, a communication handshake would take place instead of a
retain message: a newly connecting device logs on to its discovery topic and all other connected devices
respond with another message on their discovery topic. This ensures that devices can find each other even
with message brokers that do not support retain messages. The disadvantage is an increased volume of
messages in larger operating environments with frequent reconnects.

TwinCAT 3 Version: 1.1.0 179


Target systems

Communication

A TwinCAT ADS router subscribes to its communication topic (<NetworkName>/<AmsNetId>/ams/#)


immediately after the connection is established. The ADS commands to this router are then sent to
<NetworkName>/<AmsNetId>/ams, while the responses are received via the <NetworkName>/<AmsNetId>/
ams/res topic.

3.1.3.3.4 Configuration file


The TwinCAT ADS router is configured by an XML file to establish an ADS-over-MQTT connection with a
message broker. This configuration file is stored under any name in the following directory:
\TwinCAT\3.1\Target\Routes

In the Samples [} 184] chapter, you will find sample configuration files for all the use cases described below.

Activating a new ADS-over-MQTT configuration


New or changed ADS-over-MQTT configurations are only adopted when the TwinCAT ADS router
is initialized. This takes place, for example, in the TwinCAT transitions from RUN to CONFIG or
CONFIG to CONFIG.

Path information
Please ensure that you use the correct spelling for your operating system for any path details in the
configuration file.

Basic configuration

The basic configuration always contains the following elements:


Address of the message broker, its TCP port and the name of the virtual network [} 177].
The address of the broker and the TCP port at which it can be reached are specified via the <Address>
node. The virtual network is defined via the <Topic> node. In the following example, a connection is
established to a locally (127.0.0.1) installed message broker and TCP port 1883. "VirtualAmsNetwork1" is
defined as the virtual network".
<?xml version="1.0" encoding="ISO-8859-1"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2015/12/TcConfig">
<RemoteConnections>
<Mqtt>
<Address Port="1883">127.0.0.1</Address>
<Topic>VirtualAmsNetwork1</Topic>
</Mqtt>
</RemoteConnections>
</TcConfig>

NoRetain

The communication flow [} 178] for device discovery can be customized via the NoRetain attribute. By
setting NoRetain = true, the device search function is no longer based on retain messages. Instead, a
handshake mechanism is used to identify all connected ADS devices.

Unidirectional

Incoming ADS messages can be blocked for this system via the unidirectional attribute. A typical use case
could be an engineering system, for example, which should be able to reach the runtime systems via ADS,
but not vice versa.

180 Version: 1.1.0 TwinCAT 3


Target systems

TLS

The <TLS> node can be used to define settings for securing the transport channel via TLS. Various
connection options are available, e.g. the configuration of client certificates or PSK. Our samples [} 184]
show all possible configuration variants.

TLS IgnoreCn

The IgnoreCn attribute can be used to disable the verification of the CommonName (CN) from the server
certificate.

TLS PSK

When using TLS with a Pre-Shared Key (PSK), you can either specify the PSK as a hex-coded, 64-character
string, or leave the conversion to TwinCAT internally using Sha256(Identity + Pwd). In the latter case, the
IdentityCaseSensitive attribute can be used to specify that TwinCAT should use the identity as the
UpperCase for the calculation. Our samples [} 184] show both possible configuration variants.

User
<?xml version="1.0" encoding="ISO-8859-1"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://www.beckhoff.com/schemas/2015/12/TcConfig">
<RemoteConnections>
<Mqtt>
<Address Port="1883">127.0.0.1</Address>
<Topic>VirtualAmsNetwork1</Topic>
<User>CX-12345</User>
</Mqtt>
</RemoteConnections>
</TcConfig>

The <User> element specifies an identity that can be used in the TcMqttPlugin [} 182] to configure access
rights between ADS devices. However, the identity is usually defined by other means, e.g. the
CommonName (CN) of a client certificate.

Optionally, the <Mqtt> element can contain a ClientId attribute to specify the MQTT ClientID. This is
otherwise formed from the <User> and an arbitrary string.

3.1.3.3.5 Security
There are options for securing the communication. A TLS connection on the basis of X.509 certificates or a
Pre-Shared Key (PSK) can be used for this. It is recommended that communication be secured with TLS
especially when communicating over non-trustworthy networks (e.g. the Internet). In the chapters
Configuration file [} 180] and Samples [} 184] you will find explanations and sample configuration files for
operating ADS-over-MQTT via TLS.

The broker itself must be operated in a trustworthy environment, as all messages on the broker are
unsecured.

TwinCAT 3 Version: 1.1.0 181


Target systems

Compromising of the virtual ADS network


Even when communication between the devices and the broker takes place in encrypted form via
TLS, the devices are not secured among one another. The ADS commands are present on the
broker in unencrypted form.
If a device is compromised, the attacker can execute all ADS commands via the rights gained.
These commands also include file reading operations or operations for starting processes.

Two methods can be used to configure access rights between individual ADS devices:
• Configuration of access rights via Access Control Lists [} 183] (using Mosquitto as an example)
• Configuration of access rights via a plugin [} 182] (only for Mosquitto)

3.1.3.3.5.1 Mosquitto plugin


A plugin was developed especially for the Mosquitto Message Broker to enable the definition of access rights
between the individual TwinCAT ADS routers.
Please also note the system requirements [} 175] for operating this plugin.

The plugin is delivered with the TwinCAT installation under TwinCAT 3.1 Build 4024. Build 4026 requires the
installation of the corresponding package (TwinCAT.XAE.MqttPlugin). The plugin is installed in the following
directory and can be referenced from there in the Mosquitto configuration.
\TwinCAT\AdsApi\TcMqttPlugin

The plugin is available in a 32-bit and a 64-bit version, depending on which version you use of the Mosquitto
Message Broker. The plugin is then integrated into the configuration of the Mosquitto Message Broker as
follows:
auth_plugin <Path>TcMqttPlugin.dll
auth_opt_xml_file <Path>MyACL.xml

The MyACL.xml file contains the access configuration to the broker itself, as well as the configuration of the
communication between the connected TwinCAT ADS routers. This configuration is explained in more detail
in the following section.

Configuration

The plugin offers the option of configuring virtual AMS networks. To do this, specify which device can access
which other device for each target device. In contrast to the classic ADS routes, these connections are
directional: A target therefore does not also have the right to access the source.
<TcMqttAclConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="C:\TwinCAT\3.1\Config\Modules\TcMqttAclConfig.xsd">
<Ams>
<Topic>VirtualAmsNetwork1</Topic>
<User>
<Name>EngineeringStation</Name>
</User>
<User>
<Name>CX-12345</Name>
<Access>EngineeringStation</Access>
</User>
<User>
<Name>CX-56789</Name>
<Access>EngineeringStation</Access>
</User>
</Ams>
</TcMqttAclConfig>

The name of the Ams network is defined within an <Ams> node. It is used in the MQTT topics employed for
the identification of the networks. Individual <User> elements describe the devices. These elements have a
<Name> attribute that describes the MQTT identity with which the connection was established. The identity
can be transferred via various TLS mechanisms, e.g. via the TLS-PSK Identity or the CommonName (CN) of
a client certificate. Our samples [} 184] here show possible configuration variants.

Access-authorized devices are defined via the <Access> element. In the sample above, the
"EngineeringStation" identity has access to two CX devices, but the CX devices do not have access to the
"EngineeringStation" or to each other.

182 Version: 1.1.0 TwinCAT 3


Target systems

The configuration file is reloaded cyclically so that a restart of the broker is not necessary.

Restrictions with regard to the AmsNetId to be registered

With this configuration each validly connected device can assume an arbitrary AmsNetId and thus an identity
from the point of view of ADS. This can be further restricted as required:
<User>
<Name>CX-56789</Name>
<Access>EngineeringStation</Access>
<NetId>192.168.56.1.1.1</NetId>
</User>

As soon as at least one NetId is specified, only one NetId can be registered from this list. An alternative
solution would be to enter the NetId in the CommonName (CN) of the client certificate.

3.1.3.3.5.2 Mosquitto ACL


Many message brokers allow the configuration of Access Control Lists (ACLs) to restrict client interactions to
certain topics. The following chapter shows this configuration using the Mosquitto Message Broker as an
example. The procedure for granting access rights described here differs from that of the TcMqttPlugin
[} 182]. This specifies which other ADS devices have access to an ADS device. With the (Mosquitto) ACL it
is exactly the other way around, because here it is specified for an ADS device which other ADS devices it is
allowed to access.

Overview

The Mosquitto Message Broker allows the configuration of an Access Control List, which is defined as a
separate configuration file and referenced in the main configuration of the broker. This configuration entry is
shown below as an example:
acl_file C:\Program Files\mosquitto\mosquitto.acl

You can also find a complete configuration file in our samples [} 184] for download.

In the ACL file, you can define authorizations for publishing and subscribing to certain topics and specify
them separately for each user. The access rights for a user are always introduced by the following line:
user <username>

Subsequently the reading and writing rights are defined according to the following scheme:
topic [read|write|readwrite] <topicName>

Configuration for ADS-over-MQTT

For ADS-over-MQTT, two things must be ensured according to the communication flow [} 178]: access of all
ADS devices to the discovery topics and sending/receiving via the communication topics.
The ADS device must always have read/write access to its own topic. The device receives read rights for the
discovery topic of other ADS devices.
To exchange ADS messages, an ADS device must have read/write access to the communication topic of the
devices. The ADS device is identified by its own identity on the message broker. This identity can, for
example, originate from a PSK or correspond to the CommonName (CN) of a client certificate. The following
configuration illustrates these relationships.
user <identity>
topic readwrite <VirtualAmsNetworkName>/<OwnAmsNetId>/#
topic read <VirtualAmsNetworkName>/+/info
topic readwrite <VirtualAmsNetworkName>/+/ams/#

If an ADS device is to be denied access to another device, it must be ensured that there are no write
permissions for the topic with the target AmsNetId.

TwinCAT 3 Version: 1.1.0 183


Target systems

The familiar TcMqttPlugin option that an ADS device may register only one AmsNetId is also possible with
the Mosquitto ACL. To do this, the entry <OwnAmsNetId> must be replaced by precisely one foreseen
AmsNetId. If it is to be possible for the ADS device to register with an arbitrary AmsNetId, then the wildcard
(#) has to be set for <OwnAmsNetId>.

The following is an example of the access rights entries for communication between two ADS devices:
user EngineeringStation
topic readwrite VirtualAmsNetwork1/18.153.78.19.1.1/#
topic read VirtualAmsNetwork1/+/info
topic readwrite VirtualAmsNetwork1/+/ams/#
user CX-12345
topic readwrite VirtualAmsNetwork1/3.120.15.8.1.1/#
topic read VirtualAmsNetwork1/+/info
topic readwrite VirtualAmsNetwork1/+/ams/#

3.1.3.4 Samples
Sample code and configurations for this product can be obtained from the corresponding repository on
GitHub: https://github.com/Beckhoff/ADS-over-MQTT_Samples. There you have the possibility to clone the
repository or download a ZIP file with the sample.

3.1.4 Secure ADS

3.1.4.1 General description


From TwinCAT 3.1 Build 4024.0
The functionality described here is available from TwinCAT 3.1. 4024.0.

Secure ADS is an additional transport channel from the point of view of the ADS protocol. Precisely the
same ADS commands are transmitted via a secure connection as via other communication protocols.

To this end a connection encrypted by means of TLSv1.2 is established from one TwinCAT router to
another.

Due to the implementation inside the TwinCAT router, existing applications do not need to be modified. They
can be made to use the encrypted connection by simply parameterizing the used route.

184 Version: 1.1.0 TwinCAT 3


Target systems

This documentation illustrates the different options of Secure ADS, in particular with regard to the provision
of the keys.

Detection of a Secure ADS route

TwinCAT displays a Secure ADS route with a lock icon.

It is displayed at the appropriate points:


• Route overview of a system

• When selecting the target system in the XAE engineering environment:

3.1.4.2 Limitations
From TwinCAT 3.1 Build 4024.0
The functionality described here is available from TwinCAT 3.1. 4024.0.

• Secure ADS is available only between ADS routers.


• Like all other ADS connections, Secure SDS connections represent full access for the connected
systems as is also described in the Security Advisory 2017-01.
This access is configurable per system through unidirectional [} 187] ADS routes.

TwinCAT 3 Version: 1.1.0 185


Target systems

3.1.4.3 Requirements
From TwinCAT 3.1 Build 4024.0
The functionality described here is available from TwinCAT 3.1. 4024.0.

• Secure ADS is a component of TC1000 and can be used without license costs.
• The devices used require network communication. Incoming Secure ADS is communicated via the
TCP port 8016.
• Appropriate certificates may need to be generated and signed for TLS encryption.

3.1.4.4 Technical introduction


In this section the basic mode of operation is described, irrespective of the specific configuration.

Secure ADS introduced an additional communication channel for the familiar ADS protocol. This can be used
by programs without them having to be adapted for the new communication channel.

From the point of view of security, therefore, it is a transport encryption, but not an end-to-end encryption
between the components, because all applications running locally on a device can use this encrypted
connection together – exactly as with ADS routes also.

Local realization

Secure ADS is part of the ADS router and is also configured here. The ADS router establishes an encrypted
connection to another TwinCAT router and makes it available to the applications. Care must therefore be
taken that the ADS devices do not themselves communicate applications in encrypted form, but that this
takes place between the routers.

186 Version: 1.1.0 TwinCAT 3


Target systems

Transparent retrofitting

The realization of Secure ADS inside the TwinCAT router makes the retrofitting of applications possible.
None of the ADS applications (client and server) – this also includes applications written by the customer –
need to be recompiled.

The ADS applications use ADS routes to identify the communication partner. This ADS route is independent
of the transport channel and is described in the TwinCAT router.

If the used route is switched to a Secure ADS connection, the ADS traffic is transported in encrypted form.

3.1.4.4.1 Directed ADS communication


One of the properties of ADS routes is that they can be directed. This property was supplemented within the
scope of Secure ADS, but is generally available for routes.

Once they have been opened at network level, ADS routes are used for communication on both sides by the
respective ADS applications. This behavior is very efficient, but may be undesirable. For example, an
engineering computer (XAE) is supposed to have access to a runtime (XAR) system in the normal case, but
it is not necessary for an XAR system to access the XAE system via ADS.
Therefore, this direction can be limited in that a corresponding system (the XAE in the example) does not
accept any ADS request commands via the route.

The chapter Configuration [} 189] describes the procedure for limiting the properties.

3.1.4.4.2 Server
A normal ADS route is established by both devices as soon as it is required.
Once a route has been established it is used in both directions.
A server configuration is offered as an extension for Secure ADS. Such a configuration represents the basis
for setting up specific routes.
<TcConfig>
<RemoteConnections>
<Server>

</Server>
</RemoteConnections>
</TcConfig>

For PSK [} 191] and certificates provided by the customer [} 192] this is used to store the initial configuration
on one side.
When setting up the specific route, the server entries are then checked to see if rights exist. If this is the
case, a normal route will be set up.

TwinCAT 3 Version: 1.1.0 187


Target systems

3.1.4.4.3 Key exchange


Secure ADS offers three ways of providing the keys required for encryption; these are described here with
their advantages and disadvantages.

What they all have in common is that the respective device has to be isolated with respect to access to the
secrets (Pre-Shared Keys, certificates). If these secrets are compromised, the system has to be set up again
in order to restore the integrity of the complete system.

Self-Signed Certificates (SSC)

When starting for the first time (e.g. after the installation), TwinCAT generates a self-signed certificate.

The use of such certificates has the advantage that they are generated and are available locally. In order to
establish a basis for trust, however, a check of the certificates must be performed among all communication
devices.

These certificates are thus suitable for the initial commissioning or also for static machines that can make do
without dynamics in the system structure or the entity authorized to access.

From TwinCAT 4024.0 these certificates will be provided as standard when used. The chapter Configuration
[} 190] describes how they are used to establish an ADS route.

Validity periods of the certificates

The certificates generated have a fixed validity period from 1/1/2000 to 1/1/2061. From the point of view of
security this is too long, meaning that organizational measures have to be taken to meet the security
demands. With this excessively long validity period, Beckhoff ensures that communication does not fail, even
if, for example, incorrect times are set in the local system.

If this behavior is not desired, you can generate and use your own certificates (see Certificates provided by
the customer).

Pre-Shared Keys (PSK)

Pre-Shared Keys can be stored in a TwinCAT system. These are used to authorize the incoming ADS routes
when establishing the connection.

As the Pre-Shared Keys have to be configured they are particularly suitable for granting access, for example,
to maintenance staff. The Pre-Shared Keys can be bound to a specific person.

Pre-Shared Keys do not have a validity period like that foreseen for certificates. They are also stored directly
in files so that they are not stored as a hash value (as is usually the case with passwords). They are
therefore not protected against direct viewing.

The chapter Configuration [} 191] describes how Pre-Shared Keys are used on both sides of the
communication.

Certificates provided by the customer (CA with certificates)

Secure ADS also provides customers with the option of generating and managing their own certificates.

As a result, dynamic constellations in particular are easily mappable, because there can be a common
Certificate Authority (CA). All devices that trust this CA can communicate in encrypted form with one another
with no further configuration, even if they have never encountered one another before.

The chapter Configuration [} 192] describes how these certificates can be integrated into TwinCAT.

NOTICE
Expiry of the certificates
Certificates have an expiry date. Organizational measures must be taken to replace certificates before their
expiry.

188 Version: 1.1.0 TwinCAT 3


Target systems

3.1.4.5 Configuration
Secure ADS offers three ways of providing the keys required for the encryption. At this point the
configurations will be described separately from one another.

While the Server vs. Route configuration is described within the three ways, directed ADS connections
[} 189] are illustrated independently.

3.1.4.5.1 Directed ADS communication


The configuration of a directed ADS communication takes place using the checkbox Unidirectional when
creating the route.

If this checkbox is set, TwinCAT will not accept any ADS command calls from the opposite target system via
the associated route. TwinCAT itself sends ADS command calls (requests) and receives responses.

In the XML configuration this setting is made via the attribute Unidirectional="true":
<RemoteConnections>
<Route Unidirectional="true">
<Name>CX-123456</Name>
<Address>CX-123456</Address>
<NetId>5.36.69.176.1.1</NetId>
<Type>TCP_IP</Type>
<Flags>128</Flags>
<Tls>

</Tls>
</Route>
</RemoteConnections>

TwinCAT 3 Version: 1.1.0 189


Target systems

3.1.4.5.2 Self-Signed Certificates (SSC)


When setting up the connection, Self-Signed Certificates require the checking of the communication device,
as no trust basis automatically exists.

This check is made possible in TwinCAT by the fingerprint of the opposite system.

Displaying the SSC fingerprint on a system

The fingerprint of your own system is displayed in the About TwinCAT dialog:

The button Self Signed Certificate - Fingerprint: copies the fingerprint listed on the right to the clipboard.

This dialog does not exist for CE systems. The fingerprint can be displayed here in the file \Hard
Disk\TwinCAT\3.1\Target\TcSelfSigned.xml.

Establishment of the connection

The fingerprint is displayed purely for information and cryptographically unsecured following the discovery:

The final checking of the fingerprint takes place when setting up the route:

190 Version: 1.1.0 TwinCAT 3


Target systems

The Compare with field can be used, for example, with copy & paste for checking: If the same fingerprint is
entered there the field appears green, otherwise it is red.

Thus, an RDP connection, for example, can be used to copy the fingerprint of a system to the clipboard via
the Self Signed Certificate - Fingerprint button and to enter it here.

So that the target system will accept the route establishment, a system login with corresponding
administrator rights that is valid there is used.
These login data are already transmitted in encrypted form.

With CE systems the host name is always entered with TwinCAT 3.1 4024.5, even if IP address was
selected when creating the route. Therefore, if a network without a functioning host name lookup is to be
used, the host name must be changed manually by the IP address in the file \Hard
Disk\TwinCAT\3.1\Target\StaticRoutes.xml.

3.1.4.5.3 Pre-Shared Keys (PSK)


Pre-Shared Keys are set up on one side as a server and on the other side for authentication and
authorization.

Setting up Pre-Shared Keys as a server

Pre-Shared Keys are normally used with server connections.


The configuration takes place via an entry in the route configuration.

To do this, the following entries can be made in the file C:\TwinCAT\3.x\Target\StaticRoutes.xml :


<?xml version="1.0"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RemoteConnections>
<Server>
<Tls>
<Psk>
<Identity>MY_IDENTITY</Identity>
<Pwd>MySecret</Pwd>
</Psk>
<Psk>
<Identity>MY_IDENTITY2</Identity>
<Pwd>MyOtherSecret</Pwd>
</Psk>
</Tls>
</Server>
</RemoteConnections>
</TcConfig>

TwinCAT 3 Version: 1.1.0 191


Target systems

Saved changes are accepted when the TwinCAT router is initialized, which takes place, for example, during
the transition RUN->CONFIG or CONFIG->CONFIG.

Use of a Pre-Shared Key server

When adding a route, the entry Pre-Shared Key (PSK) is selected and the corresponding credentials are
entered.

If this is successful, a specific route is stored in the target system and is used for the future establishment of
connections.

3.1.4.5.4 Certificates provided by the customer (CA with certificates)


The configuration of certificates provided by the customer takes place via an entry in the route configuration.

To do this, the following entries can be made in the file C:\TwinCAT\3.x\Target\StaticRoutes.xml :


<?xml version="1.0"?>
<TcConfig xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<RemoteConnections>
<Server>
<Tls IgnoreCn="true"> <!--see below-->
<Ca>C:\TwinCAT\3.1\Target\CACerts\rootCA.pem</Ca>
<Cert>C:\TwinCAT\3.1\Target\CACerts\ipc.crt</Cert>
<Key>C:\TwinCAT\3.1\Target\CACerts\ipc.key</Key>
</Tls>
</Server>
</RemoteConnections>
</TcConfig>

Saved changes are accepted when the TwinCAT router is initialized, which takes place, for example, during
the transition RUN->CONFIG or CONFIG->CONFIG.

The certificates are X.509 certificates, which can be generated, for example, with OpenSSL. If the key (XML-
Element <Key>) is to be protected by a password, this can be specified via the XML element <KeyPwd>.
The .der and .pem formats are supported.

The "CommonName" of the certificate must correspond to the name used when establishing the connection
(XML-Element <Name>). This behavior can be deactivated with the option IgnoreCn=" true".

If both sides have suitable certificates of a common CA, the route can be created without further information
using this dialog:

192 Version: 1.1.0 TwinCAT 3


Target systems

As described under Server [} 187], a specific route is created on both sides as a result of this.

3.1.4.5.5 Deactivating ADS


• The unencrypted ADS is transmitted via the TCP port 48898 (0xBF02)
• The discovery ("Broadcast Search") is transmitted via the UDP Port 48899 (0xBF03)

Both ports can be blocked in the firewall.

The target system can be configured with respect to the ports to be used.

The following keys are available below KEY_LOCAL_MACHINE\SOFTWARE\


[WOW6432Node\]Beckhoff\TwinCAT3\System:

ADS Ports
DisableAdsTcpListening REG_DWORD 1 = prevents the opening of the
TCP port 0xBF02 for unencrypted
ADS.
DisableAdsTlsListening REG_DWORD 1 = prevents the opening of the
TCP port 8016 for Secure ADS
DisableAdsDiscovery REG_DWORD 1 = prevents the opening of the
UDP port 0xBF03 for the ADS
discovery ("Broadcast Search")

The attribute SecureOnly="True" can additionally be used via the StaticRoutes.xml file. The ADS port
0xBF02 is thereby kept open, but no further ADS communication is allowed via the port.
<RemoteConnections SecureOnly="True">

3.1.4.5.6 Logging
Secure ADS writes information about failed connection establishments in the Windows Event Log, which is
available via the TwinCAT System Tray icon.

TwinCAT 3 Version: 1.1.0 193


Target systems

The messages can be found under the category Windows Logs > Application:

3.1.4.6 Sample

3.1.4.6.1 Certificates provided by the customer (CA with certificates)


At this point certificates are generated by means of Open SSL and can be used for the Secure ADS
connection.

These instructions do not represent comprehensive advice on the creation and handling of certificates. In
particular the validity periods must be observed, which necessitates organizational measures in order to
ensure replacement before the expiry of the validities (in this case: 3600 days for CA and 360 days for the
respective certificates).

In this example a Certificate Authority (CA) is generated that signs a certificate for both sides (called IPC and
CX here) of the communication.

The meaning of the call parameters can be viewed in detail via "openssl help".
ü OpenSSL is installed and is available from the command line.
1. Generate a key for the Certificate Authority that will be trusted later.
openssl genrsa -out rootCA.key 2048

2. Generate the certificate with a validity period of 3600 days. Owner information is added via the
parameter "-subj".
openssl req -x509 -new -nodes -key rootCA.key -sha256 -subj "/C=DE/ST=NRW/
L=Verl/O=Bk/OU=TCPM/CN=RootCA" -days 3600 -out rootCA.pem
3. Generate a key for the IPC
openssl genrsa -out ipc.key 2048

194 Version: 1.1.0 TwinCAT 3


Target systems

4. Generate a Certificate Signing Request (CSR) for this key:


Please note: The address specified as CN (IP address in this case) must be used as the name when
establishing the connection. Alternatively, the route must be parameterized with IgnoreCN.
openssl req -out ipc.csr -key ipc.key -subj "/C=DE/ST=NRW/L=Verl/O=Bk/
OU=TCPM/CN=192.168.2.1" –new
5. Sign the CSR of the IPC with the CA with a validity of 360 days
openssl x509 -req -in ipc.csr -CA rootCA.pem -CAkey rootCA.key
-CAcreateserial -out ipc.crt -days 360 -sha256
ð The route can now be set up on the IPC using these files: rootCA.pem, ipc.key and ipc.pem
6. Generate a key for the CX
openssl genrsa -out cx.key 2048
7. Generate a Certificate Signing Request (CSR) for this key:
Please note: The address specified as CN (IP address in this case) must be used as the name when
establishing the connection. Alternatively, the route must be parameterized with IgnoreCN.
openssl req -out cx.csr -key cx.key -subj "/C=DE/ST=NRW/L=Verl/O=Bk/OU=TCPM/
CN=192.168.2.2" –new
8. Sign the CSR of the IPC with the CA with a validity of 360 days
openssl x509 -req -in cx.csr -CA rootCA.pem -CAkey rootCA.key -CAcreateserial
-out cx.crt -days 360 -sha256
ð The route can now be set up on the CX using these files: rootCA.pem, cx.key and cx.pem
ð The route can be used.

3.2 Folder and file types

3.2.1 TwinCAT PLC project files

3.2.1.1 Port_xxx.app
Binary file of the PLC project

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.2 Port_xxx.autostart
Empty file that activates the Autostart option

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate Autostart option (project-
• Recreating a PLC project independent system setting)
Requirement -

TwinCAT 3 Version: 1.1.0 195


Target systems

3.2.1.3 Port_xxx.cid
File containing the Compileinfo_IDs

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.4 Port_xxx.crc
File containing the checksum of the PLC project

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.5 Port_xxx.occ
Symbolics of the PLC project
• The file contains the changes of the symbolics of the PLC project for an online change.
• If the Symbolic Mapping option is not activated, this file also contains the changes of the mapping
configuration for an activate/update boot project.
• On activating the configuration the occ file is reset in both directories.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.6 Port_xxx.oce
The file contains the changes of the event classes at the time of an OnlineChange, which are used in a PLC
project.

Storage location

196 Version: 1.1.0 TwinCAT 3


Target systems

Project directory TwinCAT boot directory


Path - C:\TwinCAT\3.1\Boot\Plc\
Time of creation - When changing the event classes used
and OnlineChange
Requirement - -

3.2.1.7 Port_xxx.ocm
Description file of the mapping configuration
• If the Symbolic Mapping option is activated, this file contains the changes of the mapping
configuration of the PLC project for an activate/update boot project.
• On activating the configuration the ocm file is reset in both directories.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a TwinCAT project • Activate configuration
• Recreating a TwinCAT project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.8 Port_xxx_boot.tizip
Archive folder containing the COMPILEINFO file of the boot project

The COMPILEINFO file contains the compilation information and the login information of the PLC project.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.9 Port_xxx_act.tizip
Archive folder containing the COMPILEINFO file of the currently running PLC project

Storage location

Project Directory TwinCAT boot directory


Path - C:\TwinCAT\3.1\Boot\Plc\
Time of creation - • PLC login with change
Requirement - -

3.2.1.10 Port_xxx.bootdata
Boot file that saves the persistent data

Once the TwinCAT system has started and the PLC has been loaded, the file extension .bootdata is
renamed .bootdata-old.

TwinCAT 3 Version: 1.1.0 197


Target systems

Storage location

Project Directory TwinCAT boot directory


Path - C:\TwinCAT\3.1\Boot\Plc\
Time of creation - • Stop the TwinCAT system
• Use of FB_WritePersistentData
Requirement - -

3.2.1.11 Port_xxx.bootdata-old
Backup file for the persistent data

The file is deleted once the new boot file has been completely written.

Storage location

Project Directory TwinCAT boot directory


Path - C:\TwinCAT\3.1\Boot\Plc\
Time of creation - • Activate configuration
• Restarting the TwinCAT system
Requirement - -

3.2.1.12 PLC_Name.tpzip
Archive folder of the PLC project

The scope of the content is configurable in the project properties.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\CurrentConfig\
name>\_Boot\<Platform>\CurrentConfig
\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement - -

3.2.1.13 PLC_Name.tmc
TC3 module description file

Storage location

Project Directory TwinCAT boot directory


Path A)..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\<PLC name>\
B)..\<Solution name>\<Project
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement A) - • TMC activated as target file
B) TMC activated as target file

198 Version: 1.1.0 TwinCAT 3


Target systems

3.2.1.14 PLC_Name.tpy
TC2 PLC description file

Storage location

Project Directory TwinCAT boot directory


Path A)..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\<PLC name>\
B)..\<Solution name>\<Project
name>\_Boot\<Platform>\Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Activate boot project
• PLC login with boot project update
Requirement A) - • TPY activated as target file
B) TPY activated as target file

TwinCAT 3 Version: 1.1.0 199


Target systems

3.2.2 TwinCAT C++ project files

200 Version: 1.1.0 TwinCAT 3


Target systems

File Description Further Information


Engineering / XAE
*.sln Visual Studio Solution file, hosts TwinCAT and
non-TwinCAT projects
*.tsproj TwinCAT project, collection of all nested
TwinCAT projects, such as TwinCAT C++ or
TwinCAT PLC project
_Config/ Folder contains further configuration files (*.xti) See menu Tools| Options|
that belong to the TwinCAT project. TwinCAT| XAE-
Environment| File
Settings
_Deployment/ Folder for compiled TwinCAT C++ drivers
*.tmc TwinCAT Module Class file (XML-based) See TwinCAT Module
Class Editor (TMC)
*.rc Resource file See Set version/vendor
information
*.vcxproj.* Visual Studio C++ project files
*ClassFactory.cpp/.h Class Factory for this TwinCAT driver
*Ctrl.cpp/.h Upload and remove drivers for TwinCAT UM
platform
*Driver.cpp/.h Upload and remove drivers for TwinCAT RT
platform
*Interfaces.cpp/.h Declaration of the TwinCAT COM interface
classes
*W32.cpp./.def/.idl
*.cpp/.h One C++/Header file per TwinCAT module in
the driver. Insert user code here.
Resource.h Required by *.rc file
TcPch.cpp/.h Used for creating precompiled headers
%TC_INSTALLPATH% Compiled driver that is loaded via the See Versioned C++
\Repository\<Vendor>\<PrjNam TcLoader. Projects
e>\<Version>\<Platform>\*.tmx C:\TwinCAT\3.x\Repository\C++ Module
Vendor\Untitled1\0.0.0.1\TwinCAT RT
*\Unititled1.tmx
%TC_INSTALLPATH% Published TwinCAT driver package See Export modules
\CustomConfig\Modules\* usually C:
\TwinCAT\3.x\CustomConfig\Modules\*
Runtime / XAR
%TC_BOOTPRJPATH% Current configuration setup
\CurrentConfig\* Windows: C:\TwinCAT\3.x\Boot
TwinCAT/BSD: /usr/local/etc/TwinCAT/3.x/Boot
%TC_DRIVERAUTOINSTALLP Compiled, platform-specific driver that is loaded
ATH% \*.sys/pdb via the operating system.
Windows: C:\TwinCAT\3.x\Driver\AutoInstall
(system loaded)
TwinCAT/BSD: <not available>
%TC_INSTALLPATH% Compiled platform-specific driver that is loaded
\Boot\Repository\<Vendor>\<Prj via the TcLoader.
Name>\<Version>\*.tmx Windows: C:\TwinCAT\3.x\Boot\Repository\C++
Module Vendor\Untitled1\0.0.0.1\Untitled1.tmx
TwinCAT/BSD: /usr/local/etc/TwinCAT/3.x/
Boot\/Repository\C++ Module
Vendor\Untitled1/0.0.0.1/Untitled1.tmx

TwinCAT 3 Version: 1.1.0 201


Target systems

File Description Further Information


%TC_BOOTPRJPATH% TwinCAT Module Instance file
\TM\OBJECTID.tmi Describes variables of the driver
File name is ObjectID.tmi
Windows: C:\TwinCAT\3.x\Boot\TMI\OTCID.tmi
TwinCAT/BSD:
/usr/local/etc/TwinCAT/3.x/Boot/TMI/OTCID.tmi
Temporary files
*.sdf IntelliSense Database
*.suo / *.v12.suo User-specific and Visual Studio-specific files
*.tsproj.bak Automatically generated backup file from tsproj
ipch/ Intermediate directory created for precompiled
headers

3.2.3 TwinCAT project files

3.2.3.1 CurrentConfig.xml
Description file of the current configuration.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\
name>\_Boot\<Platform>\
Time of creation • Creating a TwinCAT project • Activate configuration
• Recreating a TwinCAT project
Requirement - -

3.2.3.2 CurrentConfig.tszip
Archive folder containing the tsproj file and all referenced xti files.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\
name>\_Boot\<Platform>\
Time of creation • Creating a TwinCAT project • Activate configuration
• Recreating a TwinCAT project
Requirement • Auto Save <TwinCAT project name> to Target as Archive is active

3.2.4 PLC HMI files

3.2.4.1 Port_xxx.textlistname.txt
For each text list existing in the project, a file is created containing all the entries in this text list.

Storage location

202 Version: 1.1.0 TwinCAT 3


Target systems

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\Port_xxx\Visu
name>\_Boot\<Platform>\
Plc\Port_xxx\Visu
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Target and/or web visualization object added

3.2.4.2 Port_xxx Folder


In this folder a further folder "Visu" is automatically created in which the files and the images of the PLC HMI
are saved in turn.

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\ Plc\
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project
Requirement • Target and/or web visualization object added

3.2.5 PLC HMI files (Target Visualization)

3.2.5.1 tc3plchmi.ini
Configuration file containing the settings of the target visualization client

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\
name>\_Boot\<Platform>\ Plc
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Target visualization object added

3.2.6 PLC HMI Web files

3.2.6.1 port_xxx.imagepoolcollection.csv
File containing a list of the entries of all image pools available in the PLC project

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\Port_xxx\Visu
name>\_Boot\<Platform>\
Plc\Port_xxx\Visu
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Web visualization object added

TwinCAT 3 Version: 1.1.0 203


Target systems

3.2.6.2 webvisu.cfg.json
Configuration file containing the settings of the web visualization object

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\Port_xxx\Visu
name>\_Boot\<Platform>\
Plc\Port_xxx\Visu
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Web visualization object added

3.2.6.3 webvisu.htm
HTML page used to display the visualization in the internet browser

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\Port_xxx\Visu
name>\_Boot\<Platform>\
Plc\Port_xxx\Visu
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Web visualization object added

3.2.6.4 webvisu.js
File containing the Java Script logic that is used in the visualization

Storage location

Project Directory TwinCAT boot directory


Path ..\<Solution name>\<Project C:\TwinCAT\3.1\Boot\Plc\Port_xxx\Visu
name>\_Boot\<Platform>\
Plc\Port_xxx\Visu
Time of creation • Creating a PLC project • Activate configuration
• Recreating a PLC project • Online Change / Download
Requirement • Web visualization object added

3.3 Machine update at file level

3.3.1 Overview
If no TwinCAT 3 development environment (XAE) is available, you can update the boot data of a TwinCAT
PLC system or a complete TwinCAT system by means of a file copy.
• Performing a PLC update [} 205]
• Performing a C++ update [} 205]
• Performing an update of the complete machine [} 205]
• Cloning a machine [} 206]

204 Version: 1.1.0 TwinCAT 3


Target systems

A description of the various files as well as information on their storage location within the associated project
(project directory) and on the machine (TwinCAT boot directory) can be found in the section Folder and file
types [} 195].

3.3.2 Performing a PLC update


ü TwinCAT version TC3.1.4022.0 or higher
ü Boot data have been generated for the machine platform by creating (or recreating) the PLC project. A
connection to the target system is not required when creating (or recreating) the project.
ü The process image and the hardware configuration have not changed since the last update.
ü The Symbolic Mapping option is activated in the PLC project settings.
1. Copy the boot data of the PLC project, i.e. all files and folders, from the folder
..\<Solution name>\<Project name>\_Boot\<Platform>\Plc\.
2. Replace the boot data in the machine's TwinCAT PLC boot directory C:\TwinCAT\3.1\Boot\Plc\ by the
copied boot data.
3. Restart the machine's TwinCAT system.
ð The boot data of the TwinCAT PLC system and thus the PLC runtime itself are updated.

Source code update


If you also store the source code of the PLC project on the runtime system in addition to the boot
data, then you can also copy the archive folder from the folder ..\<Solution name>\<Project
name>\_Boot\<Platform>\ CurrentConfig\ to the folder C:\TwinCAT\3.1\Boot\CurrentConfig\ on the
runtime system during an update at file level.

3.3.3 Performing a C++ Update


The runtime data can be transferred from one machine to another by means of a file copy if both originate
from the same platform and are connected with equivalent hardware equipment.

The following steps describe a simple procedure to transfer a binary configuration from one machine,
"source", to another, "destination".
ü Empty the folder C:\TwinCAT\3.x\Boot on the source machine.
1. Create (or enable) the module on the source machine.
2. Transfer the folder C:\TwinCAT\3.x\Boot from the source to the destination.
This folder also contains the repository which contains the necessary TMX files.
3. For TwinCAT driver projects (.sys): transfer the driver itself from C:
\TwinCAT\3.x\Driver\AutoInstall\MYDRIVER.sys and if necessary also the PDB file.
4. For TwinCAT driver projects (.sys) and if drivers are new on a machine:
TwinCAT must perform a registration once. Switch TwinCAT via SysTray (right-click->System->Start/
Restart) into RUN mode.
Alternatively this call can be used ("%1" can be replaced as driver name):
sc create %1 binPath= c:\TwinCAT\3.1\Driver\AutoInstall\%1.sys type= kernel
start= auto group= "file system" DisplayName= %1 error= normal
ð You can now start the target machine.

Handling licenses
Note that licenses cannot be transferred in this manner. Please use pre-installed licenses, volume
licenses or other mechanisms for providing licenses.

3.3.4 Performing an update of the complete machine


ü Boot data have been generated for the machine platform by creating (or recreating) the TwinCAT project.
A connection to the target system is not required when creating (or recreating) the project.
ü The real hardware configuration corresponds to the project configuration.

TwinCAT 3 Version: 1.1.0 205


Target systems

ü If the machine update is to be performed on several machines and not on a specific machine, the
following options are activated:
Use Relative NetIds in the Routes settings (System > Routes, NetIdManagement tab) and
Virtual Device Names in the Adapter settings of all network and USB devices
(e.g. I/O > Devices > EtherCAT Master, Adapter tab)
The network adapter names of the machine must correspond to the adapter name of the configuration.
1. Copy the boot data of the TwinCAT project, i.e. all files and folders, from the folder
..\<Solution name>\<Project name>\_Boot\<Platform>\.
2. Replace the boot data in the machine's TwinCAT boot directory C:\TwinCAT\3.1\Boot\ by the copied boot
data.
3. If you use C++ modules, please copy the C++ drivers (described in chapter Performing a C++ update
[} 205]).
4. Restart the machine's TwinCAT system.
ð The boot data of the TwinCAT system and thus the TwinCAT system itself are updated.

3.3.5 Cloning a machine


In order to transfer the boot data of a TwinCAT or PLC project from one machine to another, copy the boot
data from the first machine's boot directory and replace the boot data in the boot directory of the other
machine.

If the TwinCAT system whose boot data are to be copied is in Run mode and persistent data are also to be
exchanged, the TwinCAT system should first be switched from Run to Config mode so that the persistent
data are saved in the file .bootdata and are available in the boot directory for copying. (See
Port_xxx.bootdata)

3.4 Starting the program automatically


TwinCAT 3 offers the option to start selected programs automatically after startup. This is especially useful
for programs where TwinCAT must be started before execution, e.g. visualization software.

To start a program automatically after TwinCAT startup, a shortcut of the program must be created in a
special startup folder in the TwinCAT directory. The program itself must be installed locally on the same PC
as TwinCAT. After the first activation of the Run Mode after starting the TwinCAT runtime system, the
shortcuts in the Startup folder are executed.

The path <TwinCAT>\3.x\Target\StartUp leads to the startup folder. The designation results as follows:

<TwinCAT> TwinCAT installation folder


• < TC3.1.4026.0: C:\TwinCAT\
• >=TC3.1.4026.0: C:\Program Files (x86)\Beckhoff\TwinCAT\
3.x TwinCAT version (all versions of TwinCAT are stored in separate folders in the TwinCAT
installation folder).
x Placeholder for the build of TwinCAT, e.g. "3.1".

1. Save a shortcut to the program in the folder <TwinCAT>\3.x\Target\StartUp.

206 Version: 1.1.0 TwinCAT 3


Target systems

2. Make sure that TwinCAT starts in Run Mode.


3. In the TwinCAT project tree, double-click on SYSTEM and select the Settings tab.

4. Enable the options Run Mode (Enable) and Auto Logon.


5. Click Apply.

3.5 Corrected time stamps

3.5.1 Overview
Controllers generate data to be collected and linked in modern, distributed systems.
Since controllers start off as stand-alone devices, they have independent time bases. In a common
database, it would not be possible to correlate data with respect to time.

In order to counter this problem, it has been possible for quite some time to synchronize controllers with
each other, for example using the network protocol IEEE1588 or PTP.
However, in many scenarios it is sufficient to provide the data with a uniform timestamp. The controllers can
be operated independently of each other, so that on the one hand the hardware costs associated with the
protocols mentioned above are reduced, while on the other hand there is no technical dependency between
the controllers.
This chapter describes the TwinCAT components for adapting timestamps for storing time-synchronous data.

The figure illustrates the basic idea: independent controllers obtain the local timestamp and adjust it using an
offset, which is then used to store the common data.

A central component, the external time interface, is available in TwinCAT real-time for this purpose. This
component
• receives the offset to the corrected time from a configured source (external time provider).

TwinCAT 3 Version: 1.1.0 207


Target systems

• provides the external time consumer with a corrected time, depending on the current local time.

This corrected time can then be used by different components inside and outside the real-time.

The source is typically either an NTP server or a DC time signal based on EtherCAT, which is synchronized
via EL6688 through PTP (IEEE1588), for example. However, a source can also be implemented by the
customer, so that other time signals can be realized as a source.

In addition to the central component in the TwinCAT real-time described above, the concept thus comprises
two types of components:

1. External time providers: provide an offset for adjusting timestamps of the central component.
For example, a provider obtains a timestamp via NTP (Network Time Protocol, see RFC 4330), from
which it calculates an offset to the local system time and makes this available.
2. External time consumers: use an offset that they obtain from the central component. Thus a
timestamp can be used in the components that leads to comparable data on remote devices.
All TwinCAT components that use timestamps can be consumers, and also customer applications.

3.5.2 System requirements


Technical data Requirement
Operating system Windows 10, Windows Embedded Standard 7
Target platform PC architecture (x86, x64)
TwinCAT version TwinCAT 3.1 build 4024.0 or higher
Required TwinCAT setup level TwinCAT 3 XAE, XAR
Required TwinCAT license Any runtime license (PLC, C++)

3.5.3 Limitations
Some important limitations have to be taken into account:
• The TwinCAT system time is not changed by the external time interface described here
• The external time offsets are made available to the consumers as provided by the provider. It follows
that
◦ the offset must be calculated correctly by the provider.
◦ no monotony can be guaranteed in the timestamps.
• The external time offsets are not saved and subsequently made available for retrieval. This means that
only the current offsets are managed in the TwinCAT system.

3.5.4 Technical introduction


TwinCAT offers different interfaces for the external time provider and the external time consumer in order to
utilize the concept of corrected timestamps.

On the external time consumer side, different TwinCAT components are able to use the external timestamp.
In addition, there are different access options for applications.

On the external time provider side, modules are provided that can calculate and provide an offset via NTP. In
addition, there is a module that can use the offset via DC. The corresponding interface for providing the
offset is also offered for TwinCAT C++, so that customers can create their own external time providers.

Timestamps for different use cases

It should be noted that TwinCAT differentiates between four types of timestamps in this concept:

1. None: Local system time and no correction


2. Soft: Recommended use e.g. for NTP
3. Medium: Recommended use e.g. for IEEE1588

208 Version: 1.1.0 TwinCAT 3


Target systems

4. Hard: Recommended use e.g. for hardware synchronization where no drift should occur

An external time provider provides one of the possible offsets; only one provider can be defined for each
type.

An external time consumer can then use any offset; all four offset types can be used as required. Thus it is
possible to use different timestamps in different ensembles or operation modes. For example, a local
diagnosis can take place with the local system time, while at the same time aggregated data from different
systems can be corrected with the offset type Soft and stored in a common database.

The interfaces of the corrected timestamps use data types with a length of 8 bytes and are counted from
1.1.1601 in 100 ns steps.

3.5.4.1 Consumers
External time consumers are components that can correct the local system time with an offset. For this
purpose, the components must select or configure an offset of type Soft, Medium or Hard and query it
accordingly.

3.5.4.1.1 TwinCAT components as offset consumers


The following TwinCAT components support the approach of corrected timestamps – the respective
documentation describes how this functionality can be enabled:
• TwinCAT 3 EventLogger
• TwinCAT Scope

This list will be extended.

3.5.4.1.2 Application implementation


Applications can use the external time offsets in different components:
• Real-time PLC: The PLC can query an offset or have a local timestamp corrected accordingly.
• Real-time – C++: C++ TcCOM modules are able to query the offset and act accordingly.
• User mode – ADS device notifications: The timestamps sent with the ADS device notifications can be
corrected.
• User mode – ADS Read: The corrected timestamp can be retrieved by an ADS Read. This can be
used in ADS Sum commands to retrieve a timestamp along with data.

The interfaces are documented in the corresponding API chapters.

3.5.4.2 Provider
External time providers are components that determine an external time offset in relation to the local system
time through an external information source and make it available in TwinCAT. This allows external time
consumers to receive a corrected time, independent of the provider.

TwinCAT also supplies providers with:


• NTP providers: an implementation that queries and provides a time signal from an NTP server via
(S)NTP.
• DC providers: An implementation that passes on the DC time from the EtherCAT master to TwinCAT
as an offset (e.g. via IEEE1588 or PTP)
• In addition, the customer is able to provide his own providers.

3.5.4.2.1 NTP provider


The NTP provider is an (S)NTP client that cyclically receives a time signal from an NTP server. This allows it
to calculate an offset of the system time from the time signal of the NTP server and make it available
accordingly.

TwinCAT 3 Version: 1.1.0 209


Target systems

Configuration

The NTP provider is implemented as TcCOM module TcNtpExternalTimeProvider. This module is


commissioned as a TcCOM module as follows:
ü TwinCAT project
1. Insert a TcCOM module under System->TcCOM Objects and select type TcNtpExternalTimeProvider in
the category External Time Provider.

2. The module requires a task from which it is called. This is parameterized via the Context tab of the
module:

ð The TcCOM module can be parameterized:

210 Version: 1.1.0 TwinCAT 3


Target systems

The configuration takes place in the Parameter (Init) tab. The parameters have the following meanings:
• TimeType: The type of offset for which this module is to determine an offset.

Client Para:
• bEnable: The module can be disabled to prevent NTP communication.
• sServerName: The name of the NTP server to be used as the source.
• nServerAddress: IP address of an NTP server (used if sServerName is empty).
• nServerPort: The UDP port of the NTP server to be used (default: 123).
• tPollIntervall: The interval in which the NTP queries are to be started. The maximum specified by the
server is taken into account, which may slow down requests.

This module passes a determined offset to TwinCAT via the ITcSetExternalTime [} 217] interface. In addition,
outputs are available for mapping.

NTP provider as NTP server

Optionally, the same module can also act as an NTP server. Thus, a time signal can be obtained from an
external NTP server (as a client) and simultaneously provided to lower-level systems.

For the external server, the NTP protocol typically requires a minimum query time of 8 seconds or more. The
NTP provider as NTP server, on the other hand, allows more frequent query intervals.

TwinCAT 3 Version: 1.1.0 211


Target systems

Server function

The server functionality is normally hidden. It can be displayed and configured via Show Hidden
Parameters:

• bEnable: Enable NTP server functionality for this module. To do this, open the udp/123 port in the
Windows firewall.
• nPort: The UDP port that is used to offer the server (default: 123).

The following parameters are used to adjust the NTP information provided. By default, the parameters are
set as specified in the protocol; they can be overwritten here:
• nLeap: Manual configuration of the Leap Indicator.
• nStratum: Manual configuration of the stratum.
• nRoot: Manual configuration of the root server information, as defined depending on the stratum.

Filter function

If offsets are determined by the NTP server query, the module can independently perform a transition from
the old offset to the new offset.

This functionality is normally hidden. It can be displayed and configured via Show Hidden Parameters:

212 Version: 1.1.0 TwinCAT 3


Target systems

• eMode: A selection of modes. Currently, either no adjustment or a linear adjustment is made (default).

The following parameters apply if "Linear" is selected as eMode:


• nFilter: Number of values for which the average is taken, i.e. number of NTP responses. With a poll
interval of 1 s, nFilter = 60 would effect a filter for one minute. (Default: 60).
• nLimiter: The offset is changed by this value at the most per cycle. If the difference between the local
and external clocks were to be 100 ms and the cycle time 1 ms, it would thus take 100,000 cycles or
1.6 minutes at nLimiter = 10 until the offset has settled. (Default: 1 µs).
• nModulo: Rounding of the offset. Usually this should be chosen depending on the cycle time. The
offset is adjusted via this modulo so that no "un-round" times are created. The DC Time will return the
modulo of the cycle time; corrected with the offset, the timestamp thus remains "round". The offset/
timestamp changes as a result, but also with small jumps if an adjustment takes place. As described
under nLimiter and with nModulo = 1000, the offset and thus the relative timestamp would increment
every 100th cycle by 0.1 ms.

Diagnostics

Diagnostic information can be viewed under the Parameters (Online) tab.

TwinCAT 3 Version: 1.1.0 213


Target systems

For each line there is a corresponding description in the Comment column.

In addition, corresponding symbols are available for programmatic evaluation:

• bIsConnected: At least 8 successful responses were received from the server (TRUE) or at least 8
requests were not answered (FALSE).
• bIsSynchronized: The determined time of the client has been determined in the last 8 responses with
a deviation smaller than the cycle time of the server.
• nLastUpdate: The time of the last evaluated response from the server.

3.5.4.2.2 DC provider
The DC provider obtains an offset through mapping from an EtherCAT master. It can be used to use time
values from the I/O range as offset, such as those provided by the EtherCAT master (DC time) or an
EL6695.

Configuration

The DC provider is implemented as TcCOM module TcDcExternalTimeProvider. This module is


commissioned as a TcCOM module as follows:
ü TwinCAT project

214 Version: 1.1.0 TwinCAT 3


Target systems

1. Insert a TcCOM module under System->TcCOM Objects and select type TcDcExternalTimeProvider in
the category External Time Provider.

2. The module requires a task from which it is called. This is parameterized via the context tab of the
module:

ð The module can be parameterized:

The configuration takes place in the Parameters (Init) tab. The parameters have the following meanings:
• TimeType: The type of offset for which this module is to determine an offset.

TwinCAT 3 Version: 1.1.0 215


Target systems

• This module obtains the offset itself through mapping:

This module passes a determined offset to TwinCAT via the ITcSetExternalTime [} 217] interface. In addition,
outputs are available for mapping.

3.5.4.2.3 Application implementation


An application can provide its own TimeOffset provider by using the ITcSetExternalTime interface in
TwinCAT C++.

This module provides a cyclic value for the respective offsets, if necessary.

Sequence

A module implements the following sequence


ü A TcCOM module was instantiated
1. The module registers itself as provider of a certain type of offset (Soft/Medium/Hard) via
RegisterExternalTimeProvider

216 Version: 1.1.0 TwinCAT 3


Target systems

2. SetExternalTimeOffset can be used to provide an offset cyclically, if necessary


3. The module logs off using UnregisterExternalTimeProvider

Registration ensures that an offset of only one module can be used at a time.

A more detailed description of the ITcSetExternalTime interface can be found in chapter ITcSetExternalTime
interface [} 217].

3.5.5 Real-time API


At this point, interfaces and structures are documented to deal with the corrected timestamps from the real-
time.

3.5.5.1 Structures

3.5.5.1.1 Enum TimeType


TwinCAT provides four different timestamps. The Enum TimeType is used to distinguish between them.

Syntax
enum TimeType {
SystemTime = 0,
ExternalTimeHard = 1,
ExternalTimeMedium = 2,
ExternalTimeSoft = 3, // e.g. NTP
};

Values

How the three external timestamp types are used in practice depends on application. The example below is
merely a suggestion.

Name Description
ExternalTimeHard Suggested use for hard offsets that have no drift
ExternalTimeMedium Suggested use for accurate offsets such as IEE1588
ExternalTimeSoft Suggested use for general offsets, such as NTP

3.5.5.2 Interfaces
At this point the interfaces are described which are used for the corrected time stamps.

For the different time formats and representations there is a corresponding list in the C++ SDK.
See: Infosys C/C++

3.5.5.2.1 ITcSetExternalTime interface


The ITcSetExternalTime interface is implemented by the TcCOM object server. It can be used to provide an
externally determined offset.

Syntax
TCOM_DECL_INTERFACE("00000067-0000-0000-e000-000000000064", ITcSetExternalTime)
struct __declspec(novtable) ITcSetExternalTime : public ITcExternalTime

TwinCAT 3 Version: 1.1.0 217


Target systems

Methods

Name Description
RegisterExternalTimeProvider [} 218] Registering a provider for an offset related to
TimeType
UnregisterExternalTimeProvider [} 218] Logging off a provider for an offset related to
TimeType
SetExternalTimeOffset [} 218] Provide a new offset for the registered TimeType

Comments

This interface is not available for the PLC.

3.5.5.2.1.1 RegisterExternalTimeProvider method


Registering a provider for an offset related to TimeType

Syntax
HRESULT TCOMAPI RegisterExternalTimeProvider(OTCID oidProvider, TimeType type) = 0;

Parameter

oidProvider: (type: OTCID) The object ID of the provider; normally the object ID of the calling party

type: (type: TimeType [} 217]) The TimeOffset type to be registered.

Return value

Type: HRESULT

Notifies the success of registration

Description

3.5.5.2.1.2 UnregisterExternalTimeProvider method


Logging off a provider for an offset related to TimeType

Syntax
HRESULT TCOMAPI UnregisterExternalTimeProvider(OTCID oidProvider, TimeType type) = 0;

Parameter

oidProvider: (type: OTCID) The object ID of the provider; normally the object ID of the calling party

type: (type: TimeType [} 217]) The TimeOffset type to be logged off.

Return value

Type: HRESULT

Notifies the success of the deregistration

Description

3.5.5.2.1.3 SetExternalTimeOffset method


Provide a new offset for the registered TimeType

218 Version: 1.1.0 TwinCAT 3


Target systems

Syntax
HRESULT TCOMAPI SetExternalTimeOffset(OTCID oidProvider, TimeType type, __int64 offset) = 0;

Parameter

oidProvider: (type: OTCID) The object ID of the provider; normally the object ID of the calling party

type: (type: TimeType [} 217]) The TimeOffset type

offset: (type: __int64) The new offset value.

Return value

Type: HRESULT

Notifies the success.

Description

It is valid for the offset ExternalTime = Internal Time + Offset. I.e. if the time in TwinCAT is in the past, the
offset must be greater than 0.

3.5.5.2.2 ITcExternalTime interface


The ITcExternalTime interface is implemented by the TcCOM object server. This can be used to retrieve and
use an externally determined offset.

Syntax
TCOM_DECL_INTERFACE("00000066-0000-0000-e000-000000000064", ITcExternalTime)
struct __declspec(novtable) ITcExternalTime : public ITcUnknown

Methods

Name Description
SystemTimeToExternalTime [} 219] Calculation of a corrected timestamp in relation to the
system time
ExternalTimeToSystemTime [} 220] Calculation of the system time in relation to a
corrected timestamp
GetExternalTimeOffset [} 220] Retrieving an offset in relation to the TimeType
GetExternalTimeProvider [} 220] Queries the ObjectID of the current provider

3.5.5.2.2.1 SystemTimeToExternalTime method


Calculation of a corrected timestamp in relation to the system time

Syntax
HRESULT TCOMAPI SystemTimeToExternalTime(TimeType type, __int64& time) = 0;

Parameter

type: (type: TimeType [} 217]) The TimeOffset type to be used for the calculation

time: (type: __int64&) The timestamp to be corrected by offset

Return value

Type: HRESULT

Notifies the success.

TwinCAT 3 Version: 1.1.0 219


Target systems

Description

3.5.5.2.2.2 ExternalTimeToSystemTime method


Calculation of the system time in relation to a corrected timestamp

Syntax
HRESULT TCOMAPI ExternalTimeToSystemTime(TimeType type, __int64& time) = 0;

Parameter

Type: (type: TimeType [} 217]) The TimeOffset type to be used for the calculation

time: (type: __int64&) The corrected timestamp, adjusted by the offset.

Return value

Type: HRESULT

Notifies the success.

Description

The offset valid at the time of the call is used to determine the local system time.

3.5.5.2.2.3 GetExternalTimeOffset method


Retrieving an offset in relation to the TimeType

Syntax
HRESULT TCOMAPI GetExternalTimeOffset(TimeType type, __int64& offset) = 0;

Parameter

type: (type: TimeType [} 217]) The TimeOffset type to be retrieved

offset: (type: __int64&) The value set to the offset.

Return value

Type: HRESULT

Notifies the success.

Description

3.5.5.2.2.4 GetExternalTimeProvider method


Queries the ObjectID of the current provider

Syntax
HRESULT TCOMAPI GetExternalTimeProvider(TimeType type, OTCID& oidProvider) = 0;

Parameter

type: (type: TimeType [} 217]) The TimeOffset type whose provider is to be queried.

oidProvider: (type: OTCID&) The ObjectID that is set to the ObjectID of the provider.

220 Version: 1.1.0 TwinCAT 3


Target systems

Return value

Type: HRESULT

Notifies the success.

Description

3.5.6 ADS API


The TimeOffsets can also be queried via ADS. There are two ways to do this

1. ADS Notification: ADS notifications contain a time stamp that contains the time at which the data was
changed.
An ADS client sends an ADS command before the AddDeviceNotification. This causes the target
system to register which type of corrected time stamp is required from this ADS client.
2. ADS Read: A corrected time stamp can be read out via ADS Read. This can be used to obtain a
corrected time stamp in an ADS Sum command at the time when the ADS commands were executed.

TwinCAT 3 Version: 1.1.0 221


Target systems

Index group Index offset Access Data type Description Note


ADSIGRP_EXT
ERNALTIME
0xF088
ADSIOFFS_EX R LONG Read the currently configured offset The return
TERNALTIME_ type for the respective ADS client value is type 0
SET (AmsNetAddr incl. client port). = None, 1 =
Hard, 2 =
0x0000 Medium, 3 =
Soft
ADSIOFFS_EX W Set the offset type for the __ is type 0 =
TERNALTIME_ ADSDevice notifications of the None, 1 =
SET respective ADS client (AmsNetAddr Hard, 2 =
incl. client port). Medium, 3 =
0x00__ Soft
ADSIOFFS_EX R LONGLON Reading the current offset for a type. __ is type:
TERNALTIME_ G 0 = None, 1 =
OFFSET Hard, 2 =
0x01__ Medium, 3 =
Soft
ADSIOFFS_EX W LONGLON Setting the current offset for a type. __ is type:
TERNALTIME_ G 0 = None, 1 =
OFFSET Hard, 2 =
0x01__ Medium, 3 =
Soft
ADSIOFFS_EX R LONGLON Reading the corrected time stamp. __ is type:
TERNALTIME_ G 0 = None, 1 =
ABSOLUTE Hard, 2 =
0x02__ Medium, 3 =
Soft
ADSIOFFS_EX R ULONG Reading the object ID from the __ is type:
TERNALTIME_ TimeOffset provider. 0 = None, 1 =
PROVIDER Hard, 2 =
0x03__ Medium, 3 =
Soft
ADSIOFFS_EX R LONG Reads the type that is used if no The return
TERNALTIME_ other type is set. value is type 0
SETALL = None, 1 =
0x0400 Hard, 2 =
Medium, 3 =
Soft
ADSIOFFS_EX W Sets the type that is used if no other __ is type 0 =
TERNALTIME_ type is set. None, 1 =
SETALL Hard, 2 =
0x04__ Medium, 3 =
Soft

The Defines can be found in the file "Ads.h".

The ADS consumer sample [} 223] illustrates the application.

3.5.7 Samples
Various samples illustrating the use of the corrected timestamps are provided for the benefit of the user:
• PLC Consumer [} 223]: A PLC program accesses corrected timestamps.
• C++ Consumer [} 224]: A C++ TcCOM module accesses corrected timestamps.
• ADS Consumer [} 223]: An ADS client in user mode accesses the corrected timestamps.

222 Version: 1.1.0 TwinCAT 3


Target systems

• C++ Provider [} 224]: A C++ TcCOM module determines an offset and provides it.

The corrected timestamps are also used by other components of the TwinCAT system. A required
configuration can be found with the respective components.

3.5.7.1 ADS consumer


The ADS Consumer sample retrieves corrected timestamps as described in the ADS API [} 221].

Download

Here you can access the https://infosys.beckhoff.com/content/1033/tc3_Grundlagen/Resources/


7705550603.zip for this sample.
ü Start the TwinCAT target system with which the ADS Consumer sample is to communicate. The PLC
Consumer [} 223] sample can be used.
1. Unpack the downloaded ZIP file.
2. Open the included vcxproj file in Visual Studio.
3. Adjust the target AmsNetID. (TcExternalTimeAdsClient.cpp, line 119)
ð The sample is ready for operation.

Description

The sample code can be found in the CPP file TcExternalTimeAdsClient.cpp

Different UseCases for receiving corrected timestamps are illustrated in the Main() method:
• Reading of the provider, the offset and the corrected timestamp from the system service for the
different offsets: uncorrected(0), soft(1), medium(2), hard(3), plus an invalid value (4) to illustrate the
error behavior.
• Reading the corrected timestamps from a PLC program for the different offsets.
• Reading the provider used and all providers.
• Subscribing to a variable in the PLC; the time provided via notification has a corrected timestamp. The
output takes place in the AdsNotificationCallback() method.

3.5.7.2 PLC Consumer


The PLC Consumer sample retrieves a corrected timestamp from the TwinCAT system and uses it.

Download

Here you can access the https://infosys.beckhoff.com/content/1033/tc3_Grundlagen/Resources/


7705583115.zip for this sample.
1. Open the tszip file that it contains in TwinCAT 3 by clicking on Open Project ….
2. Select your target system.
3. Build the sample on your local machine (e.g. Build->Build Solution).

4. Activate the configuration by clicking on .


ð The sample is ready for operation.

Description

The TcNtpExternalTimeProvider is configured under System > TcCOMObjects.


Here you can parameterize your own NTP server under Parameter (Init), if the default pool.ntp.org cannot
be reached.

TwinCAT 3 Version: 1.1.0 223


Target systems

The PLC program essentially consists of the function block FB_TcExternalTime. It provides functions for
reading a corrected timestamp from the TwinCAT system. The variable _eTimeType represents the type
(soft, medium, hard) and can be parameterized.

In MAIN, this function block is used for the eTimeType "Soft" to ensure that the corrected time set by NTP is
used.

3.5.7.3 C++ consumer


The C++ Consumer sample retrieves a corrected timestamp from the TwinCAT system and uses it.

Download

Here you can access the https://infosys.beckhoff.com/content/1033/tc3_Grundlagen/Resources/


7705552907.zip for this sample.
1. Open the zip file that it contains in TwinCAT 3 by clicking on Open Project ….
2. Select your target system.
3. Build the sample on your local machine (e.g. Build->Build Solution).

4. Activate the configuration by clicking on .


ð The sample is ready for operation.

Description

The TcNtpExternalTimeProvider is configured under System > TcCOMObjects.

Here you can parameterize your own NTP server under Parameter (Init), if the default pool.ntp.org cannot
be reached.

The C++ module cyclically determines a local timestamp in the CycleUpdate() method and corrects it. It can
be traced in the respective steps using the debugger. The corrected timestamp is provided as a parameter
(online).

The type required for this can be configured as parameter "TimeType" in the TcCOM object.

3.5.7.4 C++ provider


The C++ provider sample determines an offset and stores it in the TwinCAT system so that it can be used by
the consumers.

Download

Here you can access the https://infosys.beckhoff.com/content/1033/tc3_Grundlagen/Resources/


7705555211.zip for this sample.
1. Unpack the downloaded .zip file.
2. Open the .zip file that it contains in TwinCAT 3 by clicking on Open Project ….
3. Select your target system.
4. Build the sample on your local machine (e.g. Build->Build Solution).

5. Activate the configuration by clicking on .


ð The sample is ready for operation.

Description

The offset provider receives the offset to be provided as DataArea "ExternalTime.nOffset“. This is transferred
to the TwinCAT system as a TimeType medium, which can also be configured at runtime under Parameter
(Init).

224 Version: 1.1.0 TwinCAT 3


Target systems

In the CycleUpdate() method, the SetExternalTimeOffset method is used for this after a corresponding
register has been created using RegisterExternalTimeProvider for a TimeType.

3.5.8 FAQ

3.5.8.1 Windows as NTP client


Windows itself offers an NTP client for the system time. In addition, an NTP time can be retrieved using the
following script, which is useful for debugging purposes:
@echo off
set /p Server=Server:
w32tm /stripchart /computer:%Server% /packetinfo /samples:10
pause

3.5.8.2 Windows as NTP server


Windows itself offers an NTP server to provide timestamps.

Please note that only one component can use the port for NTP (udp/123). This means that either the
TwinCAT NTP server functionality [} 209] or the Windows NTP server can be used.

The Windows NTP server is disabled by default and can be activated later:
ü Windows 10
1. The registry key is set:
HKLM\System\CurrentControlSet\Services\W32Time\TimeProviders\NtpServer
Enabled = 1

2. The Windows Time system service is started and set to Autostart, if appropriate.

TwinCAT 3 Version: 1.1.0 225


Target systems

3.6 TcRTeInstall
The TcRTeInstall tool manages real-time Ethernet compatible devices of the control system. This involves
installing a real-time capable driver for the standard Ethernet connection of a control system.

TwinCAT 3 installation required


The TcRTeInstall application can only be used in combination with a complete installation of
TwinCAT 3 (XAE, runtime environment, XAR).

Administrator rights required


To run the TcRTeInstall application, you need administrator rights on the control system.

226 Version: 1.1.0 TwinCAT 3


Target systems

Call in TwinCAT 3 XAE

Call the driver via the menu TWINCAT → Show Realtime Ethernet Compatible Devices... .

Alternatively you can install the driver by adding a network capable device to the I/O configuration (e.g.
EtherCAT). In the adapter dialog of the network capable device, call the TcRTeInstall application with the
button Compatible Devices...:

Call in TwinCAT runtime environments

You can directly call the installation application for the TwinCAT RT Ethernet adapter on a TwinCAT 3
runtime system.

Location:

up to and including TwinCAT 3.1.4024: c:\TwinCAT3.1\System\TcRteInstall.exe

as of TwinCAT 3.1.4026: c:\Program Files (x86)\Beckhoff\TwinCAT\3.1\System\TcRteInstall.exe

Manage network connections

TcRteInstall displays the real-time capable (Compatible devices) and non-real-time capable (Incompatible
devices) network interface cards.

TwinCAT 3 Version: 1.1.0 227


Target systems

1. Select a real-time capable network interface card from the list of "compatible devices".
2. Click on the Install button.
ð The TwinCAT driver for real-time Ethernet and the TwinCAT Ethernet protocol are installed for the
selected device.

228 Version: 1.1.0 TwinCAT 3


Target systems

The option Show Bindings shows the connected protocol of the installed RT Ethernet device.

TwinCAT 3 Version: 1.1.0 229


Target systems

230 Version: 1.1.0 TwinCAT 3


Type system

4 Type system
TwinCAT 3 provides a type system for the management of data types. The type system consists of system
basic types and can be extended by custom data types through the customer project.

This documentation describes the TwinCAT 3 type system and the management of data types. The TMC
editor, with which the data types are created and described, is described in the documentation entitled “C++”
in the TwinCAT Module Class Editor (TMC) section.

4.1 Project-based type system


The TwinCAT 3 type system is project-specific; i.e. it is a fixed component of a TwinCAT 3 project in a Visual
Studio solution.

Data types can be defined at various points and transferred if necessary to the TwinCAT 3 type system.
Thus, local data types can also exist that don't exist in the TwinCAT 3 type system.

You will find the type system in the TwinCAT 3 project tree as an object in the SYSTEM subtree.

4.2 Data types


The TwinCAT 3 type system displays the data types in an editor on four different tabs. The editor is opened
by double-clicking on the "Type System" object in the TwinCAT 3 project tree.

TwinCAT 3 Version: 1.1.0 231


Type system

The following data types (TMC editor: "Specifications") are displayed on the Data Types tab:
• Alias: these data types are simply synonyms for other data types. For example, a time range (duration)
can be defined in a specific project as UINT.
• Struct: these data types are structures of other data types, which in turn can also be structures.
• Enum: these data types describe enumerations.
• Array: these data types are arrays with a defined number of dimensions as well as the respective
length.

The interfaces are displayed on the Interfaces tab. This data type describes an interface that can be
provided or used by different components such as function blocks or TcCOM modules. An interface consists
of methods that have a respective signature.

The Functions tab shows PLC functions and PLC function blocks whose definition was read from in a TMC/
TML file.

The Event Classes tab defines event classes that are used for the TwinCAT 3 EventLogger.

4.3 Handling of data types


In order to create or modify a data type via the TwinCAT 3 type system, select the New or Edit command
from the context menu of the first table column on the appropriate tab of the type system editor. Both
commands open the TMC editor in which you can edit the data type.

Data types from PLC projects

Data types (DUTs) can be created and saved in a PLC project. These data types initially exist locally in the
PLC project and are not usable from the point of view of TwinCAT 3. If the data types are used in the input/
output memory map (%I* / %Q*), they are imported into the TwinCAT 3 type system so that they can also be
linked through the mapping.

With the Convert to Global Type command in the context menu of a DUT in the PLC project tree you can
transfer the DUT to the type system of the higher-level TwinCAT project. Thereafter the data type is usable in
the PLC via the external types and is managed in the TwinCAT 3 type system.

To transfer a data type from the TwinCAT 3 type system to a PLC project, you can use the source code in
the “Data Types” dialog.

232 Version: 1.1.0 TwinCAT 3


Type system

Data types from C++ projects

In C++ projects the data types are defined in the TMC editor in parallel with the modules. Like the internal
DUTs in the PLC project, these data types are local and thus invisible in the TwinCAT 3 type system.

Through the use of the data types in a C++/Matlab module, which has also been instanced, the data types
are inserted into the TwinCAT 3 type system.

You can also insert a data type into the TwinCAT 3 type system without using the data type in an instanced
C++ module by activating the Persistent (even if unused) check box.

Use of data types in several projects

In some cases it may be useful to use data types in several projects. In particular for EAP/network variables
it can be useful to use the same data type on both the publisher and subscriber side.

You can create individual TMC files for this under the "Type System" node.

A check box appears in front of every data type in the editor window of the TMC files. Using the check box
you can specify which data type is to be deposited in the respective TMC file.

TwinCAT 3 Version: 1.1.0 233


Type system

The data types are additionally deposited in the TMC files. You can use these files on different computers
and in different projects, for example, by means of file exchange or version control.
However, the file itself must not be used by different projects at the same time, so that these are normally
stored in the project directory and this project is then available as a copy on different computers, e.g. via
version control.

Since the GUID is used to identify the data type, the type system recognizes this double deposition
automatically.

When using data types after they have been integrated in several projects, make sure that changes to the
data types are made as far as possible only in one place. Otherwise the different variants can no longer be
merged to a common version.

See also:

Management and identification of data types [} 234]

4.4 Management and identification of data types


Data types in the TwinCAT 3 type system are fundamentally identified on the basis of their GUID. Thus,
several data types can exist with the same name. The same applies to different versions of a data type.
Each version of a data type is assigned a new GUID.

At the same time, each data type has a list of data types that it keeps hidden ("Datatype Hides").

234 Version: 1.1.0 TwinCAT 3


Type system

This makes it possible to use different versions of a data type in the project at the same time.

The Update Instances... command in the context menu of a data type in the type system editor (Data Types
tab) employs the respectively latest version for selected uses of a data type.

TwinCAT has a so-called reference counter for each data type. This counter can be seen in the RefCount
column in the editor of the type system. Each use of the data type in a project, and also in an editor and so
on, increments the counter. If a counter is at 0, the data type is no longer used and is discarded.

If the Persistent (even if unused) setting in the context menu of a data type is activated, the data type
description will be saved in the TwinCAT project file (*.tsproj) even if the data type is not used in the
TwinCAT project. The setting is activated by default with data types that are newly created directly via the
type system editor. This ensures that the data types are not directly deleted if the TwinCAT project is saved
before the new data types are used.

If a SharedTMC is used underneath the Type System object in the TwinCAT project tree, the setting should
not be activated for data types in this file as the data types are saved both in the project and in the
SharedTMC. The setting is deactivated by default with data types that are newly created directly via a
SharedTMC editor.

The Auto Delete (if unused) setting should not be manually changed, but is shown for the sake of
completeness. Data types for which this setting is activated are hidden for PLC projects and cannot be used
there. The setting should not be used, for example, to automatically clean the type system. Unused data
types are not automatically saved in the TwinCAT project and are then no longer in the type system after
reloading the TwinCAT project.

4.5 Alignment of data types


The memory layout of a data type is determined by the alignment. Further information on the alignment can
be found in the “Alignment” section in the documentation entitled “PLC”.

TwinCAT 3 Version: 1.1.0 235


Type system

With the default alignment of 8 bytes it can be ensured that the access to data types functions optimally in
terms of runtime and access on different platforms. Deviation from this should only take place in exceptional
cases.

The TwinCAT 3 type system marks data types in color.


• Yellow if the length of the data type is not a multiple of the largest internal field (max. 8 bytes). As a
result, the alignment no longer obeys the rules in the case of an array of such a data type.

• Red if the alignment within the data type no longer obeys the rules.

The TMC editor offers the possibility to specify the memory layout of a data type for a selected alignment.

Alternatively, the layout can be manually specified using offsets.

If the size of a data type that is used in another data type is changed, then this data type must also be
adjusted. The TMC editor offers an appropriate recursive function for this at the data type overview level.

4.6 Files in connection with the type system


The TwinCAT 3 type system is formulated entirely in XML.

Depending on the field of application there are different files that contain the data types:
• .tsproj file – TwinCAT project
This file contains the entire TwinCAT project, including the complete TwinCAT 3 type system.

236 Version: 1.1.0 TwinCAT 3


Type system

• .tmc files – TwinCAT Module Class files


These files are used to describe the TcCOM modules themselves. They include module class
descriptions and the data types used. At the same time, these files are used to realize the exchange of
data types between projects, as described above.
• .tmi files – TwinCAT Module Instance files
These files describe the instance of a class. They are deposited on the destination by the
TwinCAT 3 Engineering in order to describe an instance of a class. In addition, instance information
can also be transferred from one project to another using a .tmi file.

TwinCAT 3 Version: 1.1.0 237


Support and Service

5 Support and Service


Beckhoff and their partners around the world offer comprehensive support and service, making available fast
and competent assistance with all questions related to Beckhoff products and system solutions.

Download finder

Our download finder contains all the files that we offer you for downloading. You will find application reports,
technical documentation, technical drawings, configuration files and much more.

The downloads are available in various formats.

Beckhoff's branch offices and representatives

Please contact your Beckhoff branch office or representative for local support and service on Beckhoff
products!

The addresses of Beckhoff's branch offices and representatives round the world can be found on our internet
page: www.beckhoff.com

You will also find further documentation for Beckhoff components there.

Beckhoff Support

Support offers you comprehensive technical assistance, helping you not only with the application of
individual Beckhoff products, but also with other, wide-ranging services:
• support
• design, programming and commissioning of complex automation systems
• and extensive training program for Beckhoff system components
Hotline: +49 5246 963-157
e-mail: support@beckhoff.com

Beckhoff Service

The Beckhoff Service Center supports you in all matters of after-sales service:
• on-site service
• repair service
• spare parts service
• hotline service
Hotline: +49 5246 963-460
e-mail: service@beckhoff.com

Beckhoff Headquarters

Beckhoff Automation GmbH & Co. KG

Huelshorstweg 20
33415 Verl
Germany
Phone: +49 5246 963-0
e-mail: info@beckhoff.com
web: www.beckhoff.com

238 Version: 1.1.0 TwinCAT 3


Trademark statements

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.

Third-party trademark statements

Arm, Arm9 and Cortex are trademarks or registered trademarks of Arm Limited (or its subsidiaries or affiliates) in the US and/or elsewhere.

BiSS is a trademark of IC Haus GmbH.

Intel, the Intel logo, Intel Core, Xeon, Intel Atom, Celeron and Pentium are trademarks of Intel Corporation or its subsidiaries.

The registered trademark Linux® is used pursuant to a sublicense from the Linux Foundation, the exclusive licensee of Linus Torvalds, owner
of the mark on a worldwide basis.

Microsoft, Microsoft Azure, Microsoft Edge, PowerShell, Visual Studio, Windows and Xbox are trademarks of the Microsoft group of companies.
More Information:
www.beckhoff.com/automation

Beckhoff Automation GmbH & Co. KG


Hülshorstweg 20
33415 Verl
Germany
Phone: +49 5246 9630
info@beckhoff.com
www.beckhoff.com

You might also like