バックナンバーはこちら。
https://www.simulationroom999.com/blog/diagnostic-communication-backnumber/
はじめに
ISO14229ことUDSの話。
PositiveResponseとNegativeResponseについて
登場人物
博識フクロウのフクさん

イラストACにて公開の「kino_k」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=iKciwKA9&area=1
エンジニア歴8年の太郎くん

イラストACにて公開の「しのみ」さんのイラストを使用しています。
https://www.ac-illust.com/main/profile.php?id=uCKphAW2&area=1
PositiveResponseとNegativeResponse

UDSのレスポンスのタイプは以下がある。
- PositiveResponse
- NegativeResponse

前回、そういうこと言ってたね。
PositiveResponse

まずPositiveResponseの方だけど、
これはまぁ特に説明は無くて、通常の応答の事を指す。

いきなり通常と言われても
何をもって通常と判断するかわからないんだけど。

なるほど!
言われてみればそうだね。

前回も言ったけど、以下のルールがあるよ。
- レスポンスメッセージの先頭1byteは必ずResponse SID
- Response SIDはRequest SIDに0x40とORを取ったものをセットする。

前回はRequest SIDが0x10だったから0x40でORを取って0x50になってたね。

これがポジティブレスポンス

え?これだけ?

これだけ。

厳密には各サービスによって必須なレスポンスパラメータが合ったりするんで、
共通するルールとしてはこれだけだね。

ほー。
NegativeResponse

次はNegativeResponse。

これはどういうルールになるの?

こんな感じになるよ。
Position | Parameter Name | Value |
---|---|---|
1 | Negative Response SID | 0x7F |
2 | <Service Name> Request SID | 0x00 – 0xFF |
3 | responseCode | 0x00 – 0xFF |

先頭のNegative Response SIDは0x7F固定なんだ。

あれ?
ポジティブレスポンスのルールで「Request SIDに0x40とORを取ったもの」ってのがあったけど、
あれと衝突しないのかな?
例えば、Request SIDが0x3Fのサービスとか?

中々鋭いね。

でも、ご心配なく。
0x3Fのサービスは無いよ。
ISO14229-1にそう明記されてる。

じゃー問題無いね。

<Service Name> Request SIDは
例えば、前回の0x10だったら、ここにも0x10ってなる感じ?

その通り。いいね。

最後のresponseCodeはちょっと分からないなー。

これはまだ全く教えてないからねー。
代表的な物を表にしたよ。
NRC | Description | Detail |
---|---|---|
0x12 | sub-functionNotSupported | サポートされていないsub-function要求された。 |
0x13 | incorrectMessageLengthOrInvalidFormat | リクエストメッセージ長は間違っている。 |
0x22 | conditionsNotCorrect | 条件があっていない。 |
0x31 | requestOutOfRange | パラメータが想定の範囲外。 |
0x33 | securityAccessDenied | セキュリティロックが掛かっている。 |
0x78 | requestCorrectlyReceived-ResponsePending | レスポンス保留。P2*時間待つこと |

結構番号が飛び地だけど、実際はすべての番号が定義されてる感じなのかな?

すべての番号が定義ってことはないけど
確かに今回の代表例から見たらもっと大量にある。

requestCorrectlyReceived-ResponsePendingって、
もしかして前回言ってたP2*時間がどうのってやつ?

そうそう。
これは次回説明するよ。

うーん、まとめるとNegativeResponseでこんな感じになるのか?
0x7F 0x10 0x12
SID 0x10に於いて、sub-functionがサポート外だった場合。

大正解。

よっしゃ!
分かってしまえばどうってことは無い!
まとめ

まとめだよ。
- PositiveResponseの説明。
- Response SIDはRequest SIDに0x40とORを取ったものをセットする。
- NegativeResponseの説明。
- 0x7F 0x10 0x12のような感じ。
- ResponsePendingのような特殊なものは次回説明。
バックナンバーはこちら。
コメント