Custom C/C++ code

PMP provides a toolbox that exports user C/C++ code to PMP motion controllers or PMP EtherCAT SubDevices. This section describes the specifics about how to build C/C++ code for PMP.

Workflow

C++ code deployment workflow gives an overview of the workflow of using custom C or C++ code in PMP. See Considerations for general considerations, prerequisites, limitations and naming conventions and restrictions.

C++ code deployment workflow

C++ code deployment workflow

Start project

By using the Start project command of the Processing block interface generator tool a new project can be created. A new project consists of a build environment, interface definition YAML file and base class.

The interface of the processing block is defined via an interface definition YAML file. Processing block interface definition describes the supported interfaces and how to define them.

The methods available for implementation are described in Processing block methods, the functions per PMP object class in PMP object classes and the available callback functions in Callback functions. The supported standard runtime functions are stated in Supported runtime functions.

Build code

make builds binary files for all supported targets. (GNU Make is required, see Considerations). Before building the binary file, the make command first executes the Generate function of the Processing block interface generator tool to update the base classes and controller description based on the YAML interface description.

Upload to PMP

The binary is uploaded to one or more motion platforms using the PMP Template mechanisms. Based on a single uploaded binary multiple template instantiations, i.e. Processing blocks, can be created. Using this mechanism allows for example to use the same processing block for multiple axes without having to upload the same binary multiple times.