Hi,
You may refer to this link for more information about the "model_step" function - https://www.mathworks.com/help/rtw/ref/model_step.html.
By default, the generated "model_step" function provides a void-void interface that does not have arguments. To configure the input arguments for a C step function, use the Code Mappings Editor - C: https://www.mathworks.com/help/rtw/ref/codemappingseditorc.html.
To include parameters in the "model_step" function, you can follow this procedure-
- From the Apps tab in the toolstrip, open Embedded coder
- In the Embedded Coder toolstrip, click on Code Interface > Default Code Mappings
- In the Code Mappings - Component Interface that opens up, click on the Functions tab.
- As you will be able to see, the "model_step" function will not be visible, as it has not been generated, yet. So go ahead and click on Build in the Embedded Coder toolstrip.
- Now, in the Functions tab of the Component Interface, you will be able to see the definition of "model_step" under the Function Preview column. Double click on the definition.
- A dialog box should open up, in which you can configure the generated C function interface. Check the "Configure arguments for Step function prototype" checkbox.
- This enables a "Get default" button. Click on it.
- Now, the function definition has been modified to include the inputs and outputs as function parameters. Click on "Validate" to verify that no issues arise.
- Generate code again, to obtain the modified C function.
Hope this helps!
