| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Simulink |
| Contents | Index |
| Learn more about Simulink |
void ssSetInputPortOptimOpts(SimStruct *S, int_T port, uint_T val)
SimStruct representing an S-Function block.
Index of an input port of S.
Reusability of port. Permissible values are
SS_NOT_REUSABLE_AND_GLOBAL
SS_REUSABLE_AND_LOCAL
SS_REUSABLE_AND_GLOBAL
SS_NOT_REUSABLE_AND_LOCAL
Use this macro to specify the reusability and scope of the memory allocated to an S-function input port. The reusability indicates if the memory associated with the input port can be overwritten, or not. You must indicate an input port is reusable if you use the ssSetInputPortOverWritable macro to specify the input port's memory can be overwritten by one of the output ports.
The Simulink engine disregards the memory scope setting, instead treating all S-function ports as global during simulation.
Note The Real-Time Workshop product uses the memory scope setting you specified when generating code from a model. The Real-Time Workshop product attempts to declare local variables for any inputs with a local scope. If your S-function uses the inputs in a way that precludes using a local scope, the generated code uses global variables for the inputs. See Writing S-Functions for Multirate Multitasking Environments and Writing S-Functions That Specify Port Scope and Reusability in the Real-Time Workshop User's Guide for more information. |
C, C++
See the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/sfun_multirate.c used in sfcndemo_sfun_multirate.mdl and the S-function matlabroot/toolbox/simulink/simdemos/simfeatures/src/sdotproduct.c used in sfcndemo_sdotproduct.mdl.
ssGetInputPortOptimOpts, ssSetOutputPortOptimOpts, ssSetInputPortOverWritable
![]() | ssSetInputPortOffsetTime | ssSetInputPortOverWritable | ![]() |

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |