Why do I get an error saying that the AUTOSAR element does not have properties 'Runnables' when trying to programmatically add a runnable?

5 visualizaciones (últimos 30 días)
I am trying to programmatically add a runnable. I am executing the following commands:
% Define and open the model
hModel = 'ExampleName';
open_system(hModel);
% Create a default autosar api
autosar.api.create(hModel,'default');
% Get the AUTOSAR properties
arProps = autosar.api.getAUTOSARProperties(hModel);
% Add a runnable
add(arProps,hModel,'Runnables','Runnable4');
I get the following error message:
"The AUTOSAR element 'ExampleName', does not have properties 'Runnables'. Valid properties are 'Behavior', 'ReceiverPorts', 'SenderPorts', 'SenderReceiverPorts', 'ModeReceiverPorts', 'ModeSenderPorts', 'ClientPorts', 'ServerPorts', 'NvReceiverPorts', 'NvSenderPorts', 'NvSenderReceiverPorts', 'ParameterReceiverPorts', 'TriggerReceiverPorts', 'appliedStereotypeInstance'."
Why do I get this error?

Respuesta aceptada

MathWorks Support Team
MathWorks Support Team el 19 de Jun. de 2019
The runnables should be part of the behavior node. Your path to the parent AUTOSAR element (the second argument to the "add" function) should include '/Behavior'. The resulting code would be as follows:
% Define and open the model
hModel = 'ExampleName';
open_system(hModel);
% Create a default autosar api
autosar.api.create(hModel,'default');
% Get the AUTOSAR properties
arProps = autosar.api.getAUTOSARProperties(hModel);
% Add a runnable
add(arProps,[hModel '/Behavior/'],'Runnables','Runnable4');

Más respuestas (0)

Categorías

Más información sobre AUTOSAR Blockset en Help Center y File Exchange.

Etiquetas

Aún no se han introducido etiquetas.

Productos


Versión

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by