Main Content

Configure Disabled Mode for AUTOSAR Runnable Event

In an AUTOSAR software component model, you can set the DisabledMode property of a runnable event to potentially prevent a runnable from running in certain modes.

Given a model containing a mode receiver port and defined mode values, you can programmatically get and set the DisabledMode property of a TimingEvent, DataReceivedEvent, ModeSwitchEvent, OperationInvokedEvent, DataReceiveErrorEvent, or ExternalTriggerOccurredEvent. The property is not supported for an InitEvent.

The value of the DisabledMode property is either '' (no disabled modes) or one or more mode values of the form 'mrPortName.modeName'. To set the DisabledMode property of a runnable event in your model, use the AUTOSAR property function set.

The following example sets the DisabledMode property for a timing event named Event_t_1tic_B. The set function call potentially disables the event for modes STARTUP and SHUTDOWN, which are defined on mode-receiver port myMRPort.

hModel = 'mAutosarMsConfigAfter';
open_system(hModel)
arProps = autosar.api.getAUTOSARProperties(hModel);
eventPaths = find(arProps,[],'TimingEvent')
eventPaths = 1x2 cell
    {'ASWC/Behavior/Event_t_1tic_B'}    {'ASWC/Behavior/Event_t_10tic'}

dsblModes = get(arProps,eventPaths{1},'DisabledMode')
dsblModes =

  1x0 empty cell array
set(arProps,eventPaths{1},'DisabledMode',{'myMRPort.STARTUP','myMRPort.SHUTDOWN'});
dsblModes = get(arProps,eventPaths{1},'DisabledMode')
dsblModes = 1x2 cell
    {'myMRPort.STARTUP'}    {'myMRPort.SHUTDOWN'}

When you export ARXML files for the model, the timing event description for Event_t_1tic_B includes a DISABLED-MODE-IREFS section that references the mode-receiver port, the mode declaration group, and each disabled mode.

The software preserves the DisabledMode property of a runnable event across round trips between an AUTOSAR authoring tool (AAT) and Simulink®.

Related Topics