If you did not find a suitable Using Units in the standard libraries (ISO-80000), you can:
Creating a custom Value Type
If you want to use a different Value Type than our library provides, you can create a custom Value Type and specify a desired Using Units for it from the ISO-80000 package.
To create a custom Value Type
- Select a package in the Containment tree where you want to create a new Value Type.
- Right-click it and select Create Element.
- In the opened dialog, search for a Value Type and select it.
- Type its name in the following syntax: quantity name[unit name]. (e.g. volume[liter]).
- Press Enter.
- Double-click the newly created Value Type to open its Specification window.
In the Specification window, specify the Unit property value:
a. Click .
b. In the Select Instance Specification dialog, clear the Apply Filter box.
c. Make sure the ISO-80000 library is loaded in your project.Warning
If the ISO-80000 library is not uploaded in your project, you can load it directly in the Select Instance Specification dialog by clicking the Load button.
d. Select the required Unit from the ISO-80000 package (e.g.litre).
- Click Close.
The new Value Type is defined in your project and can be used as a type for a Value Property.
Creating custom Unit
If you need to use imperial units (e.g. inch, foot, mile) or other units that are not defined in the ISO-80000 standard, you can create a custom Unit in your project. A Using Units must always be related to a Quantity Kind, but a Quantity Kind need not have any associated Units. Often equations can be expressed in terms of quantities that include Quantity Kinds without specifying Units.
To create a custom Unit
From the Block Definition Diagram palette, expand the Value Type button and select the Unit button.
If you do not see the Unit button, make sure the Expert Mode is turned on.
- Click the mouse pointer on the diagram pane. The Select Classifier dialog opens automatically.
- In the Select Classifier dialog, find the Unit Block, double-click it to select and click OK. The new Unit is created.
Type its name (e.g. mile).
- Double-click the Unit shape to open its Specification window.
- In the Specification window specify:
The Quantity Kind property value:
a. Click .
b. In the Select Quantity Kind dialog, clear the Apply Filter box.
c. Make sure the ISO-80000 library is loaded in your project.Warning
If the ISO-80000 library is not uploaded in your project, you can load it directly in the Select Quantity Kind dialog by clicking the Load button.
d. Select the required quantity from the ISO-80000 package (e.g. distance).
- The symbol of Unit:
a. In the Property group list, select Slots.
b. Select the symbol slot and click the Create Value button.
c. Type the unit symbol in the Value area (e.g. mi).
d. Click Close.