Beckhoff TE1010 User Manual

Manual | EN
TE1010
TwinCAT 3 | Realtime Monitor
2020-09-24 | Version: 1.3

Table of contents

Table of contents
1 Foreword ....................................................................................................................................................5
2 Overview.....................................................................................................................................................7
3 Basic principles .........................................................................................................................................8
3.2 Display in the Real-time Monitor......................................................................................................12
3.3 Use of cursors .................................................................................................................................16
4 Quick start................................................................................................................................................20
5 Reference, user interface........................................................................................................................22
5.1 Menu bar .........................................................................................................................................22
5.1.1 Project.............................................................................................................................. 22
5.1.2 User contexts................................................................................................................... 23
5.1.3 Tools ................................................................................................................................ 24
5.1.4 Info................................................................................................................................... 25
5.2 Toolbar - Real-time Monitor toolbar.................................................................................................25
5.3 Project tree ......................................................................................................................................26
5.4 Display window................................................................................................................................28
5.5 Properties window ...........................................................................................................................29
5.5.1 Project node..................................................................................................................... 29
5.5.2 Context node ................................................................................................................... 30
5.5.3 Marker group element...................................................................................................... 31
5.6 Cursor window.................................................................................................................................32
5.7 Event window ..................................................................................................................................32
6 PLC API.....................................................................................................................................................33
6.1 Function blocks................................................................................................................................33
6.1.1 FB_RTMon_LogMark ...................................................................................................... 33
6.1.2 FB_RTMon_LogMarkBase .............................................................................................. 36
6.2 Data types .......................................................................................................................................37
6.2.1 ST_RTMon_MarkDef....................................................................................................... 37
6.3 Global constants..............................................................................................................................38
6.3.1 TcMarkOption .................................................................................................................. 38
7 C++ API.....................................................................................................................................................39
7.1 Data types .......................................................................................................................................39
7.1.1 TcMark16......................................................................................................................... 39
7.2 Classes............................................................................................................................................39
7.2.1 CTcLogMark .................................................................................................................... 39
7.3 Constants ........................................................................................................................................41
TE1010 3Version: 1.3
Table of contents
TE10104 Version: 1.3
Foreword

1 Foreword

1.1 Notes on the documentation

This description is only intended for the use of trained specialists in control and automation engineering who are familiar with applicable national standards. It is essential that the documentation and the following notes and explanations are followed when installing and commissioning the components. It is the duty of the technical personnel to use the documentation published at the respective time of each installation and commissioning.
The responsible staff must ensure that the application or use of the products described satisfy all the requirements for safety, including all the relevant laws, regulations, guidelines and standards.
Disclaimer
The documentation has been prepared with care. The products described are, however, constantly under development. We reserve the right to revise and change the documentation at any time and without prior announcement. No claims for the modification of products that have already been supplied may be made on the basis of the data, diagrams and descriptions in this documentation.
Trademarks
Beckhoff®, TwinCAT®, EtherCAT®, EtherCAT G®, EtherCAT G10®, EtherCAT P®, Safety over EtherCAT®, TwinSAFE®, XFC®, XTS® and XPlanar® are registered trademarks of and licensed by Beckhoff Automation GmbH. Other designations used in this publication may be trademarks whose use by third parties for their own purposes could violate the rights of the owners.
Patent Pending
The EtherCAT Technology is covered, including but not limited to the following patent applications and patents: EP1590927, EP1789857, EP1456722, EP2137893, DE102015105702 with corresponding applications or registrations in various other countries.
EtherCAT® is a registered trademark and patented technology, licensed by Beckhoff Automation GmbH, Germany
Copyright
© Beckhoff Automation GmbH & Co. KG, Germany. The reproduction, distribution and utilization of this document as well as the communication of its contents to others without express authorization are prohibited. Offenders will be held liable for the payment of damages. All rights reserved in the event of the grant of a patent, utility model or design.
TE1010 5Version: 1.3
Foreword

1.2 Safety instructions

Safety regulations
Please note the following safety instructions and explanations! Product-specific safety instructions can be found on following pages or in the areas mounting, wiring, commissioning etc.
Exclusion of liability
All the components are supplied in particular hardware and software configurations 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 engineering who are familiar with the applicable national standards.
Description of symbols
In this documentation the following symbols are used with an accompanying safety instruction or note. The safety instructions must be read carefully and followed without fail!
DANGER
Serious risk of injury!
Failure to follow the safety instructions associated with this symbol directly endangers the life and health of persons.
WARNING
Risk of injury!
Failure to follow the safety instructions associated with this symbol endangers the life and health of per­sons.
CAUTION
Personal injuries!
Failure to follow the safety instructions associated with this symbol can lead to injuries to persons.
NOTE
Damage to the environment or devices
Failure to follow the instructions associated with this symbol can lead to damage to the environment or equipment.
Tip or pointer
This symbol indicates information that contributes to better understanding.
TE10106 Version: 1.3
Overview

2 Overview

