Main Content

Force polling mode

Enables polling mode — instead of interrupt-driven mode — for clocking the real-time application

Since R2020b

Model Configuration Pane: Code Generation / Simulink Real-Time Options

Description

Enables polling mode — instead of interrupt-driven mode — for clocking the real-time application. Polling mode can be useful for reducing sample time jitter. But, enabling this option causes the real-time application to consume a CPU core completely to clock and execute the base rate.

Dependencies

The SLRTForcePollingMode configuration parameter sets the initial value for the pollingThreshold option when you build the real-time application. Enabling SLRTForcePollingMode sets the pollingThreshold to a value above the base sample rate. This setting forces clocking the real-time application in polling mode.

Option: pollingThreshold

Settings

off | on

Default: off

off

When Force polling mode is disabled, the real-time application is clocked by a timer interrupt, unless the base sample rate is equal to or below the polling threshold (100 μs). If the base sample rate is less than or equal to the threshold, the real-time application is clocked in polling mode.

on

When Force polling mode is enabled, the real-time application is always clocked in polling mode.

Recommended Settings

ApplicationSetting

Debugging

off

Traceability

off

Efficiency

off

Safety precaution

off

Programmatic Use

Parameter: SLRTForcePollingMode
Type: character vector
Value: 'off' | 'on'
Default: 'off'

Version History

Introduced in R2020b