S-Function Target Limitations

Run-Time Parameters and S-Function Compatibility Diagnostics

If you set the S-function upgrades needed option on the Diagnostics > Compatibility pane of the Configuration Parameters dialog box to warning or error, the Real-Time Workshop® software reports that an upgrade is needed for any S-function you create with the Generate S-function feature. This is because the S-function target does not register run-time parameters. Run-time parameters are only supported for inlined S-Functions and the generated S-Function supports features that prevent it from being inlined (for example, it can call or contain other noninlined S-functions).

You can work around this limitation by setting the S-function upgrades needed option to none. Alternatively, if you have a Real-Time Workshop® Embedded Coder™ license, select the Use Embedded Coder option on the Generate S-function for Subsystem dialog box and generate an ERT S-function. In this case, you do not receive the upgrade messages. However, you cannot include ERT S-functions inside other generated S-functions recursively.

Goto and From Block Limitations

When using the S-function target, the Real-Time Workshop code generator restricts I/O to correspond to the root model's Inport and Outport blocks (or the Inport and Outport blocks of the Subsystem block from which the S-function target was generated). No code is generated for Goto or From blocks.

To work around this restriction, create your model and subsystem with the required Inport and Outport blocks, instead of using Goto and From blocks to pass data between the root model and subsystem. In the model that incorporates the generated S-function, you would then add needed Goto and From blocks.

Example Before Work Around

Example After Work Around

An Outport block replaces the GoTo block in Subsystem1. When you plug the generated S-function into the root model, its output connects directly to the To Workspace block.

Building and Updating Limitations

The following limitations apply to building and regenerating S-function targets:

Unsupported Blocks

The S-function format does not support the following built-in blocks:

  


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