Main Content

addBSWService

Add Basic Software component to AUTOSAR architecture model

Description

example

bswBlock = addBSWService(archCM,bswKind) adds a Basic Software (BSW) service component block of type bswKind to composition or architecture model archCM. Valid values for bswKind are 'dem' for Diagnostic Event Manager and 'nvm' for NVRAM Manager (not case-sensitive). The archCM argument is a composition or architecture model handle returned by a previous call to addComposition, autosar.arch.createModel, or autosar.arch.loadModel. The bswBlock output argument returns a block handle.

Examples

collapse all

Add NVRAM Service Component and Diagnostic Service Component blocks to the top level of an AUTOSAR architecture model.

% Create AUTOSAR architecture model
modelName = 'myArchModel';
archModel = autosar.arch.createModel(modelName);

% Add components inside the architecture model
addComponent(archModel,'Controller1');
actuator = addComponent(archModel,'Actuator');
set(actuator,'Kind','SensorActuator');

% Add Basic Software service component blocks
addBSWService(archModel,'nvm');
addBSWService(archModel,'dem');
layout(archModel);  % Auto-arrange layout

Input Arguments

collapse all

AUTOSAR composition or architecture model to which to add a BSW component. The argument is a composition or architecture model handle returned by a previous call to addComposition, autosar.arch.createModel, or autosar.arch.loadModel.

Example: archModel

Type of AUTOSAR BSW service component block to add to the specified composition or architecture model. Valid values are 'dem' for Diagnostic Event Manager and 'nvm' for NVRAM Manager (not case-sensitive).

Example: 'dem'

Output Arguments

collapse all

Returns an AUTOSAR BSW block handle.

Introduced in R2020a