Base Sample Time config

Block to set the base sample time that should be used within that program.

Description

This block gives you the opportunity to adjust the base sample time of the program. The smallest supported base sample time is 0.1ms (10 kHz), however this can be made even smaller by reconfiguring the run-time library as explained below. The entered value depends on how many times per second the user want to base sample time through the complete model.

Remarks

Declaration

(No initialisation block needed)

Parameters
Sample time
Sample time of the block. The Sample time (in seconds) defines the rate at which the block is visited by the real-time scheduler of the target. The value of the Sample time has to be an integer multiple of the base sample time of the model.

Extra stack
It is possible to reserve extra stack space for the OS task that executes the model on the embedded target (AppCtrlTask). A Simulink model with more signals will result in more local variables in the generated code for the model's step function, using up more stack space. Note that the block "Get free Stack" can be used to monitor the stack usage.

Reconfiguring the run-time library

The default smallest supported sample time is determined by the tick time of the operating sytem. This can be re-configured through macro configTICK_RATE_HZ in the FreeRTOSConfig.h header-file of the target. Note that changing this macro requires a rebuild of the run-time library. This is achieved by deleting the run-time library file (*.a) of the target and starting the code generation process in Simulink.