User`s guide
The C MEX S-Function SimStruct
3-101
Table 3-6: Error Handling and Status SimStruct Macros
Macros Description
ssSetErrorStatus
(S,"string")
For improved performance and error handling, your S-function
should report errors using:
ssSetErrorStatus(S, "error message");
return;
Be careful when using ssSetErrorStatus in your S-function. Error
string must be persistent memory; it cannot be a local variable.
ssGetSimMode(S)
This macro can be used to determine the context in which your
S-function is executing. Current simulat ion modes are:
•
SS_SIMMODE_NORMAL — Running a “normal” Simuli nk simula tion
•
SS_SIMMODE_SIZES_CALL_ONLY — Block edit (evaluation) to
obtain number of ports
•
SS_SIMMODE_RTWGEN — Generating code
•
SS_SIMMODE_EXTERNAL — External mode simulation
ssGetSolverName(S)
This returns a char * name of the solver.
ssIsVariableStepSolver
(S)
Returns 1 if the solver being used is a variable step solver. This is
useful when creating S-functions that have zero crossings and an
inherited sample time.