Global mapping

Mapping concept

In ecu.test exists a mapping layer that allows that test quantities can be exchanged within test cases, without modifying the test case. For this a universal identifier (containing mapping name, reference) is mapped to a concrete quantity (the mapping target).

Different ways to determine the mapping destination (ordered by priority):

  1. Parameterized Mapping (Package references mapping)

  2. Global mapping

  3. Local mapping

A Local mapping is created automatically when a test quantity or a package reference is added to the test case. It can be used to edit the access of all test steps using this mapping within this Package.

Info

Every package has its own local mapping. The local mapping has no influence on the content of referenced packages.

Possible settings in the mapping:

  • Mapping name

  • Path to target

  • Measurement acquisition rate

  • Meta data: description and category

The Global mapping allows to modify mapping targets in multiple packages at the same time. The settings that can be be manipulated in the global mapping are the same as in the local mapping. The mapping information defined by the global mapping is used for all test steps that reference mappings of the same mapping name. If a global mapping is active for a test step, it is marked with the letter M on its icon.

An arbitrary number of global mappings can be loaded at the same time. Their order defines their priority and which entry is being used if multiple mappings with the same name exist.

A target can be modified during test execution by passing the mapping targets to the package when calling it.

The subsequent example shows the connection of mappings in ecu.test.

Example

A test quantity is read in the test case. The test step only contains the mapping name (e.g. “Rpm”).

The mapping layer connects the mapping name to the target (e.g. the bus signal “A-CAN/PT_DATEN/ENG_RPM”).

The access to “A-CAN” happens according to the settings in the test configuration where additional information for the test quantity are available from the referenced description file (e.g. bus database).

The access to the test bench is finally realized using the port from the test bench configuration which is selected in the test configuration.

../_images/Mapping_Ueberblick.png

Due to the connection using mappings it is possible to manipulate the used test quantity without changing the test case. If the signal providing the engines Rpm is changed from “ENG_RPM” to “ENG_SPEED”, there is no need to adopt the test case, but only to reassign the mapping target.

Parameterized mapping in packages

(see Package references)

The parameterized mapping can only be used if a package is called from another package. In the parameterization dialog of the package reference the mapping items of the called package can be overwritten via drag and drop.

This concept is helpful to create package libraries containing packages that use generic operations on test quantities. By doing this the same package can access different test quantities, depending on the package callee.

Parameterization in projects

(see Package reference)

In a project, mappings or mapping files can be defined in two ways:

These parameterizations are especially useful where a test case can be executed for multiple similar mapping targets.

Global mapping

(see Global mapping)

If a mapping item has to be changed that is used in several packages, the usage of the global mapping is recommended. More details can be found in Window ‣ Global Mapping. Mapping items can be added to the global mapping in different ways, e.g.:

  • Via dragging and dropping test quantities or packages from the actions windows

  • Via dragging and dropping from a local mapping

Global mappings are stored in a *.xam file and can be loaded automatically when a test configuration is started (see Common tab).

Local mapping

(see Local mapping)

A mapping entry exists for every test quantity or package reference that is used in a package. It is created automatically if,for example, a model quantity to be read or written is inserted into the package. A mapping name is generated that is similar to the used test quantity or package. The name can be changed by double-clicking the entry in the mapping tab.

prioritization of mappings

If a mapping name exists in multiple mappings, the mapping item with the highest priority is used. The following list summarizes the prioritization from highest to lowest.

  1. Package reference in package

    1. Mapping reference in mapping assignment tab

  2. Project

    1. Parameter set in package reference

    2. Parameterization on project folder

    3. Parameterization on project root node

  3. Test configuration

    1. Global mapping files with high priority (shown on the left or top position)

    2. Global mapping files with low priority (shown on the right or bottom position)

  4. Package

    1. Local mapping

The general rule: if a mapping item is defined in a more specific execution context, its priority is considered higher.

Global mapping

Using the global mapping, access to test quantities and package references can be managed beyond the scope of a single package. This can highly improve maintainability and readability of test cases.

  • Changes in names and paths of test quantities or package paths can be handled flexibly.

  • Short and easy-to-remember identifiers usually prove quite helpful when working with frequently-used mapping targets.

Using global mappings, it is possible to create test cases independently of the simulation model, the program status or the bus simulation. If, for example, a different model will be used for testing, it will suffice to enter the new path of the model variable into the mapping list.

Global mappings are saved in separate files (file extension .xam). These can be set in the test configuration and in project parameterizations. It is also possible to load global mapping files at runtime.

