How do I inline built-in Simulink blocks?

I am generating code from my model using Simulink PLC Coder. However, even after setting:
>> set_param('<modelName>','DefaultParameterBehavior','Inlined')
Certain built-in Simulink blocks appear as separate function blocks in the generated code with respect to the main code. How can I fully inline these blocks?

 Risposta accettata

MathWorks Support Team
MathWorks Support Team il 13 Apr 2026
Modificato: MathWorks Support Team circa 15 ore fa
The most likely cause of this is the "Data Type Conversion" block, which converts floating point values to integer values. If this could be the cause, implement the following workaround: 
  1. Open each "Data Type Conversion" block’s block parameters and set "Integer rounding mode" to "Simplest", as shown below:
  2. Generate code, which should then not contain this function.
Note that PLC Coder currently does not inline the generated code for internal library functions, as such functions may have several copies, and in-lining would cause code size bloat.

Più risposte (0)

Categorie

Scopri di più su Simulink PLC Coder in Centro assistenza e File Exchange

Prodotti

Release

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by