Skip to main content

DataType Editor

What This Chapter Covers​

This chapter describes the DataType editor, which defines application data types, implementation data types, and physical units. It covers the screen layout, the editable properties of all 9 categories, the rules for the 11 built-in primitives, and the real-time validation messages. ARXML import and export are covered in 13. Import and Export.

This chapter is for users who define the data types that interfaces or SWCs will use. A project must be open before you start.

Double-click the design ▸ System ▸ DataType node in the Explorer to open the editor in a tab. The editor saves to a single DataType model, which holds both data types and units.

10.1 Screen Layout​

Two tab buttons sit at the top of the editor, and the contents of the selected tab appear below them.

TabContents
DataTypeThe data type list and its detail form
UnitThe physical unit list and its detail form

DataType Tab Layout​

DataType tab — four areas: the list, Configuration plus the MEMBERS table, Preview, and Validation

DataType tab — four areas: the list, Configuration plus the MEMBERS table, Preview, and Validation

Drag the borders between the three areas, and the horizontal border between Preview and Validation, to resize them.

Unit Tab Layout​

The unit list (Unit, with + and - buttons) sits on the left, and the Configuration form and Preview sit side by side on the right. The Unit tab has no search, filter, or Validation area.

Unit tab — the list and Configuration without search, filter, or Validation, and a Preview holding the conversion formula, graph, SI-to-unit conversion table, comparison bars, and value converter

Unit tab — the list and Configuration without search, filter, or Validation, and a Preview holding the conversion formula, graph, SI-to-unit conversion table, comparison bars, and value converter

Compact Mode Embedded in the Interface Editor​

The right panel of the 09. Interface Editor contains the same DataType editor. In this compact mode the tab buttons, the type list, the Unit tab, and the Validation panel are all hidden. Only the properties form (top 60%, header DATA TYPE) and Preview (bottom 40%, header PREVIEW) are stacked vertically, and you can drag the horizontal border between them. The layout lets you define a type on the spot while you build an interface, and your edits are saved to the same DataType model. Compact mode has no shortcuts of its own; it leaves saving and undo to the Interface editor.

The DataType editor in compact mode inside the right panel of the Interface editor — only the DATA TYPE and PREVIEW areas remain

The DataType editor in compact mode inside the right panel of the Interface editor — only the DATA TYPE and PREVIEW areas remain

10.2 Data Type Categories (9 Kinds)​

Pick the Category from a group of buttons (a segmented control). They appear in this order: PRIMITIVE, ALIAS, ENUMERATION, FIXED_ARRAY, DYNAMIC_ARRAY, STRING, STRUCTURE, MAP, UNION.

The 9 Category segments — only PRIMITIVE is dimmed and cannot be selected

The 9 Category segments — only PRIMITIVE is dimmed and cannot be selected

Every category has the common NAME, Category, and Description properties. Description is a multi-line field and always comes last in the form. The meaning and the category-specific properties of the 9 categories are as follows.

CategoryMeaningCategory-specific properties
PRIMITIVEBuilt-in basic typeMin / Max (every property is read-only)
ALIASAn alias (typedef) for another typeBaseType, C++ Namespace, Factor, Offset, Min, Max, Unit
ENUMERATIONEnumerationBaseType, C++ Namespace, plus the ENUMERATION table
FIXED_ARRAYFixed-length arrayElement Type, Array Size, C++ Namespace
DYNAMIC_ARRAYVariable-length arrayElement Type, Max Size, C++ Namespace
STRINGString (AP only)Max Size, C++ Namespace
STRUCTUREStructureC++ Namespace, plus the MEMBERS table
MAPAssociative array (AP only)Key Type, Value Type, C++ Namespace
UNIONUnionC++ Namespace, plus the MEMBERS table

BaseType, Element Type, Key Type, Value Type, and Unit are all searchable selection boxes. The type itself is never offered as a candidate, and the rest of the candidate range differs per property.

