Mask Parameter Visibility Affects Code Generation
이전 댓글 표시
I have a masked subsystem with a parameter that is set by the initialization code in the mask to be equal to a Simulink.Parameter that is pre-defined in the base workspace as follows:
my_param = Simulink.Parameter;
my_param.Value = int32(0);
my_param.RTWInfo.StorageClass = 'ExportedGlobal';
my_param.DataType = 'int32';
When I generate code (using embedded coder) for my model, if the visibility is set on my mask parameter to 'on' such that it is visible in the Block Parameters dialog, the code generates properly and the parameter is an exported global variable in the resulting C code. If, on the other hand, I set the visibility to 'off', and the parameter is no longer visible in the Block Parameters dialog (recall that it's value is set by the initialization code in the mask so I don't need it visible in the block settings dialog), the generated code results in a variable that uses auto storage and is not exported regardless of the values in the RTWInfo in the Simulink.Parameter.
I have two questions based on the above observations:
1) Why does the visibility property determine how code is generated for a parameter?
2) Is there another way I can have a parameter that is not visible in the Block Settings dialog that will generate code with the proper storage class?
All work is being done in R2011B.
Thanks!
Jeff
댓글 수: 1
Kaustubha Govind
2011년 11월 4일
Jeff: I would recommend contacting Tech Support for this. I'm not sure if this is possible, but you can get a more authoritative answer and also put in an enhancement request at the same time (if there is no workaround).
답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Deployment, Integration, and Supported Hardware에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!