The TwinCAT 3 Real-time Monitor enables precise diagnostics and optimization of the runtime behavior of tasks in the TwinCAT 3 runtime. It offers a graphical representation of the temporal processing of real-time tasks and their modules across all cores. In addition, user-defined processes and their dependencies can be represented graphically through appropriate instrumentation of the control software.
The Real-time Monitor makes the time behavior of the control software on a target system completely transparent and enables comprehensive time analysis. It thus supports both fault diagnosis and time optimization of the configuration, especially on multi-core systems.
Installation
A separate installer is used for the installation. The license is activated as usual under TwinCAT 3.
Requirements
The Real-time Monitor can only be used for diagnosis of TwinCAT 3.1 runtimes from TwinCAT 3.1 version
4024.0 or higher.
It is suitable for Windows 10-based target systems, but not for target systems based on Windows CE.
Licensing
The TwinCAT 3 Real-time Monitor (TE1010) is an Engineering product. Licensing is therefore carried out exclusively on the Engineering system.
There is no 7-day trial license available for this product.
TE1010 7Version: 1.3
Basic principles

3 Basic principles

The following chapter describes the basic principles that should be read before using the TwinCAT 3 Real­time Monitor.

3.1 TwinCAT 3 Real-Time

According to the DIN 44300 standard, real-time / real-time operation is defined as follows: Real-time operation is an operating mode of a computing system in which programs for the processing of 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 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 function 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 or later. 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, but no later than after 90% of the set cycle time, TwinCAT only on shared cores switches back 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 sequence 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 already explicitly prevented in the user program through the use of interlocks).
Scheduling in which the priority of a task is derived from its cycle time is also known as rate-monotonic scheduling. Activating the option "Automatic Priority Management" automatically sets TwinCAT 3 Real-Time to this value. Since this is not always the best solution for every application, the priorities can be adjusted manually.
Exemplary representation of the call of a PLC task:
TE10108 Version: 1.3
Basic principles
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 (jitter) to the same extent.
Sample call of a task with "IO at task start“
By using the "IO at task start" option, the processing sequence 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.
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.
TE1010 9Version: 1.3
Basic principles
Isolated cores:
As described under Realtime 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.
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.
TE101010 Version: 1.3
Basic principles
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 exceedance 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:
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 field­bus, 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.
TE1010 11Version: 1.3
Basic principles

3.2 Display in the Real-time Monitor

In simple terms, the TwinCAT 3 Real-time Monitor enables the display of grouped events. In order to avoid confusion with the messages or alarms stored in the TwinCAT EventLogger, the data handled by the TwinCAT 3 Real-time Monitor are referred to as (time) markers.
These markers can be used to represent the temporal behavior of tasks or user processes. For this purpose, the markers are assigned an ID, a marker type, a context and a timestamp. In addition, if required a user­defined date formatted as UINT can be provided, in order to include additional information in the display in the real-time monitor (e.g. error number, state of a state machine etc.).
Marker ID:
The marker ID is used to identify the displayed task / process. In other words, all markers relating to the same task/process should use the same marker ID.
Marker type:
The TwinCAT 3 Real-time Monitor enables the display of events or processes / operations over time. For the representation of processes / operations, these are marked as a sequence. A sequence can be divided into one or more intervals. Markers can be typed to define the start or end of sequences or intervals. In addition, they can also show events within an application over time. A distinction is therefore made between the following types of markers:
1. Marker: The marker can be used to log an event, e.g. the time of an alarm or the change of a state etc.
2. Sequence start: A sequence start indicates the time when a task / process is allowed to start (higher-priority tasks / processes may result in a delay).
3. Interval start: An interval start specifies the time when a task / process actually starts. Due to interruptions etc., a se­quence may contain several interval starts.
4. Interval stop: An interval stop specifies the time when a task / process is no longer executed. This can happen, for example, due to interruptions caused by higher-priority tasks or unfulfilled dependencies.
5. Sequence stop: A sequence stop indicates the point in time at which a task may no longer run or a process is termi­nated.
Context:
A context describes a summary of markers or marker groups.
For the system tasks, all tasks that are processed on a core are combined into one context (e.g. core 0). Such a (real-time) context thus maps the scheduling within a real-time kernel. For these real-time contexts, only one of the tasks assigned to a context is active at any one time. This restriction does not apply to user­specific marker groups.
When using simple markers (by using FB_Mark), the user-specific marker groups are automatically grouped according to their application ports. For example, all markers stored from within a PLC project with port 851 are assigned to a context with context ID 851 (hexadecimal 0x353).
When using more complex markers (based on the function block FB_RTMon_LogMarkBase [}36]), contexts (i.e. correlations) can be defined independently. This could be, for example, a grouping by process type or by machine modules (functional units).
Display in the tree view:
As described above, all markers that describe the same task / process use the same marker ID. These markers are combined into a marker group and are assigned an entry in the tree view of the TwinCAT 3 Real-time Monitor.
TE101012 Version: 1.3
Basic principles
An entry with the corresponding task name is automatically created in the tree for the system tasks.
For user-related marker groups that describe processes, for example, this must be done manually. For each detected user-specific marker group an entry NewGroup automatically appears in the tree, which can be identified by the marker ID (corresponds to the group ID in the Properties window of the group). This group
can be renamed as required (see Context node [}30]).
As described under Display in the Real-time Monitor [}12], the individual marker groups are combined into contexts. This happens automatically for the system tasks and when simple markers are used. When using extended markers, the context ID that is transferred in the application code is used for this purpose.
The names of marker IDs (group IDs) and contexts can be exported for later reuse and subse­quently re-imported.
In the chart display, a marker group (i.e. all markers of a task / process) is shown within one row. For more information see Display in the Real-time Monitor [}13].
Chart display:
Symbols in the chart display:
TE1010 13Version: 1.3
Loading...
+ 30 hidden pages