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

7 次查看(过去 30 天)
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"

回答(1 个)

Kautuk Raj
Kautuk Raj 2024-8-20
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.

类别

Help CenterFile Exchange 中查找有关 Manage Design Data 的更多信息

产品


版本

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by