Mtalab 2022b进行Aut​osar建模时,Co​deMapping环​节报错:自定义的全局​变量定义Storag​eClass 冲突

26 Ansichten (letzte 30 Tage)
Lei
Lei am 27 Mär. 2025
Beantwortet: Lei am 30 Apr. 2025
报错如图显示,外部定义的StorageClass与模型中定义的StorageClass冲突,其中,Runnable设置SwAddresMethord为None;
自定义的StorageClass如下:
1、模型配置参数设置:SwAddresMethord,已添加了 CODE、MeasSig:
cs.set_param('MemSecFuncSharedUtil', 'CODE'); % Memory section for shared utility functions
cs.set_param('MemSecFuncInitTerm', 'CODE'); % Memory section for initialize/terminate functions
cs.set_param('MemSecFuncExecute', 'CODE'); % Memory section for execution functions
cs.set_param('MemSecDataParameters', 'Default'); % Memory section for parameters
cs.set_param('MemSecDataInternal', 'CODE'); % Memory section for internal data
cs.set_param('MemSecDataIO', 'Default'); % Memory section for inputs/outputs
cs.set_param('MemSecDataConstants', 'Default'); % Memory section for constants %
2、在csc_registration.m中定义MeasSig:
h = Simulink.CSCDefn;
set(h, 'Name', 'MeasSig');
set(h, 'OwnerPackage', 'AUTOSAR4');
set(h, 'CSCType', 'Unstructured');
set(h, 'MemorySection', 'Default');
set(h, 'IsMemorySectionInstanceSpecific', true);
set(h, 'IsGrouped', false);
set(h.DataUsage, 'IsParameter', false);
set(h.DataUsage, 'IsSignal', true);
set(h, 'DataScope', 'Exported');
set(h, 'IsDataScopeInstanceSpecific', false);
set(h, 'IsAutosarPerInstanceMemory', true);
set(h, 'IsAutosarPostBuild', false);
set(h, 'SupportSILPIL', false);
set(h, 'DataInit', 'None');
set(h, 'IsDataInitInstanceSpecific', false);
set(h, 'DataAccess', 'Direct');
set(h, 'IsDataAccessInstanceSpecific', false);
set(h, 'HeaderFile', '');
set(h, 'IsHeaderFileInstanceSpecific', true);
set(h, 'DefinitionFile', '');
set(h, 'IsDefinitionFileInstanceSpecific', true);
set(h, 'Owner', '');
set(h, 'IsOwnerInstanceSpecific', true);
set(h, 'PreserveDimensions', false);
set(h, 'PreserveDimensionsInstanceSpecific', false);
set(h, 'IsReusable', false);
set(h, 'IsReusableInstanceSpecific', false);
set(h, 'CommentSource', 'Default');
set(h, 'TypeComment', '');
set(h, 'DeclareComment', '');
set(h, 'DefineComment', '');
set(h, 'CSCTypeAttributesClassName', '');
set(h, 'CSCTypeAttributes', []);
set(h, 'TLCFileName', 'Unstructured.tlc');
defs = [defs; h];

Akzeptierte Antwort

Lei
Lei am 30 Apr. 2025
I resolved this problem via reading all Signals inthe model and mapping to auto
mapSignal(slMap,outportHandle(ii),'Auto')
mapDataStore(slMap,DataStoreInUse{i,2},'Auto');

Weitere Antworten (0)

Kategorien

Mehr zu Startup and Shutdown finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by