Skip to content

Commit 23445e0

Browse files
bmenne-dspaceBenedikt Menneklausschuch
authored
Add configuration parameters to Bus Terminal definition (low-cut) (#221)
* Add configuration parameters to Bus Terminal definition (low-cut) and use it within CAN and FlexRay --------- Co-authored-by: Benedikt Menne <[email protected]> Co-authored-by: Klaus Schuch <[email protected]>
1 parent be9e71a commit 23445e0

File tree

6 files changed

+146
-106
lines changed

6 files changed

+146
-106
lines changed

docs/3____physical_signal_abstraction.adoc

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,16 @@ This section defines terminals for physical signal abstraction or "high cut".
6969

7070
==== Bus Terminal [[high-cut-bus-terminal,Bus Terminal]]
7171
Each network connected to the FMU must be described in `icons/terminalsAndIcons.xml` as a `<Terminal>` element of `<fmiTerminalsAndIcons><Terminals>` that wraps all <<high-cut-frame-terminal,frame terminals>>.
72-
The attribute `name` of the `<Terminal>` must match the root name of its <<high-cut-network-description-files>> if it exists
72+
The attribute `name` of the `<Terminal>` element must match the root name of its <<high-cut-network-description-files>> if it exists
7373
_[e.g., `Powertrain`, if the file is `/extra/org.fmi-standard.fmi-ls-bus/Powertrain.dbc`]_.
74-
In any case, the attribute `name` of the `<Terminal>` must be consistent with the `BusName` component of all its corresponding signal, frame and Clock variables.
74+
In any case, the attribute `name` of the `<Terminal>` element must be consistent with the `BusName` component of all its corresponding signal, frame and Clock variables.
7575

7676
Attribute definitions::
7777
* `terminalKind` must be `org.fmi-ls-bus.network-terminal`.
7878
* `matchingRule` must be `bus`.
7979
* `name` is the network name, e.g., `Powertrain`, see <<high-cut-example, example>> and constraints above.
8080

8181
Element definitions::
82-
* There must be no `<TerminalStreamMemberVariable>` element.
8382
* There must be one `<Terminal>` element per network frame described in the <<high-cut-network-description-files>>, if their signal and Clock variables are present in the `modelDescription.xml`.
8483

8584
Annotation element::
@@ -97,7 +96,6 @@ Attribute definitions::
9796
* `name` must match the frame name as defined in the <<high-cut-network-description-files>> in `/extra/org.fmi-standard.fmi-ls-bus`.
9897

9998
Element definitions::
100-
* There must be no `<TerminalStreamMemberVariable>` element.
10199
* There must be one <<high-cut-pdu-terminal>> element per PDU of this frame.
102100
* There must be one `<TerminalMemberVariable>` for the Clock this frame is connected to.
103101
The `memberName` of this variable must be `TransmissionClock`.
@@ -114,8 +112,6 @@ Attribute definitions::
114112
For network types not natively referencing a "PDU", like CAN, a synthetic PDU with the same name as its frame is inserted.
115113

116114
Element definitions::
117-
* There must be no `<TerminalStreamMemberVariable>` element.
118-
* There must be no `<Terminal>` element.
119115
* There must be one `<TerminalMemberVariable>` per <<high-cut-terminal-member-variable-for-signals,signal>> of this PDU.
120116

121117
All <<high-cut-terminal-member-variable-for-signals,`TerminalMemberVariables`>> must have the same `causality` of either `input` or `output`.
@@ -169,7 +165,7 @@ The `modelDescription.xml` excerpt listed below shows which variables would exis
169165
include::examples/X_network4FMI_modelDescription_highCut.xml[]
170166
----
171167

172-
The following file shows the `<Terminal>` definition representing the network and frame structure defined with `Powertrain.dbc` above.
168+
The following file shows the <<high-cut-bus-terminal,Bus Terminal>> definition representing the network and frame structure defined with `Powertrain.dbc` above.
173169

174170
.Example terminalsAndIcons.xml file.
175171
[#terminalsAndIconHighCut.xml]

docs/4_4_1_can.adoc

Lines changed: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ The ID must be considered here as a purely numerical value.
169169
This means that there is no need for separate segmentation between the 11-bit base CAN identifier and an 18-bit CAN identifier extension information that is known from the CAN protocol.
170170
Additional information such as Ide is also not part of the ID, but is treated separately.
171171
| Ide | 1 byte | Specified whether the ID should be transmitted as standard (11-bit) or extended (29-bit) message identifier.
172-
For specification the boolean values `TRUE` and `FALSE` (see <<table-boolean-value-kinds>>) shall be used.
172+
For specification the boolean values `TRUE` and `FALSE` (see <<table-boolean-value-kinds>>) shall be used.
173173
| Rtr | 1 byte | Specifies whether the given frame represents a Remote Transmission Request frame.
174174
For specification the boolean values `TRUE` and `FALSE` (see <<table-boolean-value-kinds>>) shall be used.
175175
| Data Length | 2 byte | Specifies the length of the Data argument in bytes.
@@ -180,7 +180,7 @@ h|Behavior
180180
3+|The <<low-cut-can-transmit-operation, `CAN Transmit`>> operation shall be provided by Network FMUs to initiate the transmission of a CAN frame.
181181
In case of directly connected Network FMUs (see <<common-concepts-direct-communication>>), the FMU importer forwards the operation directly to the receiving Network FMUs.
182182
If a Bus Simulation is involved (see <<common-concepts-composition-with-dedicated-bus-simulation-fmu>> and <<common-concepts-importer-with-integrated-bus-simulation>>), the FMU importer forwards the operation initially to the Bus Simulation, where the operation is distributed with respect to the simulated bus behavior.
183-
Depending on the simulation details, the Bus Simulation might response with a <<low-cut-can-confirm-operation, `Confirm`>>, <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>>, <<low-cut-can-bus-error-operation, `Bus Error`>> or <<low-cut-can-format-error-operation, `Format Error`>> operation.
183+
Depending on the simulation details, the Bus Simulation might respond with a <<low-cut-can-confirm-operation, `Confirm`>>, <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>>, <<low-cut-can-bus-error-operation, `Bus Error`>> or <<low-cut-can-format-error-operation, `Format Error`>> operation.
184184
Depending on the <<low-cut-can-status-operation, status>> of the specified Network FMU further restrictions for <<low-cut-can-transmit-operation, `CAN Transmit`>> operations <<table-can-status-values, exist>>.
185185

186186
|====
@@ -274,9 +274,9 @@ The following applies for this operation: `Length = 12`.
274274
|The ID of the confirmed CAN message.
275275

276276
h|Behavior
277-
3+|The specified operation shall be produced by the Bus Simulation and consumed by Network FMUs.
278-
If the structural parameter <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> of a Network FMU is set to `false`, the Network FMU does not wait for any responses from a Bus Simulation, i.e., potentially received <<low-cut-can-confirm-operation, `Confirm`>> operations are discarded by the Network FMU.
279-
Depending on the <<low-cut-can-status-operation, status>> of the specified Network FMU further restrictions for <<low-cut-can-confirm-operation, `Confirm`>> operations <<table-can-status-values, exist>>.
277+
3+|This operation shall be produced by the Bus Simulation and consumed by Network FMUs. +
278+
Only Network FMUs with the corresponding optionally exposed <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter set to `fmi3True` might wait for this operation.
279+
Depending on the <<low-cut-can-status-operation, status>> of the receiving Network FMU further restrictions for <<low-cut-can-confirm-operation, `Confirm`>> operations <<table-can-status-values, exist>>.
280280

281281
|====
282282

@@ -316,8 +316,8 @@ h|Behavior
316316
3+|During simulation, several <<low-cut-can-transmit-operation, `Transmit`>> operations can be sent by Network FMUs to a Bus Simulation at the same time.
317317
In such case, the Bus Simulation has to decide which <<low-cut-can-transmit-operation, `Transmit`>> operation should be processed first.
318318
Depending on the configuration (see the `Arbitration Lost Behavior` argument of the <<low-cut-can-configuration-operation, `Configuration`>> operation), the deferred <<low-cut-can-transmit-operation, `Transmit`>> operations shall either be buffered or they shall be discarded and the <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operation shall be sent back to the respective Network FMUs.
319-
A Network FMU receiving the <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operation can decide to provide the <<low-cut-can-transmit-operation, `Transmit`>> operation again or e.g., to raise an internal transmit timeout failure after a while.
320-
If the structural parameter <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> of a Network FMU is set to `false`, the Network FMU does not wait for any responses from a Bus Simulation, i.e., potentially received <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operations are discarded by the Network FMU.
319+
A Network FMU receiving the <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operation can decide to provide the <<low-cut-can-transmit-operation, `Transmit`>> operation again or e.g., to raise an internal transmit timeout failure after a while. +
320+
Only Network FMUs with the corresponding optionally exposed <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter set to `fmi3True` might wait for this operation and respond accordingly.
321321

322322
|====
323323

@@ -363,14 +363,15 @@ For specification the boolean values `PRIMARY_ERROR_FLAG` and `SECONDARY_ERROR_F
363363
For specification the boolean values `TRUE` and `FALSE` (see <<table-boolean-value-kinds>>) shall be used.
364364

365365
h|Behavior
366-
3+|While transmitting CAN frames, various kinds of bus error may happen.
366+
3+|When transmitting CAN frames, various kinds of bus error may happen.
367367
A Bus Simulation can simulate such errors by providing <<low-cut-can-bus-error-operation, `Bus Error`>> operations to the Network FMUs.
368368
Based on consumed <<low-cut-can-bus-error-operation, `Bus Error`>> operations, Network FMUs shall maintain an internal CAN node state (see <<low-cut-can-error-handling>>).
369369
To determine the CAN node state properly, Network FMUs need the information about their role at the time when the simulated error happened.
370370
For a Network FMU that initiated the <<low-cut-can-transmit-operation, `Transmit`>> operation, the argument `Is Sender` shall be set to `TRUE` in the corresponding <<low-cut-can-bus-error-operation, `Bus Error`>> operation.
371371
For a Network FMU considered to be the one detecting the error first, the argument `Error Flag = PRIMARY_ERROR_FLAG` shall be set.
372-
The arguments `Is Sender = TRUE` and `Error Flag = PRIMARY_ERROR_FLAG` must only be set once per simulated error.
373-
If the structural parameter <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> of a Network FMU is set to `false`, the Network FMU does not wait for any responses from a Bus Simulation, i.e., potentially received <<low-cut-can-bus-error-operation, `Bus Error`>> operations are discarded by the Network FMU.
372+
The arguments `Is Sender = TRUE` and `Error Flag = PRIMARY_ERROR_FLAG` must only be set once per simulated error. +
373+
Only Network FMUs with the corresponding optionally exposed <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter set to `fmi3True` might wait for this operation and respond accordingly.
374+
374375
|====
375376

376377
The following Error Codes are specified:
@@ -613,35 +614,45 @@ If a Network FMU does not support wake up, this operation can be ignored on the
613614
|====
614615

615616
===== Network Parameters [[low-cut-can-network-parameters]]
616-
Using structural parameters, FMUs can be parameterized according to importer specifications.
617-
This chapter specifies the structural parameters that each CAN-specific Network FMU shall provide.
617+
This chapter defines parameters that Network FMU might provide to configure CAN-specific behavior.
618618

619619
====== Bus Notification Parameter [[low-cut-can-bus-notification-parameter]]
620620
For a detailed simulation, the CAN bus behavior regarding acknowledgment, bus errors and arbitration losses must be considered.
621621
A Bus Simulation can simulate these effects by sending bus notifications in terms of <<low-cut-can-confirm-operation, `Confirm-`>>, <<low-cut-can-bus-error-operation, `Bus Error-`>> and <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operations to the Network FMUs.
622622

623623
However, in scenarios where Network FMUs are connected directly to each other, or where the Bus Simulation does not simulate such effects, it must be possible to configure the Network FMU such that it does not wait for any response after a <<low-cut-can-transmit-operation, `Transmit`>> operation.
624-
Therefore, the <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> parameter is introduced.
625-
If the value of the parameter is set to `false`, the Network FMU must not wait for any response after a <<low-cut-can-transmit-operation, `Transmit`>> operation ("fire-and-forget").
626-
The default value shall be `false` to allow the Network FMU to be run natively in each simulation scenario.
627-
If the Network FMU shall be configured to handle responses in the form of <<low-cut-can-confirm-operation, `Confirm-`>>, <<low-cut-can-bus-error-operation, `Bus Error-`>> and <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operations, the <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> parameter shall be set to `true`. +
628-
_[This does not necessarily mean the FMU must fully support CAN error handling or sophisticated arbitration mechanisms._
629-
_A simple Network FMU might also choose to treat Bus Error or Arbitration operations in a simplified manner, e.g., by treating them as a positive confirmation.]_
630-
631-
.FMU parameter for the configuration of bus notifications.
632-
[[figure-fmu-bus-notifications-parameter]]
624+
Therefore, a parameter with `memberName = "BusNotifications"` can be added within the CAN-specific <<low-cut-configuration-terminal,Configuration Terminal>>. +
625+
If a Network FMU supports bus notifications, the <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter shall be exposed.
626+
The default value of this parameter shall be `false`. +
627+
_[The default value `false` allows a simple integration of Network FMUs to simulation scenarios where <<low-cut-can-confirm-operation, `Confirm-`>>, <<low-cut-can-bus-error-operation, `Bus Error-`>> or <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operations are not used.]_
628+
629+
Only Network FMUs with the corresponding optionally exposed <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter set to `fmi3True` might wait for <<low-cut-can-confirm-operation, `Confirm-`>>, <<low-cut-can-bus-error-operation, `Bus Error-`>> and <<low-cut-can-arbitration-lost-operation, `Arbitration Lost`>> operations and respond accordingly; otherwise Network FMUs must not wait ("fire-and-forget").
630+
Even if the Network FMU does not expect bus notifications, i.e. <<low-cut-can-bus-notification-parameter, `BusNotifications`>> variable was not set to `fmi3True`, but receives them, it shall ignore them, i.e. it shall not report warnings or errors.
631+
632+
_[Note that the bus notification parameter just informs the Network FMU if it can expect to receive notification operations or not.
633+
The parameter doesn't define in any way on how to react upon receiving notification operations.]_
634+
635+
.Parameter to configure bus notifications within a CAN Bus Terminal of Network FMUs.
636+
[[figure-fmu--can-bus-notifications-parameter]]
633637
----
634-
org.fmi_standard.fmi_ls_bus.Can_BusNotifications
635-
Description: "Specifies whether the respective Network FMU can rely on a Confirm,
636-
Bus Error or Arbitration Lost operation after sending a message."
637-
Type: Boolean
638-
Causality: structuralParameter
639-
Variability: fixed
640-
Start: "false"
638+
memberName: BusNotifications
639+
type: Boolean
640+
causality: parameter
641+
variability: fixed
642+
start: false
641643
----
642644

643-
This structural parameter is mandatory for Network FMUs only.
644-
A Bus Simulation (FMU) does not require this structural parameter.
645+
A Bus Simulation FMU shall indicate via a variable with `memberName = "BusNotifications"` within the CAN-specific <<low-cut-configuration-terminal,Configuration Terminal>> whether it provides bus notifications or not.
646+
If the provision of bus notifications can be configured (e.g., via a structural parameter), the attributes of the <<low-cut-can-bus-notification-parameter, `BusNotifications`>> variable shall contain `causality = "calculatedParameter"` and `variability = "fixed"`; or `causality = "output"` and `variability = "constant"` otherwise.
647+
648+
.Parameter to configure bus notifications within a CAN Bus Terminal of the Bus Simulation.
649+
[[figure-fmu-can-bus-notifications-parameter-in-bus-simulation]]
650+
----
651+
memberName: BusNotifications
652+
type: Boolean
653+
causality: calculatedParameter/output
654+
variability: fixed/constant
655+
----
645656

646657
===== Configuration of Bus Simulation [[low-cut-can-configuration-of-bus-simulation]]
647658
The configuration of the Bus Simulation is done by the Network FMUs itself.
@@ -666,11 +677,11 @@ The <<low-cut-can-transmit-operation, `Transmit`>> operation represents the send
666677
With appropriate options, relevant functionalities can be configured and used on a network abstraction level (e.g., Virtual CAN network ID for CAN XL or Bit Rate Switch for CAN FD).
667678
In the real world, flawlessly transmitted CAN frames will be acknowledged by at least one receiver CAN node.
668679
To simulate this behavior, the <<low-cut-can-confirm-operation, `Confirm`>> operations are introduced.
669-
In addition, the structural parameter <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> is defined to support lightweight bus simulations and <<common-concepts-direct-communication, directly connected Network FMUs>>.
680+
In addition, the <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter is defined to support lightweight bus simulations and <<common-concepts-direct-communication, directly connected Network FMUs>>.
670681

671-
If <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> is set to `false` (default), then Network FMUs must not rely on receiving <<low-cut-can-confirm-operation, `Confirm`>> operations.
682+
If <<low-cut-can-bus-notification-parameter, `BusNotifications`>> is `false` (default), then Network FMUs must not rely on receiving <<low-cut-can-confirm-operation, `Confirm`>> operations for the specified Bus Terminal.
672683
In this case, the bus simulation is idealized and takes place in a "fire-and-forget" manner.
673-
If a specified Network FMU is depending on <<low-cut-can-confirm-operation, `Confirm`>> operations and <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> is set to `false`, the self confirmation shall be realized internally within the respective Network FMU.
684+
If a specified Network FMU is depending on <<low-cut-can-confirm-operation, `Confirm`>> operations and <<low-cut-can-bus-notification-parameter, `BusNotifications`>> is `false`, the self confirmation shall be realized internally within the respective Network FMU for the specified Bus Terminal.
674685

675686
<<#figure-can-direct-communication>> illustrates this communication, whereby FMU 1 transmits network data to FMU 2.
676687
Subsequently, FMU 1 self-confirms the transmission internally.
@@ -680,7 +691,7 @@ Subsequently, FMU 1 self-confirms the transmission internally.
680691
image::can_direct_confirmation.svg[width=40%, align="center"]
681692

682693
For a detailed simulation, the Bus Simulation has to support <<low-cut-can-confirm-operation, `Confirm`>> operations.
683-
In this case, the <<low-cut-can-bus-notification-parameter, `org.fmi_standard.fmi_ls_bus.Can_BusNotifications`>> parameter of the Network FMUs can be set to `true` as Network FMUs can rely on receiving <<low-cut-can-confirm-operation, `Confirm`>> operations.
694+
In this case, the <<low-cut-can-bus-notification-parameter, `BusNotifications`>> parameter of the Network FMUs can be set to `fmi3True` as Network FMUs can rely on receiving <<low-cut-can-confirm-operation, `Confirm`>> operations for the specified Bus Terminal.
684695

685696
The following <<#figure-can-confirmation-with-bus-simulation-fmu>> illustrates the behavior, whereby FMU 1 transmits network data to FMU 2 via a Bus Simulation.
686697

0 commit comments

Comments
 (0)