Code Inspector warning, tunable objects
2 次查看(过去 30 天)
显示 更早的评论
I’ve tried reading the documentation online and I have to say it’s horrendous. I haven’t been able to get a straight answer online or from the people at my work. When I run Simulink Code Inspector on our model I get a few warnings, and one of them wants:
Modify all workspace variables referenced by the model to be not tunable
My question is how can you do this? Is there a way that you can disable the fields from being used once we set the initial values? We use Simulink.Parameter to set some constant values in the model. It looks like:
VARIABLE = Simulink.Parameter;
VARIABLE.Value = uint32(190);
VARIABLE.RTWInfo.StorageClass = 'Custom';
VARIABLE.RTWInfo.CustomStorageClass = 'Define';
Is there any way to makes something like this non-tunable?
0 个评论
采纳的回答
Ryan G
2012-8-30
The reason that warning appears is because you are using a custom storage class. Since it is a warning you don't actually need to fix it to run the code inspector, but it is letting you know that, depending on how it's defined, it may not work as intended.
Your options are
1) Go ahead and try code inspector regardless of the warning 2) Change the storage class
If you see anything that doesn't make sense later on in the process and it involves this parameter, you will be able to better figure out that this was the reason.
1 个评论
Ryan G
2012-8-30
I'm not really sure what determines it between the many different storage classes, however, if you look at this parameter in model explorer you will see all the options. I believe a custom storage class means that when you generate code the parameter will be provided in a header file outside of the normal model.h/model.c files. Therefore, it is unknown whether or not you will be tuning it. In contrast, Simulink will code a non-tunable parameter directly into the model.c/.h or _data.h file.
As I stated above, there is nothing necessarily wrong with doing this other than you may find code inspector does not work as intended. However, it may work just fine, it really depends on application.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Simulink Code Inspector 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!