Get list of the names of the variables in Simulink AUTOSAR code mapping editor
3 views (last 30 days)
Show older comments
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.
0 Comments
Answers (1)
Simran
on 14 Feb 2025
Edited: Simran
on 14 Feb 2025
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 -
0 Comments
See Also
Categories
Find more on AUTOSAR Blockset in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!