Running external mode as a background thread with grt.tlc target

4 views (last 30 days)
Hi,
I was wondering whether it would be possible to activate the "run as a background thread" option for external mode with grt.tlc as target.
If this is not directly possible as a setting is there maybe a .tlc variable that can activate that option?
Thanks!

Accepted Answer

R
R on 12 Sep 2024
Edited: R on 12 Sep 2024
The capability to run external mode simulations as a background thread is typically controlled through Simulink's model configuration parameters, rather than directly via TLC (Target Language Compiler) scripts. For GRT-based targets, you configure external mode settings under the "Code Generation -> Interface" section within the Simulink model's configuration parameters. In contrast, for ERT-based targets, these settings are found under "Hardware Implementation."
The option to execute simulations as a background thread often depends on the specific hardware support package and the hardware board used. For instance, this feature is available for platforms like ZedBoard devices and Raspberry Pi. However, it might not be accessible for other platforms such as TI or Arduino microcontrollers, even when using ERT targets. Currently, there is no programmatic equivalent or TLC variable that directly enables running external mode in a background thread. This capability is primarily set through Simulink's graphical interface only.
TLC files are mainly focused on the code generation process for Simulink models and do not directly handle simulation settings or execution modes, such as running external mode simulations in a background thread. The extent of modifications possible in TLC files is limited to settings like the transport layer and basic MEX-file options, such as verbosity. Furthermore, as outlined in the following MathWorks documentation, Simulink Coder does not utilize tasking primitives. This means it lacks built-in features for task scheduling, priority management, or thread management, which are essential for managing background threads.
Hence, enabling the option to run external mode in background threads is not achievable through TLC scripts.

More Answers (0)

Categories

Find more on Deployment, Integration, and Supported Hardware in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!