Pasing model reference parameters as structures in 2012b

조회 수: 13 (최근 30일)
Petri
Petri 2012년 10월 10일
My model contains referenced models that recieve model parameters as a Simulink.Parameter. The value of the parameter is a structure. The parameter and its bus are defined as follows.
MyParam =
Simulink.Parameter handle
Package: Simulink
Properties:
Value: [1x1 struct]
CoderInfo: [1x1 Simulink.CoderInfo]
Description: ''
DataType: 'Bus: SCM_Param_t'
Min: []
Max: []
DocUnits: ''
Complexity: 'real'
Dimensions: [1 1]
SCM_Param_t =
Simulink.Bus
Description: ''
DataScope: 'Exported'
HeaderFile: 'model_params.h'
Alignment: -1
Elements: [19x1 Simulink.BusElement]
I merrily generate code for xPCTarget using 2012a but with 2012b I get the following error.
Simulink is mapping bus type 'SCM_Param_t' to structure type 'struct_1BXbhALTEAwesxK6uDm6E' (defined for a parameter structure). As a result, the bus type cannot be exported. Change the DataScope of the bus object from 'Exported' to 'Auto'.
Changing to 'Auto' does not help because it then expects the typedefs to be imported. The referenced models all compile but and the model_params.h is generated but the top-level model always fails.
Any ideas?
Petri
  댓글 수: 3
Kaustubha Govind
Kaustubha Govind 2012년 10월 24일
I wonder if what you need is some equivalent of the "Output as nonvirtual bus in parent model" setting that Outport blocks have, but for a parameter. I don't have much experience with buses and referenced models, but I'm wondering if the issue is that the structure type is only registered with the referenced model, and not with parent model. If you don't see a reply on this forum, contacting MathWorks Tech Support may be the best available option.
Dave Everett
Dave Everett 2013년 1월 31일
I have the same problem. Any insight you could provide would be appreciated. If I find anything I'll share my findings.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Event Functions에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by