Skip to Main Content Skip to Search
Product Documentation

ssSetModelReferenceNormalModeSupport - Specify if S-function can be used in referenced model simulating in normal mode

Syntax

void ssSetModelReferenceNormalModeSupport(SimStruct *S,
 ssModelReferenceNormalModeSupport mode)

Arguments

S

SimStruct representing an S-Function block.

mode

Flag for normal mode simulation support when the S-Function block is used in a referenced model. Options are DEFAULT_SUPPORT_FOR_NORMAL_MODE (0) or MDL_START_AND_MDL_PROCESS_PARAMS_OK (1).

Description

Use in mdlInitializeSizes to specify if an S-function with both an mdlStart and an mdlProcessParameters method can be used in a referenced model simulating in normal mode. Permissible values are:

The ssSetModelReferenceNormalModeSupport flag indicates to the engine if the code in mdlProcessParameters is independent of the code in mdlStart. This information is important because the engine modifies its normal mode simulation process for S-functions in a referenced model. If the S-function is not in a referenced model, the engine always executes the mdlStart method prior to the mdlProcessParameters method. However, during normal mode simulation of referenced models, the engine may decide to execute the S-function's mdlProcessParameters method prior to mdlStart. If the mdlProcessParameters method requires data initialized in mdlStart, the engine cannot successfully change the order of execution.

By default, the engine produces an error if it finds an S-function with both an mdlStart and an mdlProcessParameters method in a referenced model simulating in normal mode. The default behavior is equivalent to specifying the DEFAULT_SUPPORT_FOR_NORMAL_MODE option for ssSetModelReferenceNormalModeSupport. If the S-function does not depend on the execution order of these two methods, specify the MDL_START_AND_MDL_PROCESS_PARAMS_OK option to enable normal mode simulation.

Languages

C, C++

Example

See the S-function sfun_frmad.c used in sfcndemo_frame.mdl for an example that uses this function. Running this model requires a DSP System Toolbox license.

  


Related Products & Applications

Learn more about Simulink through this collection of videos, articles, technical literature and the Getting Started with Simulink Guide.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS