You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Despite the code generated with Simulink Coder supports tunable parameters, the ones coming from the block masks are not accessible. Refer to the Operation selected from the drop-down menu of the SignalMath block of the example:
In line 105 it is hardcoded, and cannot be changed.
Instead, for what concern parameters that come from the workspace (and constants present in the Simulink Model are analogous), they are stored in a static struct:
Despite they can be changed during runtime (the symbol is static), it's basically impossible to know what is the index of the parameter you want to access. In this case there's only one, but if there were more, the cpp will contain a curly braces initialization for all of them. It would be great having a way to access these parameters e.g. by name (and I mean string, not name of the variable like P_AutogenerationExample_T_.Constant_Value in this case), but the approach used by the coder does not allow it.
Despite the code generated with Simulink Coder supports tunable parameters, the ones coming from the block masks are not accessible. Refer to the
Operation
selected from the drop-down menu of theSignalMath
block of the example:blockfactory/example/matlab/AutogenerationExample_grt_rtw/AutogenerationExample.cpp
Lines 104 to 107 in a05e6d0
In line 105 it is hardcoded, and cannot be changed.
Instead, for what concern parameters that come from the workspace (and constants present in the Simulink Model are analogous), they are stored in a static struct:
blockfactory/example/matlab/AutogenerationExample_grt_rtw/AutogenerationExample.h
Lines 75 to 80 in a05e6d0
blockfactory/example/matlab/AutogenerationExample_grt_rtw/AutogenerationExample.cpp
Lines 390 to 400 in a05e6d0
Despite they can be changed during runtime (the symbol is static), it's basically impossible to know what is the index of the parameter you want to access. In this case there's only one, but if there were more, the cpp will contain a curly braces initialization for all of them. It would be great having a way to access these parameters e.g. by name (and I mean string, not name of the variable like
P_AutogenerationExample_T_.Constant_Value
in this case), but the approach used by the coder does not allow it.cc @traversaro
The text was updated successfully, but these errors were encountered: