Direct-mode CAN-S to CAN-P direction
This section describes direct-mode in the CAN-S to CAN-P direction.
Below figure illustrates the configurable elements relevant for the routing of messages from CAN-S to CAN-P in direct-mode. The physical configurations of CAN-P and CAN-S are done in their respective configuration sections.
Note
Note that the CAN-S physical filters (configured in the CAN-S sections) control which messages are forwarded from CAN-S to CAN-P.
This section describes the configuration of direct-mode in the CAN-S to CAN-P direction (Direct-mode S-to-P
in below figure).
Configuration file fields (only CAN-S1 displayed)
This section is autogenerated from the Rule Schema file.
Mappings phy.can.route.direct.s2p.can_s1.map
Type |
Min items |
Max items |
---|---|---|
array |
0 |
16 |
Item phy.can.route.direct.s2p.can_s1.map.item
From (S) phy.can.route.direct.s2p.can_s1.map.item.from
ID format phy.can.route.direct.s2p.can_s1.map.item.from.id_format
Message identifier format.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Standard (11-bit): |
ID (HEX) phy.can.route.direct.s2p.can_s1.map.item.from.f1
Message dentifier value.
Type |
Default |
---|---|
string |
0 |
ID mask (HEX) phy.can.route.direct.s2p.can_s1.map.item.from.f2
Message identifier mask.
Type |
Default |
---|---|
string |
7FF |
To (P) phy.can.route.direct.s2p.can_s1.map.item.to
ID format phy.can.route.direct.s2p.can_s1.map.item.to.id_format
Message identifier format.
Type |
Default |
Options |
---|---|---|
integer |
0 |
Standard (11-bit): |
ID (HEX) phy.can.route.direct.s2p.can_s1.map.item.to.f1
Message identifier value.
Type |
Default |
---|---|
string |
0 |
Configuration explained
In below the configuration is explained in detail.
Map
The messages accepted by the CAN-S filters are forwarded to CAN-P. To avoid potential ID duplication, it is optionally possible to ID re-map specific message IDs.
For each CAN-S, a list of 16 CAN-S to CAN-P ID mappings can be configured. When a message is received on a specific CAN-S, the ID is compared to the associated mapping list. If a match is found, the ID is changed before it is forwarded to CAN-P. If no ID match is found, the message is forwarded directly.
Note
If multiple mapping entries match the first mapping entry is used.
Examples
Example: The CANmod.router CAN-S1 to CAN-S4 are connected to four buses. For each bus, the CAN-S filters are configured to forward standard ID 1 and extended ID 2 to CAN-P. To avoid ID duplication (i.e. confusion), mapping lists are configured for each CAN-S, such that the IDs do not overlap on CAN-P.
Below demonstrates how the two IDs can be mapped to unique IDs on CAN-P.
Note
Notice how the mask is set to consider all bits (i.e. exact ID match) for both the standard (11-bit) and the extended (29-bit) IDs.
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Standard |
1 |
7FF |
Standard |
11 |
2 |
Extended |
2 |
1FFFFFFF |
Extended |
12 |
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Standard |
1 |
7FF |
Standard |
21 |
2 |
Extended |
2 |
1FFFFFFF |
Extended |
22 |
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Standard |
1 |
7FF |
Standard |
31 |
2 |
Extended |
2 |
1FFFFFFF |
Extended |
32 |
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Standard |
1 |
7FF |
Standard |
41 |
2 |
Extended |
2 |
1FFFFFFF |
Extended |
42 |
Example: The CANmod.router CAN-S1 and CAN-S2 are connected to two buses running J1939. The CAN-S filters are configured to forward message with PGN 61444 (EEC1). The priority and source address of the messages are unknown. To avoid confusion between the two PGNs on CAN-P, a ID mapping entry is created for both CAN-S1 and CAN-S2 to map the messages with PGN 61444 to specific new IDs (EEC101 and EEC102 respectively). To ensure that the mapping is triggered regardless of message priority and source address, a ID-mask is applied (matching only on 18 of the 29 bits).
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Extended |
EEC100 |
3FFFF00 |
Extended |
EEC101 |
\ |
From |
To |
|||
---|---|---|---|---|---|
# |
ID-format |
ID-value |
ID-mask |
ID-format |
ID-value |
1 |
Extended |
EEC100 |
3FFFF00 |
Extended |
EEC102 |