Main Content

Force polling mode

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

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.

Examples

expand all

  • To get the SLRTForcePollingMode option value for real-time application object my_app that is loaded on target computer, type in the MATLAB Command Window:

    my_app = slrealtime.Application('slrt_ex_osc')
    app_object.Options.get.SLRTForcePollingMode

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