| Writing S-Functions | ![]() |
Enable a function-call subsystem connected to this S-function.
Syntax
Arguments
S
SimStruct representing an S-Function block.
element
Index of the output port element corresponding to the function-call subsystem.
Description
Use in mdlOutputs to enable a function-call subsystem connected to the S-function. The invoking syntax is
if (!ssEnableSystemWithTid(S, element, tid)) { /* Error occurred which will be reported by Simulink */ return; }
| Note Before invoking this function, the S-function must have specified that it explicitly enables and disables the function-call subsystems that it calls. See ssSetExplicitFCSSCtrl for more information. If the S-function has not done this, invoking ssEnableSystemWithTid results in an error. |
The effect of invoking this function depends on the setting of the States when enabling parameter of the function-call subsystem's Trigger block. If the parameter is set to reset, this function invokes the function-call subsystem's initialize method and then its enable method. The subsystem's initialize and enable methods in turn invoke the initialize and enable methods of any blocks in the subsystem that have these methods. Initialize methods reset the states of blocks that have states, e.g., Integrator blocks, to their initial values. Thus, if the Trigger block's States when enabling option is set to reset, invoking this function effectively resets the states of the function-call subsystem. If the Trigger block's States when enabling option is set to held, this function simply invokes the subsystem's enable method, without invoking its initialize method and hence without resetting its states.
Languages
See Also
ssCallSystemWithTid, ssDisableSystemWithTid, ssSetExplicitFCSSCtrl
| ssDisableSystemWithTid | ssGetAbsTol | ![]() |
© 1994-2005 The MathWorks, Inc.