Core Management

TwinCAT 3 offers extensive support for multi-core systems.

1. Select the number of cores you want to use for the TwinCAT Runtime. (Marked in red in the graphic.)
2. Select the number of cores that Windows can access and use. (Marked in orange in the graphic.)
3. Define which CPUs of TwinCAT are to be used as real-time kernels (RT core).
The cores are set appropriately.
Core Management 1:
Core Management 2:

RT cores are required by real-time tasks like PLC tasks, software tasks and I/O tasks (EtherCAT, Profibus, ...). If no RT core(s) are selected, only tasks that do not require real-time can be executed.

  • Select the RT core(s) to use the real-time.

Further information about TwinCAT real-time can be found in the documentation Basics in chapter Real-Time.

Core Management 3:

Core Management 4:

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. The Base Time is the time after which scheduling is triggered on a core.

Note:

  • Cycle times smaller than the Base Time set on a core are not possible.
  • The cycle times of the tasks are integer multiples of the Base Time set on the respective core.
  • If the application does not require it, the Base Time on Shared Cores should not be set below 1 ms. This could slow down the performance of the Windows system without noticeable performance benefits for the real-time kernel.
  • Base times far below 1 ms require PC systems with sufficient performance.
  • Setting Base Time to "None" means that you can only execute tasks that do not require real-time (AMS Router, TwinCAT Scope, ADS OCX, ...).

Core Management 5:

Core Management 6:

On shared cores, this value defines the maximum percentage of base time that the scheduler can use for real-time tasks. The remaining percentage is available for Windows.

After completion of a real-time task cycle, the scheduler switches back to Windows. So the remaining time of the cycle of the real-time task is not blocked, but available for Windows.

Core Management 7:

Core Management 8:

 

TwinCAT real-time itself operates with very low real-time fluctuations (jitter). The total jitter depends on different components of a PC (hardware, BIOS, drivers, ...). TwinCAT measures and monitors the jitter and issues a warning if a preset limit value is exceeded.

We recommend to run TwinCAT on Beckhoff IPCs, because they are optimized in detail for low jitter.

Core Management 9:

Core Management 10:

With TwinCAT Version 3.1.4026 it is possible to provide a separate memory area for each real-time kernel. This memory is automatically used first by runtime modules that run on these cores and allocate memory at runtime. When this memory is used up, the memory to be allocated is used from the shared memory area held in the router.

With Version 3.1.4026, the memory for communication and the memory that runtime modules can use to allocate memory are separated. A maximum of 25% of the defined router memory is used for communication.

Core Management 11:

Core Management 12:

From TwinCAT version 3.1.4026.6 it is possible to use the TwinCAT Core Boost feature (see chapter Core Boost tab). If TwinCAT Core Boost is supported on a target system and is activated, it is possible to set the clock frequency for the individual real-time kernels.