Skip to main content

Data Type

What You Will Do​

In this chapter you create the data type SpeedType, an alias of uint16. Both interfaces in the next chapter use it.

Before You Begin​

WhereItemValue
DataType editorNAMESpeedType
DataType editorCATEGORYALIAS
DataType editorBASETYPEuint16

Creating SpeedType​

  1. Click DataType under DESIGN. The list holds the primitive types. Click + above the list.

    The DataType editor

    Figure 2-1. ① + (Add DataType).

  2. Enter SpeedType in NAME and press Tab, then click ALIAS under CATEGORY. Open BASETYPE, type uint16, and click uint16 in the list.

    Choosing the base type

    Figure 2-2. ① NAME, ② ALIAS, ③ uint16 in the BASETYPE list.

  3. Save with Ctrl+S.

    The finished SpeedType

    Figure 2-3. ① BASETYPE = uint16.

Why Is It Designed This Way?​

  • An alias of uint16. A named type says what the value means, and every use of it changes together if the base type ever does.

Checklist​

  • The list holds SpeedType, and selecting it shows ALIAS and BASETYPE uint16.
  • The tab VehicleDesign:DataType carries no modified mark.

Next Step​

In Interfaces you create the two interfaces that use SpeedType.