Set Priority and Initial Target for Block Variables

When you open the Variables tab of a block dialog box, it lists all the public variables specified in the underlying component file, along with priority, target value, and unit. In most cases, the default value for each of these is Unused. For example, if you add a Translational Spring block to your model, double-click it to open its dialog box, and then click the Variables tab, it looks like this:

For details on these variables and their usage in the block equations, click the Source code link in the block dialog box to view the underlying Simscape™ source file. The Source code link is available for all the Foundation library blocks that have a Variables tab.

To specify the initial deformation of the spring, select the check box next to the Deformation variable. Once you select the check box next to a variable, its Priority changes to High, while Value and Unit assume the values specified in the variable declaration in the underlying component file.

Type a new number into the Value field and change the unit, if desired. The Unit drop-down lists contains all the units defined in the unit registry that are commensurate with the one specified in the variable declaration. You can also change the priority from High to Low. In the following dialog box, Deformation is specified as a high-priority variable with the initial target of 20 mm.

If you clear the check box next to a variable name, its Priority, Value, and Unit fields switch to Unused. However, if you select it again, these fields will retain their last specified value for when they were in use.

Related Examples

More About

Was this topic helpful?