../_images/Mapping_Global.png

Scope

A package references the local mapping assigned to the mapping name. If there is a global mapping with the same name, it overwrites the local mapping. If the mapping name occurs in several global mapping files the first file (leftmost tab) is used to resolve the mapping.

The basics of how local, global, and parameterized mappings work together are summarized in the section Mapping concept.

Info

Global mappings are highlighted in the Mapping section of the test report.

Add a mapping element

To add a global mapping you can either drag a quantity from the action tab into the global mapping window or right-click an entry in a local mapping and choose Add to global mapping. In the submenu you can choose the target global mapping file. Next to the active global mapping, which is currently shown, you can select a specific mapping file that is currently loaded.

Check mapping

The button Check mapping can be used to find invalid mapping entries in the currently selected mapping file. On activation, the button opens a dialog, similar to the one from Check package. It lists all invalid mapping items together with an error text. A double click on an element selects it in the global mapping.

Edit mapping elements

A non-existent mapping can be replaced by an existing variable by means of clicking and dragging. Simply drag the new variable from one of the action tabs onto the defective mapping. The test case is updated automatically.

Info

With some tools, the physical unit is queried from the tool. Since this can take a long time for mappings with many entries, the unit “?” is displayed first. To determine the unit of individual mapping elements, the settings dialog of those mapping elements can be opened.

A double click on a mapping entry opens the settings dialog.

../_images/Mapping_Dialog.png

The dialog contains general settings for mapping elements as well as specific settings subject to the target type.

General settings

Mapping name:

  • Identifier to map test steps to test quantities

  • Changes in the local mapping will directly adopted by the test steps

  • There is the additional possibility of taking over any changes of names in all packages of the package directory, and all (other) mapping files of the workspace

Category:

  • Name to group mapping elements in local and global mappings as well as in the editor

Description:

  • Description text that is shown in the local and global mapping as well as in the editor

Automatically managed:

  • Defines whether the mapping element should be deleted automatically if it is not used by any test step (only in the local mapping)

Acquisition rate

The measuring raster of test quantities that use an acquisition rate can be defined here. The displayed measuring rasters are supported by the tools concerned and directly requested from them. If the connection to the tool is not established, the desired acquisition rate can be typed directly as free text.

Choosing the acquisition rate “Port-Default” leads to the use of the default setting of the application port.

When recording via CANape or an XCP-Port of the Add-on ecu.test calibration, a specific acquisition rate per mapped item can be set. To do so, enter e.g. polling#1234 in the MEAS section of the edit dialog of a mapping item to set the polling to the desired value of 1234 ms. For CANape the same is possible with the keyword cyclic.

By using the option “Allow alternative acquisition rate” can be decided whether all affected test steps will be rated ERROR if the acquisition rate is invalid or full. Otherwise another acquisition rate is used and documented in the report.

Enumeration

The enumeration button allows to view the enumeration information read from the used data base for the selected variable. In case the variable in question is a generic or model variable without given enumeration information, the following dialog allows to manually define it.

../_images/Enumeration_bearbeiten.png

It is possible to define the values for the physical representation in column Value and their textual counterpart in column Text. For generic test cases this assignment is used to support different models. If for instance in the above example “On” is not represented with 1 but with another value for an alternative model, the test case has not to be manipulated, but only the enumeration information. Alternatively, replacing the mapping of generic and model variables inherits the enumeration of the old variable if the new variable does not contain one. Thus, it is possible to create generic test cases without knowing the specific model or when not connected to the model tool, respectively. With an enumeration defined, the texts are suggested using the textual representation in read/write test steps.

Info

Defining enumerations in model variables is only possible if the enumerations are not yet determined by the model description.

Manipulation

For bus signals, the checkbox Read and record via the manipulation port can be used to specify whether the signal should be read or recorded via the port of the Active node or for Manipulation.

Switching to the port of the Active node has no effect on the writing of individual signals, such as via a connected residual bus simulation or as is necessary for a manipulation gateway. The manipulation port is always used when writing.

Also see Bus access tab in the test configuration.

Info

If the manipulation is active, not every supported tool allows read access. In this case another mapping element with the same target link but without the manipulation option has to be created and used for reading.

Alternative package representation

In addition to the name of a package mapping, an alternative call representation can be specified, which may contain placeholders. These are automatically resolved when the mapping is inserted into a test case.

Further information on alternative package representation can be found at Basiscs of Keyword-Based Testing or in the corresponding Tutorial.