Diagnostics

Memory usage and execution time of a processing block can be monitored. The related settings, signals and events are stated in this section.

Memory usage

The memory usage of a processing block can be monitored via the Memory usage signal.

Signals

Memory usage signal

Name

Data type

R/W

Unit

Description

MemoryAllocation

Uint32

R

bytes

Current memory usage of this processing block instantiation in bytes. This metric does not include the memory needed for the Template.

Timing measurements

The Execution budget property can be specified when creating a processing block. If the controller has support for timing measurements, the Timing measurement signals are by default present in the processing block to monitor the execution time. The Timing measurement events indicate whether the budget or period is exceeded.

Execution budget

The execution budget is the maximum amount of time required by the processing block for each process step. This budget is specified when creating a processing block. The default value is set to infinite. Exceeding the budget does not necessarily have impact, and its main purpose is diagnostics.

For synchronous execution the budget should be substantially smaller than the sample period since much more processing has to be performed by the platform. Exceeding the budget does not have impact, as long as the sample period and I/O critical task budget are not exceeded.

For asynchronous execution, the execution budget is allowed to be larger than a sample. Only in case the execution period is exceeded the calculation of the new output values are not finished in time. The behavior in case the period is exceed is described in Execution period.

No execution budget is specified for built-in processing blocks. These processing blocks will return -1 when the budget is retrieved and throw NotSupportedException when set.

Signals

Timing measurement signals

Name

Data type

R/W

Unit

Description

ExecutionTime

Double

R

seconds

Time that the last execution of this processing block took in seconds.

RemainingBudget

Double

R

seconds

Amount of remaining time budget available for the execution of this processing block in seconds.

Events

Timing measurement events

Name

Description

BudgetExceeded

This event is triggered when the Execution budget of the processing block is exceeded. In simulation this event will never trigger.

PeriodExceeded

This event is triggered when the execution of the processing block does not finish before the next Execution period starts. It can be triggered simultaneously with the BudgetExceeded event of the same block due to a too long execution of this block. However, it can also be caused by other blocks delaying the start of this block such that there is not sufficient time for this processing block to execute. This event can only trigger for a processing block with asynchronous execution mode. In simulation it will never trigger.