This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

mdlSimStatusChange

Respond to a pause or resumption of the simulation of the model that contains this C MEX S-function

Required

No

Languages

C, C++

Syntax

#define MDL_SIM_STATUS_CHANGE
void mdlSimStatusChange(SimStruct *S,
 ssSimStatusChangeType simStatus)

Arguments

S

SimStruct representing an S-Function block.

simStatus

Status of the simulation, either SIM_PAUSE or SIM_CONTINUE.

Description

The Simulink® engine calls this routine when a simulation of the model containing S pauses or resumes. This method is only valid for simulation. C MEX S-functions must enclose the method in a #if defined(MATLAB_MEX_FILE) statement.

Example

#if defined(MATLAB_MEX_FILE) 
#define MDL_SIM_STATUS_CHANGE
static void mdlSimStatusChange(SimStruct *S,
						 ssSimStatusChangeType simStatus) { 
  if (simStatus == SIM_PAUSE) { 
		   ssPrintf("Pause has been called! \n"); 
	  } else if (simStatus == SIM_CONTINUE) { 
		   ssPrintf("Continue has been called! \n"); 
	  } 
} 
#endif 

Introduced before R2006a