Editing Data of a Large Array or Matrix

Note

This instruction applies to arrays larger than 2048 elements and matrices with one or both axes larger than 63 elements. Smaller arrays and matrices can be edited as described in Editing an Array or Matrix.

To edit data of an array larger than 2048 elements or a matrix with one or both axes larger than 63 elements, you have to create an ASCII file with the array/matrix data and import that file.

  1. Create an ASCII file named *.dat.

    You can create an empty file, or you can export the data of the desired array/matrix.

    Note

    You must use the extension *.dat because you cannot import files with other extensions.

  2. Edit the file and enter the Closedarray/matrix values.

    During import into a matrix, each row in the ASCII file is imported to one row in the matrix, even if the matrix row is shorter or longer than the row in the ASCII file. Therefore, enter all values for a matrix row into the same row in the ASCII file.

  3. Save the file.
  4. To import the data from the ASCII file, do the following:

    1. Proceed as described in Reading the Data for an Array, Matrix, Characteristic Line/Map from a File.

      If the *.dat file is Closedlarger than the array/matrix, you are asked if you want to change the max. size of the element. Yes changes the array/matrix size, No keeps the array/matrix size and ignores the surplus entries in the *.dat file.

      • The *.dat file is larger than the array.
      • The *.dat file contains more rows than the max. Y size of the matrix.
      • A row in the *.dat file contains more elements than the max. X size of the matrix.
    2. Click Yes or No to continue.

      The data is imported to the array/matrix.

    For an array, the data in the *.dat file are imported consecutively. For a matrix, each row in the *.dat file is imported to one matrix row.

  5. To check the import result, you can, e.g., view the generated code.

Note

In a non-AUTOSAR environment, the integer values corresponding to the enum values of a Std_ReturnType array/matrix are generated as literals, independent of the value selected for Generation of Enums in the project properties. Elements with model type Std_ReturnType have a unit8 type in the C code.

In an AUTOSAR environment, the prefix RTE_E_ is added to the enum values of a Std_ReturnType array/matrix, to provide compliance to the AUTOSAR standard.

If you want to optimize the generated initialization code of arrays/matrices of scalar or enumeration type, activate the Generating Sparse Arrays target option. See also Initialization of Arrays and Matrices.

See also

Editing an Array or Matrix

Writing Data of Arrays, Matrices, Characteristic Lines/Maps to a File

Software Component Editors – RTE Access Macros

Reading the Data for an Array, Matrix, Characteristic Line/Map from a File

Viewing the Generated Code

Project Properties – Code Generation Options

Initialization of Arrays and Matrices

ASCET Options – Targets Node