Developing Control Applications

2 minute read

Developing Control Applications

MOTORCORTEX provides out of the box solution to develop Hard-Realtime Control Applications in C++ with an integrated high-speed and secured communication for distributed systems. It supports popular industrial buses, like EtherCAT.

The Parameter Tree

In a Motorcortex application all Modules and variables are organized in a tree structure; the Parameter Tree. The Parameter Tree is used to communicate data between tasks and to the outside world in a thread-safe manner. In the tree the modules are represented as subtrees (folder) and variables are represented as leafs.

The Parameter Tree contains a snapshot of all the registered inputs, outputs and internal data of the modules at the current time. Each Task or Module can create its own subtrees (folder) in the Parameter Tree. Modules can be nested and register their own parameters in the Tree.

The Parameter Tree always starts from the root node, which is passed to the modules and tasks that then can register their own parameters or create submodules that register their own data.

The Communication Server

The Communication Server provided by Motorcortex has two parts:

  1. the first part is a Signaling Server which uses a Request/Reply reliable messaging pattern.
  2. The second part is a Publishing Server or Publisher which uses a Publish/Subscribe best-effort delivery messagin pattern.

A Signaling Server is required for Remote Procedure Calls and for managing the control application, for example updating parameter values. It is also responsible for managing the Publishing Server.

The Publishing Server can organize data into groups and publish them with the requested frequency. The Publisher is used to send Real-time data continuously.

The Signaling Server is set up in the main(…) function and runs until a terminating signal is received.

Because the Publisher has a cyclic behavior, it is added to a Task that executes it with the given update rate. An example how the publisher is created is shown below:

Setting-up your Developement Environment

Setup Development Environment

Motorcortex Application Template

This section will explain you how to create a new poject and how the Motorcortex project template works.

Realtime Configuration


Motorcortex APIs

Last modified April 13, 2021: Update (192f2a6)