PropertyCandidates
BaseType of ALIAS and ENUMERATIONThe 11 built-in primitives only (user-defined types cannot be selected)
Element Type of FIXED_ARRAY and DYNAMIC_ARRAYAll other types
Type of a STRUCTURE or UNION memberAll other types
Key Type of MAPThe 10 built-in primitives except boolean, plus types in the STRING category
Value Type of MAPAll other types
Unit of ALIASEvery unit on the Unit tab. The label reads DisplayName [name] when a DisplayName exists (for example km/h [KilometersPerHour]), and just the name otherwise

BaseType candidates for ALIAS — only the 11 built-in primitives appear

BaseType candidates for ALIAS — only the 11 built-in primitives appear

You cannot select PRIMITIVE. The PRIMITIVE button in the segmented control is dimmed and blocked from clicks, and the data layer also rejects a change to PRIMITIVE. If a type that is not a built-in primitive became PRIMITIVE, every field would be locked read-only with no way back, and the value could not be saved to a file in the first place.

10.3 The MEMBERS / ENUMERATION Sub-Table​

Selecting STRUCTURE, UNION, or ENUMERATION attaches a sub-table below the Configuration form. The title is ENUMERATION for ENUMERATION and MEMBERS for the others. The table layout per category is as follows.

CategoryColumnsAdd button tooltipDefaults for a new row
STRUCTURE#, Type, Name, Optional, deleteAdd MemberName SubElement_0, type uint8, Optional False
UNION#, Type, Name, deleteAdd MemberName Member_0, type uint8
ENUMERATION#, Name, Value, deleteAdd EnumerationName Literal_0, value is the current maximum + 1 (0 if there is none)

The MEMBERS table of a STRUCTURE — the # drag handle, the Type / Name / Optional columns, and the × that removes a row

The MEMBERS table of a STRUCTURE — the # drag handle, the Type / Name / Optional columns, and the × that removes a row

  • The # cell is a drag handle and shows the row number counted from 0. Click this cell and drag the row up or down to reorder it.
  • The × button at the end of a row deletes that row (tooltip Remove Member or Remove Enumeration).
  • You can drag the border of the two middle columns (Type / Name for STRUCTURE and UNION, Name / Value for ENUMERATION) to change their width. The #, Optional, and delete cells have a fixed width.
  • The name cell is checked strictly. A name that is empty, contains only whitespace, or breaks the AUTOSAR rules is not saved, and the previous name is kept. Leading and trailing whitespace is trimmed before the value is saved.
  • The Value of an ENUMERATION accepts integers only. When BaseType points at a built-in primitive, the value you type is clamped automatically to the representable range of that primitive. For example, with BaseType uint8, typing 300 changes the value to 255. When BaseType is empty or points at a type whose range is unknown, no clamping happens and no range check happens either. When BaseType is empty, a BaseType is required error appears in the Validation panel instead; when BaseType is set but its range is unknown, nothing is reported. When BaseType is empty or points at a type whose range is unknown, the value is not clamped, and the Validation panel reports the range overflow as an error instead.

10.4 Working with the List (DataType Tab)​

The list panel offers the following operations.

OperationDescription
+ (tooltip Add DataType)Creates a new type. The name is DataType followed by the current number of items in the list, and Category is empty
− (tooltip Delete selected DataType)Deletes the selected type without asking for confirmation. The BaseType, Element Type, Key Type, Value Type, and member types of other types that pointed at it are cleared (they are not replaced with another type)
⋯ (tooltip More actions)Opens the filter and sort popover
SearchThe placeholder is search.... It filters names by case-insensitive partial match
Arrow keysFocus the list and move the selection with the up and down arrow keys

Category badges and filter state — with only ENUMERATION selected, the list title reads DataType [ENUMERATION]

Category badges and filter state — with only ENUMERATION selected, the list title reads DataType [ENUMERATION]

The number in the name is the list length including the 11 built-in primitives. So in a project with no user-defined types, the first type you create is named DataType11, not DataType0. Names are not checked for duplicates, so creating a new type after deleting one in the middle can collide with an existing name. In that case a Duplicate ShortName error appears in the Validation panel.

