The BDiag component is used to give the functionality known from the BSK diagnostics. It creates and checks telegram headers and checksums. Numbering of positions starts with 1, values ≤ 0 mean that the corresponding parameter is not present in the header. Exceptions from this rule are ECUAddressPos and LengthAddressPos, see below.
0x0000000FUL | SpecialModeMask | these bits are reserved for modes which require special treatment of the header (e.g. KWP 2000). |
0x00000030UL | BroadcastModeMask | these bits are reserved for broadcast modes. |
0x00000040UL | ExcludeFrameLengthMask | this bit is used for the calculation of the length information in the header. |
0x00000040UL | ExcludeFrameLength | when set indicates, that the length of the frame is excluded from the calculation of the telegram length. |
0x00000000UL | SpecialModeNone | There is no special treatment. |
0x00000001UL | SpecialModeKWP2000COM | KWP2000 headers are used as defined in ISO 14230. |
0x00000002UL | SpecialModeKWP2000CAN | KWP2000 over CAN is used. (2 byte header with 12 bit length info). |
0x00000003UL | SpecialModeDS2 | The ECU ID is generated as described in DS2 documentation (currently unimplemented). |
0x00000000UL | BroadcastModeNone | No broadcast mode. |
0x00000010UL | BroadcastModeOne | Indicates that all ECU addresses in answers are accepted when the event is sent to the ECU address given in ECUBroadcastAddress. |
0x00000020UL | BroadcastModeAll | Indicates that always all ECU addresses in answers are accepted. |
telegram length (excluding header and checksum) + LengthOffset = length information in the telegramIf ExcludeFrameLength in the HeaderFlags is not set:
telegram length (including header and checksum) + LengthOffset = length information in the telegram
0x00000001UL | KWP2000KeyBytesAL0 | length information in format byte supported |
0x00000002UL | KWP2000KeyBytesAL1 | additional length byte supported |
0x00000004UL | KWP2000KeyBytesHB0 | 1 byte header supported |
0x00000008UL | KWP2000KeyBytesHB1 | Target/Source address in header supported |
0x00000010UL | KWP2000KeyBytesTP0 | extended timing parameter set |
0x00000020UL | KWP2000KeyBytesTP1 | normal timing parameter set |
0x0000003FUL | KWP2000KeyBytesMask |
0x00000000UL | No echo is expected. | |
0x00000001UL | EchoSuppressOn | An echo is expected and suppressed. |
0x00000000UL | No other telegrams are expected. A telegram, which doesn't fit to the request is considered as an error. It may trigger a retry, depending on the settings of other parameters. | |
0x00000001UL | BusModeOn | All telegrams, which don't fit to the request are considered as other communication on the bus and are discarded. The component waits further until an answer arrives, which does fit to the request or a timeout occurs. |
0x00000001UL | ControlByteEqual | The control byte in the answer should be the same as in the request. |
0x00000002UL | ControlByteNot | All bits of the answer control byte inverted as compared to the request are interpreted as a Negative Response. |
0x00000004UL | ControlByteAny | Any control byte is accepted in the answer. |
0x00000020UL | ControlByteXor20 | The expected answer control byte is derived by an XOR with $20 from the main mode. |
0x00000040UL | ControlByteXor40 | The expected answer control byte is derived by an XOR with $40 from the main mode. |
Bit(s) | Mask/Value | Name | Description |
31 | 0x80000000UL | ControlByteFixActive | When this flag is set this parameter entry is activated, otherwise the parameter is ignored. |
30 | 0x40000000UL | ControlByteFixRequest | When this flag is set this parameter entry refers
to the control byte in the request, otherwise to the one in
the answer. Only the ControlByteFixTOExtend flag and bits in the ControlByteFixMultRespMask can combined with the ControlByteFixRequest flag. |
29 | 0x20000000UL | ControlByteFixSubCodeActive | When this flag is set the subcode of the reply
is evaluated together with the control byte (both have to match),
otherwise just the control byte. The subcode byte is the last
byte of data (before the checksum). This flag can not be set together with the ControlByteFixRequest flag. |
28..16 | 0x1FFF0000UL | ControlByteFixCodes | This mask can be used to get just the flags part for the actions out of the complete dword parameter. |
28 | 0x10000000UL | - | n. u. |
27 | 0x08000000UL | ControlByteFixAbort | The tester should abort further retries or waiting
for answers. This flag can not be used together with the settings ControlByteFixRetryNormal, ControlByteFixRetryDelayed, or ControlByteFixWaitAgain. |
26 | 0x04000000UL | ControlByteFixTOExtend | If this flag is set, the tester should wait for the ExtendedAnswerTimeout, otherwise for the normal AnswerTimeout. |
25..24 | 0x03000000UL | ControlByteFixRepeatMask | These bits are used to specify, which action should be taken after the expected answer has arrived. They are only evaluated if exactly 1 answer is expected (ExpectedAnswers = 1, or temporary overwritten by a request with ControlByteFixMultRespMask leading to a value of 1). The possible values are ControlByteFixOneAnswer, ControlByteFixRetryNormal, ControlByteFixRetryDelayed, and ControlByteFixWaitAgain. |
25..24 | 0x00000000UL | ControlByteFixOneAnswer | The expected answer arrived, no further retries or waiting. |
25..24 | 0x01000000UL | ControlByteFixRetryNormal | The tester should retry with a new request in compliance with the normal timing (Idle Time is evaluated). |
25..24 | 0x02000000UL | ControlByteFixRetryDelayed | The tester should retry with a new request after the RepeatDelayTime. |
25..24 | 0x03000000UL | ControlByteFixWaitAgain | The tester should wait again, without sending a new request. |
23 | 0x00800000UL | - | n. u. |
22 | 0x00400000UL | ControlByteFixNegResp | Negative response, e.g. Not Acknowledge. The AIDA_nNegativeResponse flag is set in the member dwFlags of the AIDA_tstEvent structure. |
21 | 0x00200000UL | ControlByteFixBusy | ECU is busy. Reserved for future use. |
20 | 0x00100000UL | ControlByteFixError | Error during execution in the ECU. Reserved for future use. |
19..17 | 0x000E0000UL | - | n. u. |
16 | 0x00010000UL | ControlByteFixAck | Acknowledge. |
15..8 | 0x0000FF00UL | ControlByteFixSubCodeMask | This can be used to get just the subcode to evaluate of the reply out of the dword. The subcode byte has to be entered into this part of the parameter. |
15..8 | 0x0000FF00UL | ControlByteFixMultRespMask | If the ControlByteFixRequest flag is
set, these bits can be used to change the number of expected
answers (Multiple Response Mode) for one fix control byte only.
The value in the ExpectedAnswers
parameter is temporary overwritten, if FixControlByteXX
& ControlByteFixMultRespMask <> 0. The
masked value is interpreted as a byte. After the request and
the answers have been processed, the ExpectedAnswers
parameter is reset to the value before the temporary change. The control bytes are evaluated after parameter attachments, so changes of the ExpectedAnswers parameter by means of temporary parameter attachments have no effect. |
7..0 | 0x000000FFUL | ControlByteFixMask | This can be used to get the control byte out of the dword. The control byte has to be entered into this part of the parameter. |
Examples:
0xA760787FUL | ControlByteFixActive ControlByteFixSubCodeActive ControlByteFixTOExtend ControlByteFixWaitAgain ControlByteFixNegResp ControlByteFixBusy |
A control byte of 0x7F together with a subcode of 0x78 is interpreted as a busy response from the ECU. The component waits for another response but with an ExtendedAnswerTimeout (KWP2000, 0x78=RCR-RP=reqCorrectlyRcvd-RspPending). |
0xA260217FUL | ControlByteFixActive ControlByteFixSubCodeActive ControlByteFixRetryDelayed ControlByteFixNegResp ControlByteFixBusy |
A control byte of 0x7F together with a subcode of 0x21 is interpreted as a busy response from the ECU. The component waits RepeatDelayTime until it resends the request and waits for a new response with AnswerTimeout (KWP2000, 0x21=B-RR=busy-repeatRequest). |
0xA260237FUL | ControlByteFixActive ControlByteFixSubCodeActive ControlByteFixRetryDelayed ControlByteFixNegResp ControlByteFixBusy |
A control byte of 0x7F together with a subcode of 0x23 is interpreted as a busy response from the ECU. The component waits RepeatDelayTime until it resends the request and waits for a new response with AnswerTimeout (KWP2000, 0x23=RNC=routineNotComplete). |
0x8840007FUL | ControlByteFixActive ControlByteFixAbort ControlByteFixNegResp |
A control byte of 0x7F is interpreted as a negative response (with no retry, KWP2000). Note that such an entry must be behind other entries with same control byte (e. g. for reqCorrectlyRcvd-RspPending), so in many KWP2000 stacks this is simply the last fix control byte entry. |
0x80400015UL | ControlByteFixActive ControlByteFixNegResp |
A control byte of 0x15 is interpreted as a negative response from the ECU (BSKD protocol, 0x15=ASCII NAK). |
0xC4000012UL | ControlByteFixActive ControlByteFixRequest ControlByteFixTOExtend |
A control byte of 0x12 in the request leads to an ExtendedAnswerTimeout for the response from the ECU. |
0xC0001400UL | ControlByteFixActive ControlByteFixRequest ControlByteFixMultRespMask |
A control byte of 0x00 in the request leads to a temporary value of 20 (0x14) for the ExpectedAnswers. |
AIDA Overview, list of AIDA components