Real-Time Workshop    

Restrictions

Limitations on Use of Goto and From Blocks

When using the S-function target, Real-Time Workshop 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, you should 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.

As an example of this restriction, consider the model shown in Figure 10-5 and its subsystem, Subsystem1, shown in Figure 10-6. The Goto block in Subsystem1, which has global visibility, passes its input to the From block in the root model.

Figure 10-5: Root Model With From Block

Figure 10-6: Subsystem1 With Goto Block

If SubSystem1 is built as an S-Function using the S-Function target, and plugged into the original model (as shown in Figure 10-7), a warning is issued when the model is run, because the generated S-function does not implement the Goto block.

Figure 10-7: Generated S-Function Replaces Subsystem1

A workaround is shown in Figure 10-8. A conventional Outport is used in Subsystem1.When the generated S-function is plugged into the root model, its output is connected to the To Workspace block.

Figure 10-8: Use of Outport in Generated S-Function

Other Restrictions


  Automated S-Function Generation Unsupported Blocks