Because a new type has no Category, a Category is required hint appears below the Category segmented control, and an error appears in the Validation panel as well. The hint disappears once you pick a category.

Selecting a built-in primitive and clicking − does nothing. Primitives cannot be deleted.

The ⋯ Menu​

The popover has the following sections.

SectionItems
Filter by CategoryCheck boxes for the 9 categories, plus the All button on the right (tooltip Select All / Deselect All)
Sort byDefault (Added Order) / Name (A-Z) / Category

The ⋯ menu — the 9 Filter by Category entries and the 3 Sort by entries, with the tooltip of the All button visible

The ⋯ menu — the 9 Filter by Category entries and the 3 Sort by entries, with the tooltip of the All button visible

  • A type with no category assigned always appears, regardless of the filter.
  • The filter state appears in the list title. With everything selected (or everything cleared) it reads DataType; with one category selected, DataType [ALIAS]; with several, DataType (3/9).
  • Sorting changes only the display order on screen. The order saved to the file stays the same.
  • Each list item carries a category badge in the form [ENUMERATION]. Built-in primitive items are styled differently to set them apart.
  • When there are no types at all, No DataTypes yet and Click [+] to add manually appear. When a search or filter returns nothing, No matching DataTypes appears.

10.5 Validation Panel​

The Validation area at the bottom right of the DataType tab checks your edits in real time. It refreshes about 0.3 seconds after an edit. When nothing is wrong, No validation issues appears. When something is wrong, a summary such as 2 errors, 1 warning appears at the top with the individual entries listed below it. Click an entry to select that type in the list.

The summary and entries in the Validation panel, and the BaseType is required message shown directly on the BASETYPE field

The summary and entries in the Validation panel, and the BaseType is required message shown directly on the BASETYPE field

A message has the form [index] "type name" — text. The index is the position in the list counted from 0, including the built-in primitives, and it does not change when you change the sort or the filter.

Errors (error)​

The checks reported as errors, and their messages, are as follows.

CheckMessage
Missing name[0] ShortName is empty
Category not set[0] "MyType" — Category is not set
Missing BaseType on ALIAS or ENUMERATION[0] "MyType" — BaseType is required
Factor of an ALIAS is 0[0] "MyType" — Factor must not be 0
Min > Max on an ALIAS[0] "MyType" — Min (10) > Max (5)
Missing Element Type on FIXED_ARRAY or DYNAMIC_ARRAY[0] "MyType" — Element Type is required
Array Size of a FIXED_ARRAY missing, or 0 or less[0] "MyType" — Array Size is required
Missing Key Type or Value Type on MAP[0] "MyType" — Key Type is required / — Value Type is required
Duplicate name[1] Duplicate ShortName: "MyType"
Self-reference— Self-reference in BaseType/Element Type / — Self-reference in Key Type / — Self-reference in Value Type / — Member[0] self-reference
Circular reference[0] "A" — Circular reference: A -> B -> A

Structure and Enumeration Detail Errors​

The detail checks on members and literals are as follows.

CheckMessage
Missing member name— Member[0] name is empty
Member type not set— Member[0] type is not set
Duplicate member name— Duplicate member name: "value"
Missing literal name— Literal[0] name is empty
Duplicate literal name— Duplicate literal name: "on"
Duplicate literal value— Duplicate literal value: 3
Fractional literal value while BaseType is an integer— Literal[0] value 1.5 is not an integer (BaseType is not float)
Literal value outside the BaseType range— Literal[0] value 300 is out of BaseType range [0, 255]

Warnings (warning)​

The following item is reported as a warning.

CheckMessage
Max Size of a STRING not set[0] "MyString" — Max Size not set, default 255 will be applied

Field Errors That Appear as You Type​

Separately from the Validation panel, the following conditions appear directly below the field concerned.

TargetConditionMessage
Factor of an ALIASThe value is 0Factor=0 is not valid for LINEAR conversion (constant = TEXTTABLE)
Min / Max of an ALIASMin > Max (on both fields)Min (10) > Max (5)
Array Size of a FIXED_ARRAYEmpty, or 0 or lessArray Size is required
BaseType / Element Type / Key Type / Value TypePoints at the type itselfSelf-reference is not allowed
A reference field required by the categoryEmptyBaseType is required / Element Type is required / Key Type is required / Value Type is required

Per-Row Errors in MEMBERS / ENUMERATION​

Each row of the sub-table (10.3) has its own error display as well.

TargetConditionMessage
Member or literal nameEmptyName is required
Member or literal nameCollides with another rowDuplicate name
Member nameBreaks the AUTOSAR rules (warning)Must start with a letter, then letters/digits/underscores only
Member typeEmptyType is required
Member typePoints at the type itselfSelf-reference is not allowed
Literal valueCollides with another rowDuplicate value
Literal valueFractional while BaseType is an integerNot an integer (BaseType is not float)
Literal valueOutside the BaseType rangeOut of range [0, 255]

Per-row errors in an ENUMERATION table — the two rows with the same name are marked in red and Duplicate literal name appears in Validation

Per-row errors in an ENUMERATION table — the two rows with the same name are marked in red and Duplicate literal name appears in Validation

DYNAMIC_ARRAY has no required-size check. As long as Element Type is set, nothing is reported as an error. Max Size is an optional property that expresses an upper bound.

10.6 Preview Panel​

Preview visualizes the structure of the selected type per category. When no type is selected, Select a DataType to preview appears. The contents per category are as follows.

CategoryContents
PRIMITIVEThe size, the encoding, and a value range bar (for boolean the two ends read false and true)
ALIASThe Base information (with a Unit row appended when a Unit is set), the Raw-to-Physical graph, and the value converter. The formula line (physical = 0.1 × raw + 0) appears only when Factor is not 1 or Offset is not 0
STRUCTUREA struct (3 members) summary and a grid of member boxes. Optional members are marked separately. With no members, (empty struct)
UNIONA union (3 variants) summary and a grid of member boxes. With no members, (empty union)
ENUMERATIONbase: uint8 and literal chips (name plus value). With no literals, No literals defined
FIXED_ARRAY / DYNAMIC_ARRAYAn array diagram showing the element type and the length
STRINGA diagram of character cells, one per maximum-length character
MAPA map<Key, Value> summary and two boxes, Key and Value

The ALIAS Preview also places a value converter below the graph. Enter a Raw value on the top line and the Physical value appears on the right; enter a Physical value on the bottom line and the Raw value appears on the right, immediately and to two decimal places. You can also scroll the mouse wheel over a field to raise and lower the value. The converter is a calculator for checking that Factor and Offset behave as you intended, and it does not change the model. The unit side has a converter of the same kind (10.8).

ALIAS Preview — the Base information, the conversion graph, and the Raw-to-Physical value converter

ALIAS Preview — the Base information, the conversion graph, and the Raw-to-Physical value converter

Click the type name of a member or an element to drill into that type, and Preview changes to it. A ← Back button then appears at the top left so you can return to the previous type. Built-in primitives have no further structure to expand, so they are not clickable.

Preview drill-down — the state after clicking a member type to drill into it. ← Back appears and the selection in the form on the left is unchanged

Preview drill-down — the state after clicking a member type to drill into it. ← Back appears and the selection in the form on the left is unchanged

10.7 The 11 Built-In Primitives​

PAIO manages the following 11 names as reserved words. These types are injected into memory automatically when the editor opens, and they are not saved to the model file.

NameSize / encodingC declarationC++ mappingValue range
boolean8 / BOOLEANunsigned charbool0 ~ 1
float3232 / IEEE754floatfloat±3.4028235e+38
float6464 / IEEE754doubledouble±1.7976931348623157e+308
sint88 / 2Csigned charint8_t-128 ~ 127
sint1616 / 2Csigned shortint16_t-32768 ~ 32767
sint3232 / 2Csigned longint32_t-2147483648 ~ 2147483647
sint6464 / 2Csigned long longint64_t-9223372036854775808 ~ 9223372036854775807
uint88 / NONEunsigned charuint8_t0 ~ 255
uint1616 / NONEunsigned shortuint16_t0 ~ 65535
uint3232 / NONEunsigned longuint32_t0 ~ 4294967295
uint6464 / NONEunsigned long longuint64_t0 ~ 18446744073709551615

