Get list of the names of the variables in Simulink AUTOSAR code mapping editor

조회 수: 4 (최근 30일)
Jingzhe Wu
Jingzhe Wu 2021년 11월 24일
편집: Simran 2025년 2월 14일
Hi I'm trying to generate a list of the names for the "functions", "inports", "outports", "parameters" etc in the AUTOSAR code mapping editor, not sure what api command I could use. I am using Matlab 2021b.

답변 (1개)

Simran
Simran 2025년 2월 14일
편집: Simran 2025년 2월 14일
I see you want to generate a list of names for "functions", "inports", "outports", "parameters", etc., in the AUTOSAR code mapping editor using the MATLAB 2021b.
You can follow these steps to do so:
1.) Firstly, you need to get the AUTOSAR code mapping object from the model. Use the below function to access its properties:
model = 'your_model_name'; % Replace with your model name
open_system(model);
arProps = autosar.api.getAUTOSARProperties(model);
2.) Next, use the “find” method to get the list of functions, inports, outports and parameters:
functions = find(arProps, 'Functions');
inports = find(arProps, 'Inports');
outports = find(arProps, 'Outports');
parameters = find(arProps, 'Parameters');
3.) Lastly to verify that the commands are correct, and you’ve retrieved the desired information, you can display your lists by running the following script:
disp('Functions:');
disp(functions);
disp('Inports:');
disp(inports);
disp('Outports:');
disp(outports);
disp('Parameters:');
disp(parameters);
Then you can go to the “Apps” tab in “Simulink” and open “AUTOSAR Component Designer”. You can then click on "Code Interface" to view your code mapping.
You can refer the following documentation links for more details:
On AUTOSAR blockset -
On AUTOSAR api -

카테고리

Help CenterFile Exchange에서 AUTOSAR Blockset에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by