Why Simulink Code Inspector does not verify an atomic "Subsystem" block with its "Function packaging" set to "Nonreusable function"?

4 views (last 30 days)
I am using Simulink Embedded Coder to generate code for embedded systems. In order to verify the code, I need a successful generated report from the Code Inspector.
When I try to run the "CompatibilityChecker" the following warning occurs:
Check Subsystem blocks
Identify Subsystem blocks that might impact compatibility with Simulink Code Inspector
The following subsystems are not supported:
Recommended Action
Restructure the model so that the subsystems listed in the results set 'Function packaging (RTWSystemCode)' to 'Inline' , 'Nonreusable function' or 'Reusable function'.
If 'Nonreusable function' is selected, the subsystem must use the following configuration:
'Function name options (RTWFcnNameOpts)' is set to 'User specified'
'Function interface (FunctionInterfaceSpec)' is set to 'void_void'
'Function with separate data (FunctionWithSeparateData)' is set to 'off'.
For non-inlined subsystems, the model must set 'Code interface packaging (CodeInterfacePackaging)' to 'Nonreusable function'. If 'Reusable function' is selected, the model must set 'Pass reusable subsystem outputs as' to 'Individual arguments'.
After having followed the recommended actions the issue persists.
Is there a workaround to overcome this issue?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 30 Nov 2022
When the "Function packaging" of an atomic "Subsystem" block is set to "Nonreusable function", the model's code interface packaging needs to be configured to "Nonreusable function" as well. This change will make the model and code compatible with Simulink Code Inspector. You can do this by following the instructions below:
  1. Navigate to Configuration Parameters (Ctrl+E) > Code Generation > Interface > Code interface Packaging
  2. Select "Nonreusable function"

More Answers (0)


Find more on Schedule Model Components in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by