Keep the following points in mind.

  • Inside the model, always use the AUTOSAR notation (uint8). C++ notation such as uint8_t appears only when you export C++ ARXML.
  • You cannot give a user-defined type one of these 11 names. If you try, 'uint8' is a reserved built-in primitive name appears on the field and the value is not saved.
  • You cannot change the name or the properties of a primitive, and you cannot delete one (every field is read-only).
  • Primitives missing from the file are normal, not a loss. Their definitions are built into the tool, so there is no reason to save them, and saving them could conflict with the built-in definitions the next time the file opens. The schema also forbids these 11 names. Other types simply reference a primitive by name.
  • If the file contains an item whose name is a reserved word but whose category is not PRIMITIVE, PAIO treats that item as corrupted and discards it, then injects the correct built-in definition again.

The Structure Created on Export​

A single primitive is exported as four AUTOSAR representations together.

RepresentationName
SW-BASE-TYPEExactly the name shown in the editor
APPLICATION-PRIMITIVE-DATA-TYPEExactly the name shown in the editor (only boolean gets CATEGORY BOOLEAN; the rest get VALUE)
IMPLEMENTATION-DATA-TYPE (C)Exactly the name shown in the editor
STD-CPP-IMPLEMENTATION-DATA-TYPE (C++)The C++ name (uint8_t, bool, and so on)

Two DATA-TYPE-MAPPING-SET elements are appended automatically as well. They are named DataTypeMappingsCP (Application to the C implementation) and DataTypeMappingsAP (Application to the C++ implementation).

10.8 Unit Tab​

List​

The unit list offers the following operations.

OperationDescription
+ (tooltip Add Unit)Creates a new unit. The name is Unit followed by the current number of items in the list
- (tooltip Delete selected Unit)Deletes the selected unit without asking for confirmation

Because the 33 default units already fill the list, the first unit you create in a project with nothing added is named Unit33.

Editable Properties​

A unit has the following editable properties.

PropertyFormNotes
NAMETextFollows the AUTOSAR SHORT-NAME rules. A value that breaks the rules is not saved
DisplayNameTextThe symbol shown on screen (km/h, %, and so on)
FactorSiToUnitReal numberThe conversion factor from the SI unit to this unit
OffsetSiToUnitReal numberThe conversion offset from the SI unit to this unit
DescriptionMulti-line text

The Unit property of an ALIAS type references a unit defined here.

  • Renaming a unit also updates the Unit value of every data type that referenced it.
  • Deleting a unit clears the Unit value of every data type that referenced it.

Preview​

Preview on the right shows the conversion of the selected unit in several forms at once (see the Unit tab figure above). From top to bottom:

AreaContents
HeaderThe form DisplayName[NAME] (km/h[Kilometer]). Without a DisplayName, only the name appears
Conversion formulaThe form km = 0.001 × m. The multiplication term drops out when Factor is 1, and the addition term drops out when Offset is 0
GraphA straight line with the SI value on the horizontal axis and this unit's value on the vertical axis
Domain badgeSee the explanation below
Conversion tableA table of a few representative SI values converted to this unit. The sample values are chosen automatically to match the magnitude of Factor
Comparison barsTwo bars below SI 1 = ? that compare the size of 1 SI with the corresponding unit value
Value converterEnter an SI value and the unit value appears; enter a unit value and the SI value appears, immediately. The fields accept the mouse wheel as well
DescriptionWhatever you wrote in Description

The domain badge appears only when Factor and Offset match an already known conversion. The tool holds a table of 29 conversions across 12 domains — speed, temperature, pressure, length, mass, time, angle, frequency, voltage, current, torque, and ratio. When the Factor and Offset of the unit you are editing match one of them to within 1%, PAIO shows a badge with the domain name, such as LENGTH, and a symbol pair, such as m → km. The SI placeholder in the conversion formula and in the conversion table then changes to the actual SI symbol (m) as well. When no conversion matches, no badge appears and the literal text SI is used — this is the case for units whose FactorSiToUnit is 1 (Volt, Meter, Second, and so on), and it is normal.

When several candidates match, the name breaks the tie. Factor 0.001 matches all six of the kPa, km, t, kV, kHz, and kN·m conversions, but the unit name is Kilometer, so the length conversion wins. When the name does not break the tie either, the conversion that comes first in the table is used, so a unit you create yourself may get a domain badge that does not match reality. The badge is informational only and is not saved to the model.

The 33 Default Units​

When a project opens, the list is filled automatically with 33 commonly used units (NoUnit, Percent, Radian, Degree, Meter, Millimeter, Kilometer, Kilogram, Gram, Second, Millisecond, Microsecond, Ampere, Milliampere, Kelvin, DegreeCelsius, MetersPerSecond, KilometersPerHour, RadiansPerSecond, RevolutionsPerMinute, Hertz, Newton, Pascal, KiloPascal, Bar, Joule, KilowattHour, Watt, Kilowatt, NewtonMeter, Volt, Millivolt, Ohm).

A unit left at its default values is not saved to the file. At save time PAIO records only the units whose values differ from the defaults and the units some data type actually references. The reason is the same as for the primitives: information the tool always fills in should not be duplicated in the file. So a saved file may show a short or empty unit list when you open it, and that is normal.

10.9 Saving and Undo​

The save and undo shortcuts are as follows.

OperationShortcutNotes
SaveCtrl+SWorks while the tab is visible on screen
Save AsCtrl+Shift+SOpens the Save DataTypes dialog for choosing the save location. The extension is appended automatically if you omit it
UndoCtrl+Z
RedoCtrl+Y or Ctrl+Shift+Z
  • On save, the value you were typing is committed before the file is written, so a value is saved even if you press Ctrl+S immediately after typing it.
  • Undo uses a single timeline shared by the whole project. The Edit menu in the header and Undo/Redo in the command palette use the same timeline (05. UI Layout and Navigation).
  • Once you save to another path with Ctrl+Shift+S, later Ctrl+S presses save to that path as well. To go back to the DataType model at the project's standard location, close the editor and open it again.

10.10 Integration with Other Screens​

  • Interface editor — The right panel holds the same DataType editor in compact mode (see 10.1).
  • Initial value (ValueSpec) editor — It reads the type structure defined here to decide the input form. A structure becomes a table, an array becomes indexed rows, and an enumeration becomes a combo box. Signal initial values are the exception: because a signal does not reference a data type, the input form is built from the signal's own properties (see 07. Signal Editor, 7.11).
  • Rename propagation — Renaming a type also updates the type references in the Interface model and in the ECUC configuration, including the ones you have not opened. SWC definitions are not part of this propagation.
  • Validation — The Validation panel of this editor covers only the structural checks of the data types themselves. Project-wide AUTOSAR constraint checks are shown in a separate panel (see 14. Validation).

10.11 Editing Rules Summary​

  • Names follow the AUTOSAR SHORT-NAME rules: the first character is a letter, and the rest are letters, digits, and underscores. Unit names are also checked against a 128-character limit, while data type names are not checked for length.
  • A type name is not saved if it is empty or a reserved word (one of the 11 built-in primitives). A name that does not match the rules shows a warning on the field, but the value itself is applied. Exporting ARXML in that state produces a document that does not match the schema, so fix any name that shows a warning before you use it.
  • Member and literal names are stricter: a name that does not match the rules is not applied at all, and the previous name is kept.
  • You cannot change the name or the properties of a built-in primitive, and you cannot delete one.
  • The list sort and filter, the panel sizes, and the scroll position are screen state only and are not saved to the file.