Processing block

This chapter describes the ProcessingBlock interface.

A processing block consumes data from its inputs, processes it, and produces output on its signals. The number of inputs, signals, updatables, and its behavior is determined by the Template which is used to create the processing block.

A processing block is executed inside the isochronous sample loop when the top-controller state is “Run”.

Memory and execution time diagnostics are described in Diagnostics.

Usage

Usage pattern of the processing block is as follows:

  1. Create the processing block based on a Template using the CreateProcessingBlock() method on the Controller or AxisControl interface.

  2. Connect a signal to inputs of the processing block and the output signals to inputs of other blocks.

  3. Configure the parameters.

  4. If the processing block contains one or more updatables with bulk data, upload the data.

  5. Set the top-controller state to “Run”.

A processing block is destroyed by calling Dispose (for C#) or Destroy (for C++). Built-in processing blocks cannot be destroyed.

Execution

The sequence of reading the inputs, calculating the new outputs, and writing these outputs is completed within one sample. Overview of the processing of two input samples shows the steps that are executed during every sample in a processing block.

Overview of the processing of two input samples

Overview of the processing of two input samples

The period is always equal to the SamplePeriod of the parent. Therefore, the SamplePeriod of the parent is returned and setting the period is ignored.

Calculation start

By applying one or more processing blocks, an algebraic loop can be introduced. When connecting processing blocks to other components via input connections, it is possible that the input of a processing block becomes dependent on (one of) its outputs. This is called an algebraic loop, and this makes it impossible to determine which block should be calculated first. Algebraic loops occur for example in a feedback connection between a feedback controller and a simulated plant. An algebraic loop can be broken by setting the CalculationStart property of a processing block. This forces the processing block to the start of the calculation order. This means the inputs of the processing block use data of the previous controller cycle.

See also

ProcessingBlock

XML configuration example of the processing block interface.