| SystemBuild to Simulink® Translator | ![]() |
| On this page… |
|---|
Improving Signal Line Wiring Results |
Converting SystemBuild™ models to Simulink® models enables you to simulate sections of the overall model. It also allows you to more easily run existing SystemBuild level tests and confirm the validity of the conversion. You can componentize your converted SystemBuild model using library link and model reference conversion capabilities. If you are creating multiple models during the conversion process, either through multiple conversion invocation or subsequent conversions of atomic subsystems into model references, having a single configuration set object (see Referencing Configuration Sets) with your desired configurations for all models can simplify conversions.
The benefits of componentization of your SystemBuild model include:
Ability to convert your SystemBuild model using library links and model reference
Converting components to be referenced models instead of library links permits simplified testing. Because a referenced model is simply a model that can be simulated, component tests can be brought to the MATLAB® or Simulink environment in a straightforward manner.
Visually cleaning up the resulting model and addressing any issues with unconverted blocks
Testing the converted models using existing SuperBlock level tests
The next step is to get the new model to simulate with the same results as the original model. This step might involve changing solver settings and zero-crossing controls for models with continuous states employing variable-step solvers.
SB2SL creates one top-level model per conversion. By default, it configures the converted model to work with the Simulink Model block to allow for the creation of a model reference component in another model or library.
If you do not want to use referenced models but do want to use design components, convert the top-level model into an atomic subsystem:
Open a new or existing library.
Drag an Atomic Subsystem block into that library.
In the Simulink model editor window of the top-level model, select Edit > Select all.
In the Simulink model editor window of the top-level model, select Edit > Copy.
In the new or existing library, double-click the Atomic Subsystem block.
The subsystem is displayed.
In the Simulink model editor of the Atomic Subsystem block, select Edit > Paste.
The contents of the top-level model are now in the Atomic Subsystem block.
Close the Atomic Subsystem block.
Save and close the top-level model and library.
If the SystemBuild model contains a SuperBlock that SB2SL cannot convert (for example, an external SuperBlock that is referenced by the SystemBuild model), you can still create a link to that unconverted block by doing one of the following:
Replace the empty subsystem that is in place for the unconverted block with a Simulink Model block to create a link:
Assuming that model A has an unconverted external SuperBlock, find the file that contains the unconverted SuperBlock (for example, file B).
Using SB2SL, translate the file that contains the unconverted SuperBlock (for example, file B) to a Simulink model.
Leave file B as its own model, model B.
Drag a Model block into model A to reference model B.
Copy a translated model into a Subsystem block in a library:
Assuming that model A has an unconverted external SuperBlock, find the file that contains the unconverted SuperBlock (for example, file B).
Using SB2SL, translate the file that contains the unconverted SuperBlock (for example, file B) to the Simulink model.
Open a new or existing library.
Drag an Atomic Subsystem block into this library.
Copy and paste the contents of model B into the new Atomic Subsystem block and save the library.
Drag a copy of the new Atomic Subsystem block into A.
When SB2SL converts a SystemBuild model into a corresponding Simulink model, it connects the blocks as best as it can. If you are dissatisfied with these results, you can improve the wiring results of the signal lines by:
Manually cleaning up the wiring using the tips in Wiring Cleanup Tips
Converting block and system interfaces to native Simulink modeling styles: vectorization, matrix signals, and buses using the guidelines in Migrating to a Native Simulink® Modeling Style
The following guidelines describe how you can visually clean a Simulink model that results from a SystemBuild model translation:
| Modeling Pattern | In the Simulink Model Editor... |
|---|---|
| Multiple lines in parallel going to multiple destinations can cause visually undesired wiring in your model. The use of Mux and Demux blocks can cause these issues. | Perform one or all of the following:
|
| Excessively autorouted lines can cause visually undesired wiring. | Perform one or all of the following:
|
The following example shows the appearance of the sbpend model when you turn off autorouted lines.

The following example shows the appearance of the sbpend model when you turn on autorouted lines.

Use the Format menu commands on the Simulink model editor for basic graphical cleanup of a model, such as block mass alignments and relative alignments.
After conversion, SB2SL might generate a model with unconnected blocks. By default, unconnected blocks cause warnings each time you update the model diagram. To avoid these warnings, use one of the following:
Before conversion, enable the addition of Terminator and Ground blocks in the SB2SL GUI (Build > Options, click Build tab, and select the Add Terminator and Ground blocks check box).
After conversion, use the addterms function to add terminators to the unconnected ports in the model.
If you do not want the unconnected lines to be terminated, and you do not want to display the warnings in your MATLAB Command Window, you can suppress these messages with the following:
Before conversion, disable the addition of Terminator and Ground blocks in the SB2SL GUI (Build > Options, click Build tab, and clear the Add Terminator and Ground blocks check box).
In the MATLAB Command Window, type the following:
warning('off','Simulink:SL_InputNotConnected')
warning('off','Simulink:SL_OutputNotConnected')When you want to reenable the warnings, type the following:
warning('on','Simulink:SL_InputNotConnected')
warning('on','Simulink:SL_OutputNotConnected')These commands are session-wide commands that affect all Simulink models until you exit the MATLAB environment or change the warning settings.
Once you have a functioning baseline model, consider the following guidelines to take advantage of the Simulink software capabilities. There are no SystemBuild correlations.
To reduce wiring clutter and simplify interfaces:
Use the Simulink single-wire vector and matrix support. The SystemBuild software uses row-major 2-D matrices in some cases, whereas the Simulink software uses column-major arrays for all matrix dimensions. This means that to translate some 2-D calculations, you might need to account for a design transpose from time to time (an actual transpose block is not needed because the entire algorithm is transposed).
Create single-wire bundles using the Bus Creator and Bus Selector blocks. The SystemBuild software has a graphical wire bundling capability. However, you use this only for visual presentation; you do not use it to define interfaces or semantic operations. Simulink bus signals are more like real signals; they can:
Feed into nonarithmetic operator blocks such as Inport, Outport, Switch, and so on.
Have nested hierarchies (buses within buses).
In addition, you can:
Create bus objects in the MATLAB workspace to define and enforce interfaces.
Use the bus editor to graphically edit bus objects.
See Using Composite Signals in Using Simulink® for further information.
Instead of the SystemBuild logical concept (positive, negative), use the Simulink Boolean data type (false, true). To create native Simulink models with full efficiency and diagnostic capability, consider moving from the SB2SL logical blocks to the Simulink native logic blocks. In the converted model, consider replacing the LOG sublibrary NOT block with its Simulink equivalent (Logical Operator block with Operator parameter set to NOT).
The SystemBuild Algebraic Expression block supports inlined and production code generation, but it does not currently support some of the Real-Time Workshop® code generation optimizations. Consider replacing the SystemBuild Algebraic Expression block with the Embedded MATLAB Function block to improve production code generation (see Using the Embedded MATLAB™ Function Block in Using Simulink®.
![]() | Using SB2SL | Compatibility Between SystemBuild™ and Simulink® Software | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |