Pasing model reference parameters as structures in 2012b
11 views (last 30 days)
Show older comments
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 Comments
Kaustubha Govind
on 24 Oct 2012
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
on 31 Jan 2013
I have the same problem. Any insight you could provide would be appreciated. If I find anything I'll share my findings.
Answers (0)
See Also
Categories
Find more on Event Functions in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!