Pasing model reference parameters as structures in 2012b
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Kaustubha Govind
el 24 de Oct. de 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
el 31 de En. de 2013
I have the same problem. Any insight you could provide would be appreciated. If I find anything I'll share my findings.
Respuestas (0)
Ver también
Categorías
Más información sobre Event Functions en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!