The purpose of this article is to establish a basic understanding of AUTOSAR's Application Data Types and their representation in SystemWeaver. The basic mechanics behind the Autosar Data Type Editor is covered in Editing AUTOSAR Data Types. Please note that depending on your specific tool chain, restrictions may apply that are not covered in here.
AUTOSAR Application Data Types
An Application Data Type in AUTOSAR describes the purpose and limitations of a value that can be a variable or information sent and received between multiple components. It describes the operational range and the translation between application values and the physical domain. The Application Data Types do not describe any implementation-specific details such as what data type the final implementation will use. It does, however, affect the final decision.
In AUTOSAR, there are three basic Application Data Types:
- Application Array Data Type
- Application Record Data Type
- Application Primitive Data Type
Below is an illustration of the SystemWeaver Meta model covering these data types.
To clarify the difference between interfaces and data types, one can see an interface as an instantiation of a data type that explains the reason why that data type is used to send or receive information. For example, a Sender Receiver interface with the name “Vehicle Speed” references a data type called Velocity. This Velocity data type can be used to describe all types of speed and velocity in a System. So, interfaces are specific in their responsibilities in SystemWeaver while data types are meant to be reused.
Application Array Data Type (AR4A)
This data type describes an array of objects. The number of objects in the array is specified by defining the attribute value for Max number of elements. Whether the array can vary in size or not, is defined by the attribute Array size semantics. The actual content of an Application Array Data Type is defined by the part called Application Array Element (ARAF). This part can point to any kind of Application Data Type.
Application Record Data Type (AR4Q)
This data type describes a complex data type. A complex data type is used to group other data types that have something in common. For example, a Velocity data type may be grouped together with a data type that indicates a Quality Factor.
Application Primitive Data Type (AR4P)
An Application Primitive Data Type describes how to transform an internal application value to the corresponding value in the physical domain or vice versa. It does not, however, say anything about the implementation choices, such as final data types in, for example, C code. Below is an illustration of the meta model of Application Primitive Data Types and the related elements supported in SystemWeaver.
An Application Primitive Data Type consists of four elements:
- The data type itself (AR4P) and its 3 elements:
- A Data Constraint (ARDC)
- A Compu Method (ARCU) and
- A SW Unit that the Compu Method references (ARUN)
Application Primitive Data Type
The name of the Application Primitive Data Type describes its purpose. An Application Primitive Data Type is, just like all Application Data Types, a reusable entity in SystemWeaver. It is recommended that you reuse Application Data Types to minimize the work of defining new ones.
The Compu Method describes the translation of application internal values to the corresponding values in the physical domain for a specific interval and vice versa. In AUTOSAR, Compu Methods can be reused between many Data Types. This is supported in SystemWeaver for compatibility reasons with other tools. However, in SystemWeaver, the strong recommendation is to focus on reusing Data Types and let Compu Methods be part of one single Data Type.
The SW Unit describes what physical unit, if applicable, that the physical value is represented in, e.g., meters per second, kilograms etc. SW Units can be reused in AUTOSAR and and reuse is also recommended in SystemWeaver.
The Data Constraint describes which range that this specific Application Primitive Data Type is allowed to operate in. The purpose of a Data Constraint is to be able to define the allowed operational interval for a certain data type. This interval is equal to or less than the interval defined of the Application Primitive Data Type's Compu Method. Whether Data Constraints should be used or not depends on the specific tool chain.
Read more about how to specify Application Primitive Data Types in SystemWeaver in Editing AUTOSAR Data Types.