主要内容

Run external mode in a background

R2026b

Force background-thread execution of the external mode task in the generated code

Model Configuration Pane: Hardware Implementation / Hardware board settings / Target hardware resources / Groups / External mode

Description

Select Run external mode in a background thread to force background-thread execution of the external mode task in the generated code. When enabled, the external mode task executes in the time between the end of model code of one time step and the start of the next time step, rather than blocking model execution.

This prevents the external mode communication from delaying the real-time behavior of the model running on Raspberry Pi®.

Settings

Off (default) | On

Select whether to run the external mode task in a background thread.

Off (default)

Run the external mode task inline with model execution. External mode communication occurs during the base-rate step.

On

Run the external mode task in a background thread. Do not use this option for models with very small sample times or models that may experience overruns, as Simulink® may become unresponsive. When model execution consumes most of the available CPU time, the background thread may not receive sufficient execution time, resulting in dropped data packets and gaps in logged data.

Recommended Settings

No recommendation.

Programmatic Use

No programmatic use is available.

Version History

Introduced in R2017a