Switches

A switch enables you to turn things on or off in a model. When you add a switch to your model, you can assign it to control one or more converters, to a sector, to a module, or to turn on/off the current settings in the Sensitivity Specs dialog box. Use the switch to create a user-friendly device that allows model users to control aspects of a model.

The following table provides an overview of what you can assign to a switch and what happens when the switch is turned on or off. For more details, see Switch dialog box.

When the switch is on When the switch is off
Converter The associated converter's value is 1 The associated converter's value is 0
Sector The Run Sector(s) command is available and runs the sector associated with the switch The associated sector does not run when the command is used
Module The Run Module(s) command is available and runs the module associated with the switch The associated module does not run when the command is used
Sensitivity Analysis The next run will use the current sensitivity specs The model runs in normal, single-run mode

If you select to associate a switch with converters, you can create a special type of switch, called the "chained switch". A chained switch allows you to turn on one entity while simultaneously turning off all other entities in the chain. When you create a chained switch, you can select up to ten converters to include in the chain.

The following procedures describe how to add a switch to your model, how to define the switch (including creating a chained switch), and how to turn switches on and off.

Note: You can add a switch only on the Interface layer.

To place a switch on the diagram

  1. On the Interface layer toolbar, click the switch tool .
  2. Click the diagram to place the switch.
  3. To specify the properties for the switch, double-click the switch icon, or right-click the switch icon and then choose Open from the menu that appears.

    The Switch dialog box opens.

  4. Use the options in the Switch dialog box to define the properties of the switch. For more information, see To define a switch.

For more information about placing and editing switches, see Working with objects.

Notes: You cannot resize a switch.

You can select to have the name of the associated entity displayed next to the switch, but you cannot otherwise define or edit the switch's name.

To define a switch

  1. Open the Switch dialog box for the switch that you want to define.

  2. Select whether you want to use a Toggle or Push Button switch.

  3. In the Type of switch box, select what you want the switch to control.
  4. For Converters, Sectors, or Modules , select the entity that you want to associate with the switch.

    ClosedTell me how

    Tip: You can also add an entity to switch by dragging it from the Find palette.

  5. If you selected an arrayed entity, the Choose Subscript dialog box opens so that you can select which element in the array to control with the switch.
  6. Use the rest of the options in the Switch dialog box to define the switch. For detailed information about all of the options, see Switch dialog box. For information about creating a chained switch, see To define a chained switch.
  7. When you are finished, click OK.

Converters that are associated with a switch display a small switch icon to help remind you that the model logic is being overridden by a switch.

To define a chained switch

  1. Open the Switch dialog box for the switch that you want to define.
  2. Select the Push Button option.

  3. In the Type of switch box, select Converters.
  4. Select up to 10 converters from the "Allowable" list.

    ClosedTell me how

  5. Use the rest of the options in the Switch dialog box to define the switch. For detailed information about all of the options, see Switch dialog box.
  6. When you are finished, click OK.

Converters that are associated with a switch display a small switch icon to help remind you that the model logic is being overridden by a switch.

To turn a switch on or off

The procedure for turning on or off a switch depends on how you have defined the switch:

Concept Link IconSee Also