Documentation

About the Simscape Editing Mode

Suggested Workflows

The Simscape™ Editing Mode functionality is implemented for customers who perform physical modeling and simulation using Simscape platform and its add-on products: SimDriveline™, SimElectronics®, SimHydraulics®, SimMechanics™, and SimPowerSystems™. It allows you to open, simulate, and save models that contain blocks from add-on products in Restricted mode, without checking out add-on product licenses, as long as the products are installed on your machine. It is intended to provide an economical way to distribute simulation models throughout a team or organization.

    Note   Unless your organization uses concurrent licenses, see the Simscape product page on the MathWorks Web site for specific information on how to install add-on products on your machine, to be able to work in Restricted mode.

The Editing Mode functionality supports widespread use of Physical Modeling products throughout an engineering organization by making it economical for one user to develop a model and provide it to many other users.

Specifically, this feature allows a user, model developer, to build a model that uses Simscape platform and one or more add-on products and share that model with other users, model users. When building the model in Full mode, the model developer must have a Simscape license and the add-on product licenses for all the blocks in the model. For example, if a model combines Simscape, SimHydraulics, and SimDriveline blocks, the model developer needs to check out licenses for all three products to work with it in Full mode. Once the model is built, model users need only to check out a Simscape license to simulate the model and fine-tune its parameters in Restricted mode. As long as no structural changes are made to the model, model users can work in Restricted mode and do not need to check out add-on product licenses.

Another workflow, available with concurrent licenses only, lets multiple users, who all have Simscape licenses, share a small number of add-on product licenses by working mostly in Restricted mode, and temporarily switching models to Full mode only when they need to perform a specific design task that requires being in Full mode.

    Note   MathWorks recommends that you save all the models in Full mode before upgrading to a new version of Simulink® or Simscape software.

    If you have saved a model in Restricted mode and, upon upgrading to a new product version, open the model and it does not run, switch it to Full mode and save. You can then again switch to Restricted mode and work without problem.

What You Can Do in Restricted Mode

When your model is open in Restricted mode, you can:

  • Simulate the model.

  • Inspect parameters.

  • Change certain block parameters. In general, you can change numerical parameter values, but cannot change the block parameterization options. See the block reference pages for specifics.

  • Generate code.

  • Make data logging or visualization changes.

  • Add or delete regular Simulink blocks (such as sources or scopes) and appropriate connections.

For other types of changes, listed in the following section, your model has to be in Full mode. Some of these disallowed changes are impossible to make in Restricted mode (for example, Restricted parameters are grayed out in block dialog boxes). Other changes, like changing the physical topology of a model, are not explicitly disallowed, but if you make these changes in Restricted mode, the software will issue an error message when you try to run, compile, or save such a model.

What You Can Do in Full Mode

You need to open a model in Full mode if you need to do any of the following:

  • Add or delete Physical Modeling blocks (that is, Simscape blocks or blocks from the add-on product libraries).

  • Make or break Physical connections (between Conserving or Physical Signal ports).

  • Change the types of signals going into actuators or out of sensors (for example, from velocity to torque).

  • Change configuration parameters.

  • Change block parameterization options and other restricted parameters.

  • Change physical units of parameters.

  • Protect a referenced model containing Physical Modeling blocks (for more information, see Protected Model).

Switching Between Modes

The following flow chart shows what happens when you switch between modes.

New models are always created in Full mode. You can then either save the model in Full mode, or switch to Restricted mode and save the model in Restricted mode.

When you load an existing model, the license manager checks whether it has been saved in Full or Restricted mode.

  • If the model has been saved in Restricted mode, it opens in Restricted mode.

  • If the model has been saved in Full mode, the license manager checks whether all the add-on product licenses for this model are available and, if so, opens it in Full mode. If a add-on product license is not available, the license manager issues an error message and opens the model in Restricted mode. See also Example with Multiple Add-On Products.

    Note   You can set a Simulink preference to specify that the models are always to open in Restricted mode, regardless of the way they have been saved.

When a model is open, you can transition it between Full and Restricted modes at any time, in either direction:

  • When you try to switch from Restricted to Full mode, the license manager checks whether all the add-on product licenses for this model are available. If a add-on product license is not available, the license manager issues an error message and the model stays in Restricted mode. See also Example with Multiple Add-On Products.

  • No checks are performed when switching from Full to Restricted mode.

    Note   If a add-on product license has been checked out to open a model in Full mode, it remains checked out for the remainder of the MATLAB® session. Switching to Restricted mode does not immediately return the license.

Example with Multiple Add-On Products

When you try to open a model in Full mode or to switch from Restricted to Full mode, the license manager scans the model and attempts to check out the required add-on product licenses as it encounters them in the model. If a license is not available, the license manager issues an error message and the model stays in Restricted mode. The licenses are checked out sequentially. As a result, if a model uses blocks from multiple add-on products, some of the add-on product licenses may have already been checked out by the time the license manager encounters an unavailable license. In this case, these add-on product licenses stay checked out until you quit the MATLAB session, even though the model is in Restricted mode.

For example, consider a model that uses blocks from SimHydraulics and SimDriveline libraries, but the user who tries to open it has only the SimDriveline license available. It may happen that the license manager checks out a SimDriveline license first, and then tries to check out a SimHydraulics license, which is not available. The license manager then issues an error message and opens the model in Restricted mode, but the SimDriveline license stays checked out until the end of the MATLAB session.

Working with Block Libraries

This section describes the specifics of working with block libraries while using the Editing Mode functionality. These rules are applicable to any physical modeling blocks, that is, blocks from all Simscape libraries, including the add-on products. In general, you need to work in Full mode when you modify a library block. However, when you open a model that references the modified block, you may work in Restricted mode, under certain conditions. The following summary details the Editing Mode rules for modifying and using library blocks:

  • To add physical modeling blocks to a library block, you need to work in Full mode.

    • If this library block had not previously contained physical modeling blocks, you need to work in Full mode to load a preexisting model that uses this library block or to drag this block to a model.

    • If this library block had previously contained physical modeling blocks, you can work in Restricted mode when loading a preexisting model that uses this library block. However, you have to work in Full mode to drag this block from the library to a model.

  • To add external physical ports to a library block, you need to work in Full mode.

    • You can work in Restricted mode when loading a preexisting model that uses this library block.

    • However, to connect these additional ports, you need to work in Full mode because you are changing the model topology.

  • To delete external physical ports from a library block, you need to work in Full mode. If these ports were connected in a model saved in Restricted mode, loading the model causes the topology to change, so you need to switch to Full mode to save or compile the model.

Resolving Block Library Links

All Simscape blocks in your models, including the add-on products' blocks, must have resolved block library links. You can neither disable nor break these library links. This is a global requirement of Simscape platform, which is necessary to enforce the Editing Mode rules for modifying and using library blocks, listed above. A model with broken library links will neither compile nor save. You must restore all the broken block library links for your model to be valid.

If you want to customize certain blocks and use them in your models, you must add these modified blocks to your own custom library, then copy the block instances that you need to your model.

Was this topic helpful?