Execution and Synchronization Manager (ESM)

PLCnext Technology also features task handling. The ESM performs task handling, monitoring and chronological sequencing of programs from different programming languages. Each processor core of a controller is managed by one ESM. One ESM is therefore assigned to one processor core. If a controller has more than one processor core, then there are also several ESMs. For example, AXC F 2152 has 2 processor cores and 2 ESMs.

Note: There's a visual explanation to the ESM and its companion, the Global Data Space (GDS), available in a tutorial video.

The ESM offers the following advantages:

  • Configuration and monitoring of cyclic tasks and idle tasks.
  • The execution times of the tasks are available as system variables and can be used for diagnostics.
  • System balancing.
  • Multicore systems are supported.

Note: When planning a project that depends on task-synchronous real-time data logging (e.g. by means of the DataLogger), it is highly recommended to select the hardware according to a maximum CPU load of 70 to 80 percent, visible in the PLCnext Engineer cockpit (show where to see the CPU loadshow where to see the CPU load). 

The ESM can also be used to execute programs and program parts in real time that were created in different programming environments. These can include high-level languages such as C++, IEC 61131-3 code, and model-based tools such as MATLAB®/Simulink®. Program parts that were created using different programming languages can also be combined and processed within a task. The ESM controls the processes and also executes the high-level language programs deterministically in the defined order. To ensure data consistency between the tasks at all times, all data is synchronized with the GDS whenever a task is called up (see also in GDS).


Task configuration using PLCnext Engineer

You can use the PLCnext Engineer  software to easily create and configure tasks. Here, you can proceed as in a conventional IEC 61131-3 program. The IEC 61131-3 program, or the program created in a different programming environment and then imported into PLCnext Engineer, can be instantiated in a task. It does not matter whether the programs were created with C++, IEC 61131-3 or MATLAB®/Simulink®.

In the PLCnext Engineer  Tasks and Events editor, you can instantiate a task and assign it to the desired program instances. A description of this procedure and further information on task handling with PLCnext Engineer  is available in its Online Help. You can call the Online Help from within PLCnext Engineer.

See an example of tasks and program instances in PLCnext Engineer here:


Task configuration via configuration files

When a project is downloaded from PLCnext Engineer to the controller, the previous configuration files are overwritten with the new configuration files. Manual configuration describes how you can safely store your manually modified configuration in the controller file system, thus preventing the loss of data.


You can also modify the task configuration, the instantiation of programs and the assignment to a processor core (one ESM per processor core) via configuration files in XML format without using PLCnext Engineer. All of the important settings can be configured directly in the configuration file on the controller. To modify the configuration manually, the XML file can be edited using any editor. The ESM can load one or several configuration files and create a joint configuration.

Example of a configuration file:

<?xml version="1.0" encoding="utf-8"?>
<EsmConfigurationDocument xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaVersion="1.0" 
      <PreDefinedEventTask name="Cold"  eventName="Arp.Plc.Esm.OnColdStart" confirmed="false" priority="0" 
       watchdogTime="100000000" executionTimeThreshold="0" />
      <PreDefinedEventTask name="Warm"  eventName="Arp.Plc.Esm.OnWarmStart" confirmed="false" priority="0" 
       watchdogTime="100000000" executionTimeThreshold="0" />
      <PreDefinedEventTask name="Except"  eventName="Arp.Plc.Esm.OnException" confirmed="false" priority="0" 
       watchdogTime="100000000" executionTimeThreshold="0" />
      <IdleTask name="Idle"  watchdogTime="100000000" executionTimeThreshold="0" />
      <PreDefinedEventTask name="interbus"  eventName="Arp.Io.Interbus.OnCycleEnd" confirmed="true" priority="0" 
       watchdogTime="100000000" executionTimeThreshold="0" />
      <EsmTaskRelation esmName="ESM1" taskName="Cold" />
      <EsmTaskRelation esmName="ESM1" taskName="Warm" />
      <EsmTaskRelation esmName="ESM1" taskName="Execpt" />
      <EsmTaskRelation esmName="ESM1" taskName="Idle" />
      <EsmTaskRelation esmName="ESM1" taskName="interbus" />
      <Program name="Main1" programType="Main" componentName="Arp.Plc.Eclr" />
      <Program name="Main2" programType="Main" componentName="Arp.Plc.Eclr" />
      <Program name="Main3" programType="Main" componentName="Arp.Plc.Eclr" />
      <Program name="Main4" programType="Main" componentName="Arp.Plc.Eclr" />
      <Program name="Main5" programType="Main" componentName="Arp.Plc.Eclr" />
      <TaskProgramRelation taskName="Cold" programName="Arp.Plc.Eclr/Main1" order="0" />
      <TaskProgramRelation taskName="Warm" programName="Arp.Plc.Eclr/Main2" order="0" />
      <TaskProgramRelation taskName="Execpt" programName="Arp.Plc.Eclr/Main3" order="0" />
      <TaskProgramRelation taskName="Idle" programName="Arp.Plc.Eclr/Main4" order="0" />
      <TaskProgramRelation taskName="interbus" programName="Arp.Plc.Eclr/Main5" order="0" />
<TaskEvents />


Be aware of the XML entities when editing XML configuration files: 
There are symbols in the XML code that cannot be represented as attribute values because they have a syntactical function.

For example, the characters < and > are used for opening and closing XML tags. To be able to use these characters as attribute values in their genuine meaning "less than" or "greater than", entities are required.

The following entities are predefined in the XML specification. Make sure to use these entities in attribute values to avoid XML parsing errors.

Character Entity
Ampersand (& &amp;
Single quote (') &apos;
Double quote (") &quot;
Less than (<) &lt;
Greater than (>) &gt;

To configure tasks for execution in the ESM (Execution and Synchronization Manager) using the *.esm.config configuration file, proceed as follows:

Defining a task

A task is defined between the tags <Tasks> and </Tasks>

Example of defining a task:

  <CyclicTask name="SquareWave_Cycle"  priority="0" cycleTime="100000000" watchdogTime="100000000" executionTimeThreshold="0" />
  <CyclicTask name="CPP_Cycle"  priority="1" cycleTime="100000000" watchdogTime="100000000" executionTimeThreshold="0" />
  <CyclicTask name="PCWE_Cycle"  priority="2" cycleTime="100000000" watchdogTime="100000000" executionTimeThreshold="0" />
  <PreDefinedEventTask name="Cold"  eventName="Arp.Plc.Esm.OnColdStart" confirmed="false" priority="0" 
   watchdogTime="100000000" executionTimeThreshold="0" />

Definition of the task starts with the task type.

Here, enter the type:

  • CyclicTask
  • IdleTask
  • PreDefinedEventTask - System event task (cold restart, warm restart, hot restart, stop, exception)

Define the tasks using the attributes from the following table:

Attribute Description


The name attribute defines the task name.

  • Enter a unique  task name.

It can only be used once per controller.


The priority attribute defines the task priority.

  • Enter a value to specify the task priority.

0: Highest priority

15: Lowest priority

If no priority is indicated for an idle task. It is automatically lower than the lowest priority.

Within one ESM, each task must be assigned a different priority. Two or more tasks in one ESM having the same priority may lead to unwanted jitter.


The cycleTime attribute defines the duration of the task (for cyclic tasks only).

  • Enter the value in nanoseconds.

The minimum value of the AXC F 2152 controller is 1 ms (1000000 ns). Select a multiple of the minimum value. Depending on the application, the jitter time for a task may increase as the system load increases.


The watchdog monitors whether the task was executed within the specified time.

  • Enter the value in nanoseconds. Value “0” means that there is no monitoring.

The watchdogTime attribute can be used for cyclic and idle tasks.


The following values are valid for this attribute.

  • Arp.Plc.Esm.OnColdStart (cold restart)
  • Arp.Plc.Esm.OnWarmStart (warm restart)
  • Arp.Plc.Esm.OnHotStart (hot restart)
  • Arp.Plc.Esm.OnStop (stop)
  • Arp.Plc.Esm.OnException (exception)

Assigning a task

Once the task has been defined, it has to be assigned to the desired ESM. Assignment is defined between the tags <EsmTaskRelations> and </EsmTaskRelations>.

Example: Assigning a task to an ESM

   <EsmTaskRelation esmName="ESM1" taskName="SquareWave_Cycle" />
   <EsmTaskRelation esmName="ESM1" taskName="CPP_Cycle" />
   <EsmTaskRelation esmName="ESM1" taskName="PCWE_Cycle" />
  • Assign the task using the attributes from the following table:
Attribute Description


The esmName attribute defines the name of the ESM the respective task is to be assigned to.

  • Enter the task name.

Example: ESM1 or ESM2 for a controller with dual core processor.


The taskname attribute defines the task to be assigned.

  • Enter the name of the task to be assigned.

Instantiating programs

Once the task is defined and assigned to an ESM, programs can be instantiated. Programs are defined between the tags <Programs> and </Programs>. The definition of a program instance is introduced with tag <Program>. Programs that have been programmed in IEC 61131-3 can only be sent and configured using PLCnext Engineer. The code example originates from a config file generated using PLCnext Engineer .

Example for instantiating programs:

   <Program name="SquareWave" programType="PCWE_SquareWave_P" componentName="Arp.Plc.Eclr" />
   <Program name="CPP_Counter" programType="CPP_Counter_P"  componentName="CPP_Counter.CPP_Counter_C-1" />
   <Program name="CPP_Counter_P1" programType="CPP_Counter_P" componentName="CPP_Counter.CPP_Counter_C-1" />
   <Program name="PCWE_Counter" programType="PCWE_Counter_P" componentName="Arp.Plc.Eclr" />

Instantiate programs using these attributes:

Attribute Description


The name attribute defines the name of the program instance.

  • Enter the name of the program instance.

The name must be unique within the controller.


The programType attribute defines the program type.

  • Enter the program type.


The componentName attribute defines the name of the component that contains the program.

  • Enter the name of the component as it is defined in the *.acf.config or *.plm.config configuration file. The Arp.Plc.Eclr component is reserved for IEC 61131-3 programs that were instantiated using PLCnext Engineer (see Working with Eclipse®)

Assigning program instances to a task

The program instances have to be assigned to a task. Assignment is made between tags <TaskProgramRelations> and </TaskProgramRelations>.

Assigning program instances to a task:

   <TaskProgramRelation taskName="SquareWave_Cycle" programName="Arp.Plc.Eclr/SquareWave" order="0" />
   <TaskProgramRelation taskName="CPP_Cycle" programName="CPP_Counter.CPP_Counter_C-1/CPP_Counter" order="0" />
   <TaskProgramRelation taskName="CPP_Cycle" programName="CPP_Counter.CPP_Counter_C-1/CPP_Counter_P1" order="1" />
   <TaskProgramRelation taskName="PCWE_Cycle" programName="Arp.Plc.Eclr/PCWE_Counter" order="0" >
  • Assign the program instance to a task using the attributes from the following table.
Attribute Explanation


The taskname attribute specifies the name of the task the program instance is to be assigned to.

  • Enter the name of the desired task the program instance is to be assigned to.


The programName attribute defines the name of the program instance with the prefixed library and component names. The name is used to select the program instance to be processed in the task.

  • Enter the full name in the program instance to be processed.


The order attribute determines the order in which program instances are processed within a task, starting with 0.

  • Enter a number to determine the processing sequence.

The program instance with the digit 0 is processed first. Each number can only be used once for each task.




•  Web browser recommendation: Chrome/Edge 88 or newer, Firefox ESR 90 or neweror Safari • 
• Published/reviewed: 2022-09-14 • Revision 046 •