| Real-Time Workshop® | ![]() |
S-Function Target
An instance of the RTW S-Function block represents code the Real-Time Workshop® software generates from its S-function target for a model or subsystem. For example, you extract a subsystem from a model and build an RTW S-Function block from it, using the S-function target. This mechanism can be useful for
Converting models and subsystems to application components
Reusing models and subsystems
Optimizing simulation — often, an S-function simulates more efficiently than the original model
Protecting intellectual property — you need only provide the binary MEX-file object to users
For details on how to create an RTW S-Function block from a subsystem, see Creating an S-Function Block from a Subsystem in the Real-Time Workshop documentation.
The S-Function block must perform identically to the model or subsystem from which it was generated.
Before creating the block, you must explicitly specify all Inport block signal attributes, such as signal widths or sample times. The sole exception to this rule concerns sample times, as described in Sample Time Propagation in Generated S-Functions in the Real-Time Workshop documentation.
You must set the solver parameters of the RTW S-function block to be the same as those of the original model or subsystem. This ensures that the generated S-function code will operate identically to the original subsystem (see Choice of Solver Type in the Real-Time Workshop documentation for an exception to this rule).
The name of the generated S-function. The Real-Time Workshop software derives the name by appending _sf to the name of the model or subsystem from which the block is generated.
If checked, displays modules generated for the S-function.
Creating an S-Function Block from a Subsystem in the Real-Time Workshop documentation
![]() | Protected RT | System Derivatives | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |