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

조회 수: 27 (최근 30일)
Lei
Lei 2025년 3월 27일
답변: Lei 2025년 4월 30일
报错如图显示,外部定义的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];

채택된 답변

Lei
Lei 2025년 4월 30일
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');

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by