Simulation Information

Handle unexpected events in S-Function blocks

S-Function Callback Methods

mdlGetSimState Return the C MEX S-function simulation state as a valid MATLAB data structure, such as a matrix structure or a cell array.
mdlSetSimState Set the simulation state of the C MEX S-function by restoring the SimState.

SimStruct Functions

ssSetStateAbsTol Set the absolute tolerance used by a variable-step solver for a specific S-function continuous state.
ssSetBlockReduction Request that the Simulink engine attempt to reduce a block
ssSetSimStateCompliance Specify the behavior of a Simulink S-function when saving and restoring the SimState of a model containing the S-function.
ssSetSimStateVisibility Specify whether to make the S-function's simulation state visible in the simulation state of the model.
ssSetSolverNeedsReset Ask the Simulink engine to reset the solver
ssSetStopRequested Set the simulation stop requested flag
ssGetBlockReduction Determine whether a block has requested block reduction before the simulation has begun and whether it has actually been reduced after the simulation loop has begun
ssGetErrorStatus Get a string that identifies the last error
ssGetFixedStepSize Get the fixed step size of the model containing the S-function.
ssGetInlineParameters Determine whether the user has set the inline parameters option for the model containing this S-function
ssGetSimMode Get the simulation mode of an S-Function block
ssGetSimStatus Get the current simulation status of an S-Function block
ssGetSolverMode Get the solver mode being used to solve the S-function
ssGetSolverName Get the name of the solver being used to solve the S-function
ssGetStateAbsTol Get the absolute tolerance used by the variable-step solver for a specified state
ssGetStopRequested Get the value of the simulation stop requested flag
ssGetT Get the current simulation time
ssGetTaskTime Get the current time for the current task
ssGetTFinal Get the simulation stop time
ssGetTNext Get the time of the next sample hit
ssGetTStart Get the simulation start time
ssIsExternalSim Determine if the model is running in external mode.
ssIsFirstInitCond Determine whether the simulation time is equal to the start time.
ssIsMajorTimeStep Determine whether the simulation is in a major step
ssIsMinorTimeStep Determine whether the simulation is in a minor step
ssIsVariableStepSolver Determine if a variable-step solver is being used to solve the S-function
ssRTWGenIsAccelerator Determine if the model is running in Accelerator mode.
ssIsRapidAcceleratorActive Determine whether the model is running in Rapid Accelerator mode
Was this topic helpful?