| Writing S-Functions | ![]() |
Runtime Object
When Simulink invokes a Level-2 M-file S-function callback method, it passes an instance of Simulink.MSFcnRunTimeBlock class to the method as an argument. This instance, known as the S-function block's runtime object, serves the same purpose for Level-2 M-file S-function callback methods as the SimStruct structure serves for C MEX-file S-function callback methods. It enables the method to provide and obtain information about various elements of the block: ports , parameters, states, and work vectors. The method does this by getting or setting properties or invoking methods of the block runtime object. See the documentation for Simulink.MSFcnRunTimeBlock class for information on getting and setting the runtime object's properties and invoking its methods.
| Note Other M-file programs besides M-file S-functions can use runtime objects to obtain information about an M-file S-function or other blocks in a model that is simulating. See Accessing Block Data During Simulation for more information. |
| Main Method | Maintaining Level-1 M-File S-Functions | ![]() |
© 1994-2005 The MathWorks, Inc.