I am generating an S-function block from a subsystem by right-clicking on the subsystem block and selecting "C/C++ Code > Generate S-Function…". I notice that the generated S-function code has the sample times hardcoded in it. So when I try to use this new block in different models, they fail to run. I would like to know how I can make S-function block independent of the sample time.
MATLAB: How to create a sample time independent S-function block from a subsystem in Simulink Coder 8.4 (R2013a)
hard-codesimulink coder
Related Question
- How to get the inherited sample time of a signal in Simulink R2014b
- Am I unable to build an S-function with inherited sample time from a subsystem in Real-Time Workshop 6.1 (R14SP1)
- Do I receive an error when using an S-function generated with a explicitly-defined discrete sample time using the Real-Time Workshop S-Function Target from a subsystem that has both continuous-time and discrete-time blocks
- Does the generated S-function have incorrect sample times when generated from a subsystem using the Real-Time Workshop
- Configure clock in simulink to inherit the sample time
- How to generate Simulink Profiler Report with execution times of subsystems in the model
- Do I get an error about runtime methods when running the model with a MATLAB System block
Best Answer