<noinclude>The following applies to version >= 2.41 of the portal:</noinclude>
[[File:Mapping v2.png|thumb|685x685px]]
[[File:Mappings1.png|thumb|200px|frame|Mappings 1: The manual mapping checkbox]]
The ''Mappings for this task'' window is used to configure the connections between logical communication channels (from a signal reader assignment) and the physical buses used in the system. It displays both CAN and LIN channels and allows you to assign them to specific physical buses (WCU/WMU or VCF).
----
When creating a SignalReader task (New Task and then selecting the "SignalReader" tab) there is a new checkbox, "Manual mapping", as illustrated in illustration "Mappings 1".
=== Left Side – Logical Channels ===
If you tick this box, the upload of the SignalReader haf-file will work as in previous versions of the portal. If you do not tick this box, then, when a .haf-file is uploaded, the portal will start a process called auto mapping.
On the '''left side''' of each group, you can see the logical configuration:
==Auto mapping==
* '''Channel:''' The CAN or LIN bus identifier (e.g., CAN1, LIN1).
[[File:Mappings2.png|thumb|200px|frame|Mappings 2: Auto mapping performed]]
* '''Speed:''' The communication speed of the bus (e.g., 500 kbit/s for CAN, 9600 bit/s for LIN).
* '''#Signals:''' Number of signals currently mapped to that bus.
When a .haf file for a SignalReader assignment is uploaded, the portal will start to parse the file and search for references to CAN buses and try to look up the name of the bus. The name of the CAN bus is found in a section named GLOBAL_CAN_API_MODULE_X, as the example below shows. If no such section exists in the .haf file, the parser is unable to look up the name of a CAN bus.
* '''WCU:''' The drop-down menu where you assign the physical bus.
<code>
This area represents the buses defined in the signal reader assignment. These are the ''logical'' buses that need to be linked to ''physical'' buses.
[GLOBAL_CAN_API_MODULE_0]<br>
----
default_period=10<br>
description_date_time=<br>
description_file=<br>
direction=IN<br>
io=CAN1<br>
name=CAN_HS<br>
</code>
===CAN buses and names are equal===
=== Right Side – Physical Bus Selection ===
When the .haf file is parsed, the portal will try to match the extracted CAN bus references and its names with the enabled CAN buses and their names (See [[I/O_configurations]]) for each selected WCU. If the name for each referenced CAN bus matches the name in the WCU configuration the dialog shown in illustration "Mappings 2" will pop up. This dialog says that auto mapping is performed and that the mappings can be verified by clicking on the new button "Mappings", which appears above the upload file form.
On the '''right side''', under the '''WCU''' column, you select the '''physical bus'''.
When clicking on "Mappings" the window shown in illustration "Mappings 3" will open up. The left group shows the info extracted from the .haf file. This is channel, speed (baud rate) and the channel's name. The right group shows the config(s) for the WCU(s) this assignment will be uploaded to. As you can see in the illustration, the names (and speed) in the .haf file and from the WCU matches each other. This is why the auto mapping succeeded.
* The physical bus can belong to a '''WCU, WMU''' or a '''VCF''' channel.
* Selecting the correct WCU ensures that signals are properly routed to the physical communication hardware.
* The syntax for a physical bus is: '''BUSIO:Speed:Name''' (for example: CAN1:500:CAN1).
If you want to change the mappings, for example switch CAN3 in the .haf file to CAN6 in the WCU, you have the option to do it here. Select the bus you want to change to, as illustrated in "Mappings 4", and click "Save". If you change your mind, just click "Cancel" to return to the New task window.
----
===CAN names are equal but for different buses===
=== Automatic Mapping ===
[[File:Mappings5.png|thumb|200px|frame|Mappings 5: CAN6 to CAN3]]
The system performs '''auto-mapping''' automatically when the window is opened or refreshed.
In the example in "Mappings 4" CAN1(=CAN_HS) in .haf file perfectly matches CAN1(=CAN_HS) in the WCU configuration.
There exists cases though when one CAN bus is disconnected and another CAN bus is connected in its place on the WCU. In this case, the .haf file needs to be rewritten since referenced CANX is connected to CANY on the WCU. If the name of CANY on the WCU matches the name of CANX in the .haf-file, a automated mapping between X and Y will be created. The illustration "Mappings 5" shows an example when the .haf file has references to CAN1,2,3 but only CAN1,2 and 6 is enabled in the WCU configuration. The name of CAN3 in the .haf-file matches the name of CAN6 in the WCU configuration, so in this case CAN3 will be replaced by CAN6 when the .haf file is uploaded to the WCU.
Like for the previous example you can always choose to change the automated mappings if you for example now that you have made a mistake when you named the CAN buses inte .haf file or in the WCU configuration.
Auto-mapping works as follows:
==Auto mapping fails==
# '''Name Matching:''' The tool first tries to match logical and physical buses based on their names.
[[File:Mappings6.png|thumb|200px|frame|Mappings 6: Auto mapping failed]]
# '''Bus Number Matching:''' If names don’t match, it attempts to match based on bus numbers.
[[File:Mappings7.png|thumb|200px|frame|Mappings 7: Review auto mapping failed]]
# '''Speed Requirement:''' The mapping only succeeds if the '''bus speeds''' are identical.
[[File:Mappings8.png|thumb|200px|frame|Mappings 8: CAN speed differs warning]]
[[File:Mappings9.png|thumb|200px|frame|Mappings 9: CAN speed differs]]
This section describes cases when the auto mapping fails.
===CAN name not found===
If a match cannot be made, or if an error occurs, a '''red triangle''' appears next to the affected bus.
In the examples in the previous section the CAN bus names in the .haf file are found in the WCU configuration for the selected WCU. If a file is uploaded were that is not the case, the warning dialog shown in illustration "Mappings 6" will pop up.
----
The dialog shows the reason(s) why the auto mapping failed and when one clicks "OK" the "Mappings" window will automatically be opened. This is illustrated in "Mappings 7" and here we can see that the name "CAN_Sens" was not found in the WCU configuration. By default nothing is changed so if you click "Save" here no new mapping will be created. But if you now that CAN3 should be mapped to CAN6 (like the previous example) you can create the new mapping and save it by clicking "Save".
===Name matches but speed differs===
=== Error and Warning Indicators ===
Since the speed of the CAN buses can differ the auto mapping can end up in the case when it founds a matching name in the .haf file and in the WCU configuration but the CAN speed differs. If this is the case, the warning shown in illustration "Mappings 8" will popup. When clicking "OK" the "Mappings" window will be visible and make it possible to either leave the file as it is (no mappings created) or create new mappings. The illustration "Mappings 9" shows the configuration which lead to the warning in "Mappings 8". In this case we have probably mixed up the names in the WCU configuration or when creating the .haf file.
A '''red triangle''' will appear in the following cases:
==Ignore==
* The '''bus speed''' does not match between logical and physical buses.
[[File:Mappings13.png|thumb|200px|frame|Mappings 13: Ignore different speed]]
* The selected '''physical bus''' has already been assigned elsewhere. Each physical bus can '''only be used once''' in the mapping.
A yellow triangle will appear in the following cases:
In addition to the available CAN buses for a WCU, you also have an option "Ignore" as you can see in illustration "Mappings 4". When selecting this option, nothing is changed in the .haf file but the choice is stored in the database and listed in the mappings for each WCU and assignment when clicking "View Assignment" for a SignalReader assignment in SearchPanel.
A use case for ignore is when you have set the wrong bus speed in the I/O configurations for CAN bus X and also need to remap another can bus Y. In this case, the Mappings window will not let you store the new mappings for Y, since the speed of X differs in the haf file and inte WCU configuration. Setting X to "Ignore" will act as a workaround for this.
* No physical bus is selected
Illustration "Mappings 13" shows an example of where have, by mistake, set the speed of CAN2 to 500 but the CAN2 in the .haf file has the speed 125. We also need to remap CAN1 to CAN3 and CAN3 to CAN1. In this case we can't save the new mappings since CAN2's speed differs. Setting CAN2 to "Ignore" as in illustration "Mappings 14" fixes this case.
==Grouping of WCUs==
[[File:Mappings10.png|thumb|200px|frame|Mappings 10: Grouping of WCUs]]
[[File:Mappings11.png|thumb|200px|frame|Mappings 11: Map single WCUs in resource group]]
The examples above only consists of assignments for one single WCU. Normally assignments are uploaded to multiple WCUs or resource groups consisting of multiple WCUs. Since WCUs have their individual configuration (especially when they not belong to a resource group) each single WCU configuration is compared to the CAN references extracted from the uploaded .haf file. If a WCU's IO configuration is equal to another WCU's configuration these two WCU's are grouped together in the "Mappings" window. Any new mappings made for this group will be applied to all WCUs which are included in the group. An example of this can be seen in illustration "Mappings 10" where two WCUs are selected but they are grouped in to one group in the "Mappings" window.
In the case when a resource group consisting of two or more WCUs are selected but the I/O configurations of the WCUs differs, these WCUs will show up in single groups in the "Mappings" window. An example of this is shown in "Mappings 11" where the resource group "IO_TEST" is selected consisting of two WCUs with different I/O configurations.
----
==The .haf file uploaded to the WCU==
=== Grouping Option ===
[[File:Mappings12.png|thumb|200px|frame|Mappings 12: Mappings for a submitted assignment]]
In the '''top-right corner''', there is an option to choose whether '''WCUs should be grouped'''.
Even if it is only possible to upload one .haf file to the portal when creating a new SignalReader assignment, the file uploaded to the WCUs may differ if individual mappings for the selected WCUs are applied. In the example we had in [[#CAN names are equal but for different buses]] where CAN3 is mapped to CAN6 the .haf file for this WCU will have all occurrences of CAN3 replaced by CAN6.
The portal has a feature to view the assignment after the assignment was uploaded to the WCU (Search tab and then click "View Assignment"). In this window it is possible to download the assignment by clicking "Download assignment". What is important here is that the file which is downloaded is the original .haf file which was uploaded by the task creator. It is not a copy of the file that was uploaded to the specific WCU. Therefore any new mappings are not visible in the downloaded haf file (e.g. CAN3 is not replaced by CAN6), instead any potential mappings for the actual WCU and assignment are displayed in a table in the "View Assignment" window. The illustration "Mappings 12" shows an example of this (where CAN3 is replaced by CAN4).
When grouping is enabled, the system will automatically match WCUs that have:
* The same number of channels,
* The same I/O numbering, and
* The same communication speed.
When groups are created, an '''eye icon''' 👁️ and a '''number''' appear next to the group name.
* Clicking the '''eye icon''' or the '''number''' displays a list of all WCUs included in that group.
* The number indicates how many WCUs are currently part of the group.
This grouping feature helps simplify configuration when working with multiple identical WCUs.
----
=== Buttons ===
At the bottom of the window:
* '''Save:''' Confirms and saves all mappings.
* '''Restore:''' Resets everything to the ''auto-mapped'' state. (Auto-mapping is always performed first when the window opens.)
* '''Close:''' Exits the window without saving changes.
The Mappings for this task window is used to configure the connections between logical communication channels (from a signal reader assignment) and the physical buses used in the system. It displays both CAN and LIN channels and allows you to assign them to specific physical buses (WCU/WMU or VCF).
Left Side – Logical Channels
On the left side of each group, you can see the logical configuration:
Channel: The CAN or LIN bus identifier (e.g., CAN1, LIN1).
Speed: The communication speed of the bus (e.g., 500 kbit/s for CAN, 9600 bit/s for LIN).
Name: The assigned name of the channel.
#Signals: Number of signals currently mapped to that bus.
WCU: The drop-down menu where you assign the physical bus.
This area represents the buses defined in the signal reader assignment. These are the logical buses that need to be linked to physical buses.
Right Side – Physical Bus Selection
On the right side, under the WCU column, you select the physical bus.
The physical bus can belong to a WCU, WMU or a VCF channel.
Selecting the correct WCU ensures that signals are properly routed to the physical communication hardware.
The syntax for a physical bus is: BUSIO:Speed:Name (for example: CAN1:500:CAN1).
Automatic Mapping
The system performs auto-mapping automatically when the window is opened or refreshed.
Auto-mapping works as follows:
Name Matching: The tool first tries to match logical and physical buses based on their names.
Bus Number Matching: If names don’t match, it attempts to match based on bus numbers.
Speed Requirement: The mapping only succeeds if the bus speeds are identical.
If a match cannot be made, or if an error occurs, a red triangle appears next to the affected bus.
Error and Warning Indicators
A red triangle will appear in the following cases:
The bus speed does not match between logical and physical buses.
The selected physical bus has already been assigned elsewhere. Each physical bus can only be used once in the mapping.
A yellow triangle will appear in the following cases:
No physical bus is selected
Grouping Option
In the top-right corner, there is an option to choose whether WCUs should be grouped.
When grouping is enabled, the system will automatically match WCUs that have:
The same number of channels,
The same I/O numbering, and
The same communication speed.
When groups are created, an eye icon 👁️ and a number appear next to the group name.
Clicking the eye icon or the number displays a list of all WCUs included in that group.
The number indicates how many WCUs are currently part of the group.
This grouping feature helps simplify configuration when working with multiple identical WCUs.
Buttons
At the bottom of the window:
Save: Confirms and saves all mappings.
Restore: Resets everything to the auto-mapped state. (Auto-mapping is always performed first when the window opens.)