Considerations

This section describes support limitations, naming conventions, restrictions and performance considerations of C++ code deployment on PMP.

GNU Make

GNU Make (version 3.81) is used to build the processing block binary file. It it not included in the PMP installer and should be installed separately. For Windows it can be downloaded from SourceForge or it can be installed via Chocolatey. On Debian Linux it can be installed via the following command:

sudo apt install build-essential

Simulator

Visual Studio 2019 with workload Desktop development with C++ is required in order to build processing block binary files for Windows simulator. It can be downloaded from the Microsoft website.

GCC is required in order to build processing blocks binary files for Debian Linux simulator. It can be installed via the following command:

sudo apt install build-essential

Naming conventions

When naming interfaces (i.e. inputs, parameters, outputs, events or updatables) in the interface schema the following rules apply:

  • Maximum 64 characters are allowed.

  • The characters should be in allowed set [a-zA-Z0-9_].

  • The name cannot start with a digit.

  • PMP reserved words are not allowed (e.g. Output, Input).

  • C++ keywords are not allowed (e.g. double, single).

  • Names should be unique.

An error is thrown during parsing the interface schema when naming does not comply with these rules.

Memory allocation

Memory allocation is only allowed in the Init() function. Allocating memory in the Update() or Output() functions is not allowed as it degrades performance and increases the execution time of the processing block over time. The asynchronous exception 0x0200004e is added to the asynchronous exception queue when allocating memory in Update() or Output().

Attention

The performance and memory usage of custom C/C++ code on a motion controller or EtherCAT SubDevice cannot be guaranteed, because these depend on the implementation. Custom processing blocks can have a negative performance impact on the remainder of the system, e.g. due to cache influences and memory accesses. It is the responsibility of the user to evaluate the performance.

Several features are available within PMP which can be used to get a performance indication:

Sometimes calculation time can be improved by splitting the code over smaller processing blocks, such that they be executed in parallel on different cores.