This article describes how to edit AUTOSAR Application Primitive Data Types in SystemWeaver.

**Tip:** If you are not familiar with AUTOSAR's Application Data Types, see AUTOSAR Application Data Types or visit www.autosar.org.

## Prerequisites

- The SWExtension.Autosar extension for the swExplorer client

# Activating the Data Type Editor

The Datatype Editor view is available when you select an Application Primitive Data Type.

The workflow and the available options are described in detail below.

# Selecting the Data Type Category

The first step in the Data Type Editor is to choose the appropriate **Datatype Category**. The available options are VALUE, STRING and BOOLEAN.

**VALUE: **a primitive value

**STRING:** a single value interpreted as a string

**BOOLEAN:** a value that can be either True or False

The available options for each selection above are described in detail below.

## Selecting VALUE

For VALUE, the following options are available to describe the Application Data Type:

**Unit**

If applicable, a Unit can be selected to describe the unit of this data type in the physical domain. Defining a Unit is optional.

**Compu method category**

This attribute describes the type of translation from internal application values to the physical domain, e.g., from UINT8 to m/s. Defining a Compu method category is mandatory. The options are described below.

#### IDENTICAL

An internal application value corresponds directly to its value in the physical domain. No conversion needs to be defined to describe the translation of application values to the physical domain.

#### LINEAR

A linear conversion algorithm is defined to describe the translation of internal application values to the physical domain on the below format:

An explanation of the values are available below:

__Min__

The minimum allowed internal application value.

__Max__

The maximum allowed internal application value.

__Min interval type__

Defines the interval type for the minimum value. OPEN means larger than or equal to the minimum value. CLOSED means larger than the minimum value. UNDEFINED means that the interval type is not defined.

__Max interval type__

Defines the interval type for the maximum value. OPEN means less than or equal to the maximum value. CLOSED means less than the maximum value. UNDEFINED means that the interval type is not defined.

__Resolution__

The scaling factor of the internal value.

*Offset*

The offset of the internal value to the physical Value.

*Denominator*

The denominator of the formula. This is commonly set to 1.

*P**hysical min*

The computed minimum physical value.

*Physical max*

The computed maximum physical value.

#### SCALE_LINEAR

Multiple linear conversion algorithms are defined to describe the translation of internal application values to the physical domain.

For how to define a linear conversion algorithm, see the previous **LINEAR **section. By pressing **Add row**, one more linear conversion is defined. By pressing **Delete**, the corresponding linear conversion is removed.

#### SCALE_LINEAR_AND_TEXTTABLE

Multiple linear conversion algorithms are defined to describe the translation of internal application values to the physical domain together with named values.

For how to define a linear conversion algorithm, see the previous **LINEAR **section. By entering a value in the **Const** column, that interval will be interpreted as a named value. If you remove the Const value, it will be interpreted as a linear conversion. By pressing **Add row**, one more linear conversion or named value is defined. By pressing **Delete**, the corresponding linear conversion or named value is removed.

#### TEXTTABLE

An internal application value is translated to a named value in the physical domain.

The interval definition is the same as for the previously described **LINEAR** conversions. To define a named value, enter its name in the **Constant** column. By pressing **Add row**, one more named value is defined. By pressing **Delete**, the corresponding named value is removed.

### Defining Data Constraints

The **Data constraints** settings define the limits for what value range that is allowed to be defined. These values need to be inside or equal to the range of a described linearization. If the limits are the same, it is possible to copy the limits from the linearization using the **Copy limits from Compu method** button. Depending on your choice of Compu method category, the limits to define are either for the allowed internal value range or for the allowed physical value range.

The Data Constraint limits are shown in the Graph as red lines. If the red lines are horizontal, the Data Constraint is for the Physical domain. If the red lines are vertical, the Data Constraint is for the application internal domain.

## Selecting STRING

This datatype category defines a single value interpreted as a string.

The following attributes are available:

**Array size semantics(mandatory): **Defines if the array of strings is of a fixed or dynamic size.

**Max text size(mandatory):** Defines the number of characters allowed in the string.

**Fill Character(optional): **Defines a character that is used for padding up to the Max text size, if necessary. The fill character is defined either as a decimal or hexadecimal number according to the ASCII format.

## Selecting BOOLEAN

This datatype category defines a value that can be either True or False.

The Boolean datatype category gives no further options.

# Saving the Information

When you are finished defining the Data Type, press the **Save** button. Unlike many of the views in SystemWeaver, the Data Type Editor requires you to save before the information is stored in SystemWeaver.

**Note: **The Data Type Editor view is configurable, therefore, some of the features described here may not be available in your installation.