Why does my generated code have additional parameters when I am using Multi-Instance Capable Code in Stateflow Coder 5.0 (R13) or later?

When I generate code from a Stateflow chart, some functions contain errors. The resulting code is not the same as it was in Stateflow Coder 4.1 (R12.1). The number of parameters passed to a function is not the same as when it has been declared.
For example, assume a function is declared with 3 parameters. When I call it, the code passes 5 parameters. The last two parameters are a repetition of the previous two.
Assume the declaration is:
void accessory_socket_f(SFaccessory_socket_fInstanceStruct *chartInstance,
SFaccessory_socket_fInputDataStruct
*chartInputData,SFaccessory_socket_fOutputDataStruct *chartOutputData)
With Stateflow Coder 4.1 (R12.1), the following code is produced:
accessory_socket_f(chartInstance, chartInputData, chartOutputData);
With Stateflow Coder 5.0 (R13), the following code is produced:
accessory_socket_f(chartInstance,chartInputData, chartOutputData,
chartInputData, chartOutputData);
This causes compilation errors.

 采纳的回答

This bug has been fixed for Release 14 (R14). For previous releases, please read below for any possible workarounds:
This has been verified as a bug in Stateflow Coder 5.0 (R13) and later in the way that the coder handles Multi-Instance Capable Code.
There are currently no known workarounds.

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Stateflow 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by