Main Content

ssSetOutputPortOptimOpts

年代pecify reusability of the memory allocated to the output port of an S-function

年代yntax

void ssSetOutputPortOptimOpts(SimStruct *S, int_T port, uint_T val)

Arguments

年代

年代imStruct representing an S-Function block.

port

Index of an output port of年代

val

Reusability ofport。允许的值

  • 年代年代_NOT_REUSABLE_AND_GLOBAL(default value)

  • 年代年代_REUSABLE_AND_LOCAL

  • 年代年代_REUSABLE_AND_GLOBAL

  • 年代年代_NOT_REUSABLE_AND_LOCAL

Description

Use this macro to specify the reusability and scope of the memory allocated to an S-function output port. The reusability indicates whether or not the memory associated with the output port can be overwritten. You must specify that an output port is reusable if the output port connects to aMergeblock. The scope indicates whether the model variables are stored locally or globally.

You cannot usessGetOutputPortSignalorssGetOutputPortRealSignalanywhere except in themdlOutputsroutine if you have specified that the output ports are reusable.

The Simulink®product only uses the reusability setting during simulation. It disregards the memory scope setting, i.e., local or global, instead treating all S-function ports as global during simulation.

Note

The年代imulink Coder™product uses the memory scope setting you specified when generating code from a model. If your S-function accesses the outputs only inmdlOutputs,年代imulink Coderproduct attempts to declare local variables for any outputs with a local scope. If your S-function uses the outputs in a way that precludes using a local scope, the generated code uses global variables for the outputs. See年代-Functions for Multirate Multitasking Environments(Simulink Coder)for more information.

Languages

C, C++

Example

年代ee the S-functionsdotproduct.cused insfcndemo_sdotproductand the S-functionsfun_multirate.cused insfcndemo_sfun_multirate

Introduced before R2006a