Main Content

createNumericType

Create Simulink numeric data type definition from imported AUTOSAR data elements

Description

createNumericType(arProps,name,applicationDataTypePath) creates a Simulink.NumericType object from an AUTOSAR application data type. The function can be used to work with AUTOSAR elements that you imported by using updateAUTOSARProperties.

example

createNumericType(arProps,name,compuMethodPath,implementationDataTypePath) creates a Simulink.NumericType object from an AUTOSAR implementation data type and CompuMethod.

example

Examples

collapse all

Create a Simulink® numeric data type with the name myDataType from the AUTOSAR application data type at path /AUTOSAR_PlatformTypes/ApplicationDataTypes/MyAppType.

dataObj = autosar.api.getAUTOSARProperties(mdlName);
createNumericType(dataObj,'myDataType',...
  '/AUTOSAR_PlatformTypes/ApplicationDataTypes/MyAppType');

Create a Simulink numeric data type with the name myDataType from the AUTOSAR implementation data type at path /AUTOSAR_PlatformTypes/ImplementationDataTypes/uint32 by using the computation method from path /a/b/myCM.

dataObj = autosar.api.getAUTOSARProperties(mdlName);
createNumericType(dataObj,'myDataType','/a/b/myCM', ...
  '/AUTOSAR_PlatformTypes/ImplementationDataTypes/uint32');

Input Arguments

collapse all

AUTOSAR properties information for a model, previously returned by arProps = autosar.api.getAUTOSARProperties(model).The parameter model is a handle, character vector, or string scalar representing the model name.

Example: arProps

Data Types: function_handle

Name of numeric data type created for Simulink representation of an AUTOSAR element.

In the Simulink environment, this numeric data type is mapped to both an application data type and an implementation data type. The application data type provides application-level physical attributes such as real-world range of values, data structure, and physical semantics. The implementation data type provides implementation-level attributes, such as stored-integer minimum and maximum specifications and primitive type (for example, integer).

Example: 'myDataType'

Data Types: char | string

Path to AUTOSAR application data type for created Simulink numeric data type. The application data type provides application-level physical attributes such as real-world range of values, data structure, and physical semantics. The application data type is used in simulation.

Example: '/AUTOSAR_PlatformTypes/ApplicationDataTypes/MyAppType'

Data Types: char | string

Path to the AUTOSAR CompuMethod, which is used to translate between the numeric implementation data type and the numeric application data type.

Example: '/a/b/myCM'

Data Types: char | string

Path to AUTOSAR implementation data type for created Simulink numeric data type. The implementation data type provides implementation-level attributes, such as stored-integer minimum and maximum specifications and primitive type (for example, integer). Implementation data types are used in code generation.

Example: '/AUTOSAR_PlatformTypes/ImplementationDataTypes/uint32'

Data Types: char | string

Version History

Introduced in R2019a