How to change the datascope of numeric/value data types created in AUTOSAR Interface Dictionary

9 views (last 30 days)
There is no option to set the scope of data type.
I want to use this data type in export function. But tool is throwing error that,
"The data scope of data type 'TqFT' must be set to 'Imported' or 'Exported'. This condition is required to be able to export the declaration of argument"

Answers (1)

Kautuk Raj
Kautuk Raj on 20 Aug 2024
I reckon that you wish to change the data scope of the numeric/value data type TqFT in the AUTOSAR Interface Dictionary to either Imported or Exported to ensure it can be used in an export function, as the current configuration is causing an error in MATLAB R2023a.
In MATLAB R2023a, a graphical user interface (GUI) has been introduced to facilitate this process. You can follow these steps:
  • Open the Model Explorer from your model.
  • In Model Explorer, navigate to sc_dictionary > Design Data > myStruct.
  • Click on Show in Interface Editor located at the bottom right corner.
  • The Interface Editor will open. On the right-hand side, locate the Code Generation section and click the arrow to expand it.
  • Modify the Data Scope setting to either Imported or Exported as needed.
For the benefit of others using MATLAB R2022b, I am sharing the workflow in this version as well. One can change the data scope to "Imported" or "Exported" using the Simulink API. Here is a sample:
dd = Simulink.data.dictionary.open('sl_dictionary.sldd');
designData = dd.getSection('Design Data');
s = designData.getEntry('myStruct');
v = s.getValue;
v.DataScope = 'Exported';
s.setValue(v);
I hope these streamlined processes would makes it easier to configure data types for code generation.

Categories

Find more on Manage Design Data in Help Center and File Exchange

Products


Release

R2023a

Community Treasure Hunt

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

Start Hunting!