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 when the top-controller state is “Run”. The different execution types are described in Execution type. For asynchronous processing blocks the Execution period needs to be specified.
Memory and execution time diagnostics are described in Diagnostics.
Usage¶
Usage pattern of the processing block is as follows:
Create the processing block based on a Template using the CreateProcessingBlock() method on the Controller or AxisControl interface.
Connect a signal to inputs of the processing block and the output signals to inputs of other blocks.
Configure the parameters.
If the processing block contains one or more updatables with bulk data, upload the data.
These steps can also be done using an XML configuration file as described in Initialization using XML.
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.
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 the inputs of the processing block use data of the previous controller cycle.
See also
- ProcessingBlock
XML configuration example of the processing block interface.