| Contents | Index |
void ssSetSimStateVisibility(S, visibility)
SimStruct representing an S-function block.
Option to specify the visibility of the S-function simulation state. The default is false; the simulation state is hidden.
This function allows you to specify whether or not the simulation state of the S-function is accessible from the simulation state of the model. When this option is set to true, you can access the SimState of this block via the getBlockSimState method of ModelSimState and you can restore any modified values via the setBlockSimState of the ModelSimState.
C, C++
The following example uses this function to specify whether the simulation state of an S-function should be visible in the simulation state of the model. The specification is based upon the second (boolean) parameter value.
static void mdlInitializeSizes(SimStruct* S)
{
ssSetNumSFcnParams(S, 2); /* two parameters */
if (ssGetNumSFcnParams(S) != ssGetSFcnParamsCount(S))
return;
ssSetSFcnParamTunable(S, 0, false);
ssSetSFcnParamTunable(S, 1, false);
{
boolean_T visibility = 0U;
ssSimStateCompliance setting =
GetSimSnapParameterSetting(S, &visibility);
if (ssGetErrorStatus(S)) return;
ssSetSimStateCompliance(S, setting);
ssSetSimStateVisibility(S, visibility);
}
See /toolbox/simulink/simdemos/simfeatures/src sfun_simstate.c for the full source code.

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 |