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

4 vues (au cours des 30 derniers jours)
Lei
Lei le 27 Mar 2025
Réponse apportée : Lei le 30 Avr 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];

Réponse acceptée

Lei
Lei le 30 Avr 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');

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by