Lesson 3: Creating standard value types

Most of the attributes have already been added to the SystemUnderControl block. In this lesson, you add the mass of the water to the block. Since the mass of water is expressed in kg, you begin by specifying an applicable valueType, kg. The other attributes already have valueTypes.

About this task

The structural design defines the logical and physical elements of the model iteratively.

Systems engineers can use predefined elements included in the SysML profile to speed up development. For example, the profile includes dimensions, units, and some standard value types, as shown in this example from the tutorial model.

Browser showing data types, dimensions, units, and value types

In this example, the SysML profile (circled in the illustration) lists common dimensions including length and mass. The units supplied in the profile include ampere, meter, kilogram, and mole. The dimensions and units that were added for this project are listed in the TypesPkg, shown before the Profiles folder.

You need to add any engineering units that are required for your project but are not included in the SysML profile packages. For example, the kilogram unit is available in the package BaseSIUnits package, but it does not have a corresponding value type, kg. Value types are used to specify the type for attributes of blocks, flow ports, action pins and activity parameters, as well as constraint parameters in the same way as standard types such as double, short, int and boolean are used to specify types for software.

To add "kg" as the ValueType for kilogram:

Procedure

  1. In the browser, select ValueTypes in the TypesPkg.
  2. Right-click and select Add New ValueType.
  3. Type kg in the browser field.
  4. Double-click kg to open the Features window.
  5. Change the Kind field to Typedef.
  6. On the Details tab, select double for the Basic Type.
  7. On the Tags tab, click the unit value field, and click the ellipsis button to open the Select Value window.
  8. In the browser, expand Profiles > SysML (Ref) > Packages > SIDefinitions > Packages > BaseSIUNits > Units and select the Kilogram unit. Click OK.
  9. Save your changes in the project using either File > Save All or the Save button on the toolbar.

Results

After creating the value type of kg, you use it as the type specification for the mass attribute.
To add a new attribute:
  1. In the browser, select the SystemUnderControl block in the DesignSynthesisPkg.
  2. Right-click Attributes and select Add New Attribute.
  3. Change the attribute name to mass.
  4. Double-click the new attribute to open the Features window for the attribute and click the General tab.
  5. In the TypesPkg, change the type to kg by selecting <<Select>> from the list.
  6. In the TypesPkg, navigate to ValueTypes and choose kg. Click OK.
  7. Enter 720 in the Initial Value field. (The mass of the SystemUnderControl is 720 kg.) Click OK.
Be sure to save your changes.

Lesson checkpoint

In this lesson, you learned the following:
  • About the Dimensions, Units, and ValueTypes provided with the SysML profile
  • The importance of ValueTypes in a model
  • Adding ValueTypes to your model
  • Adding Attributes
In the next lesson, you connect blocks and analyze behavior.