Products & Services Solutions Academia Support User Community Company

Learn more about Simulink   

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

Required

No

C Syntax

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

C Arguments

S

SimStruct representing an S-Function block.

simStatus

Status of the simulation, either SIM_PAUSE or SIM_CONTINUE.

M Syntax

SimStatusChange(s, status)

M Arguments

s

Instance of Simulink.MSFcnRunTimeBlock class representing the Level-2 M-File S-Function block.

status

Status of the simulation, either 0 when paused or 1 when continued.

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.

C 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 

Languages

C, C++

  


Related Products & Applications

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

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