Click here for back issues.
https://www.simulationroom999.com/blog/diagnostic-communication-en-back-issue/
Introduction.
Continuation of the explanation of the network layer of vehicle diagnostic communication.
From this point on, the various types of frames details for constructing messages will be explained.
Types of frames
In the last issue, we explained that there are four types of frames.
Let me reiterate them.
- SF(Single Frame)
- FF(First Frame)
- FC(Flow Control)
- CF(Consecutive Frame)
As described in the previous section, we assume Normal fixed addressing, where the addressing format does not encroach on the DataField.
Details of types of frames
First, types of frames are expressed by separating N_PCI (Network Protocol Control Information) and actual data as follows.
フレーム | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
---|---|---|---|---|---|---|---|---|
SF | N_PCI | Data | ||||||
FF | N_PCI | Data | ||||||
FC | N_PCI | – | ||||||
CF | N_PCI | Data |
N_PCI is important for identifying frame types and combining frames.
N_PCI for SF
I’ ll begin to explain the N_PCI of types of frames.
First, I will explain about SF.
N_PCI of SF
bit7-4 | bit3-0 |
0x0 | message length |
By the way, the maximum message length will be 7.
The question here would be the part of bit7-4 that is fixed at 0.
You would think it would be simpler if bit7-4 were included in the message length.
In fact, bit7-4 is named N_PCItype, and the value here can identify SF, FF, FC, and CF.
In the case of SF, it happens to be defined as 0.
And the message length part is named SF_DL (Single Frame Data Length).
N_PCI for FF
Here is the explanation of N_PCI of FF.
N_PCI of FF
1byte | 2byte | 3byte~ | |
---|---|---|---|
bit7-4 | bit3-0 | bit7-0 | bit7-0 |
0x1 | message length | Data |
As in SF, the first 4 bits are N_PCItype.
Unlike SF, the message length is 12 bits.
Therefore, the maximum message length is 4095 bytes.
The message length field here is also named FF_DL (First Frame Data Length).
N_PCI of FC
And FC’s N_PCI.
This one is the most complicated.
N_PCI of FC
1byte | 2byte | 3byte | 4byte~ | |
---|---|---|---|---|
bit7-4 | bit3-0 | bit7-0 | bit7-0 | bit7-0 |
0x3 | FS | BS | STmin |
FS is Flow Status.
BS is Block Size.
STmin is SeparationTime minimum.
BS and STmin were explained in the previous section.
BS is a parameter that specifies how many times BS receives CF and sends FC again, and STmin is a parameter that specifies the time between CFs to be sent.
FS is defined by the contents of the following table.
Value | Name | Description |
---|---|---|
0x0 | CTS(ContinueToSend) | Permission to send CF following FC |
0x1 | WAIT(Wait) | Wait for FC again instruction (timeout is N_Bs value) |
0x2 | OVFLW(Overflow) | Insufficient receive buffer. Abort transmission. |
0x3-0xf | Reserved | Reserved |
Usually CTS.
WAIT when a wait is required.
If the FF_DL of FF is seen and it is determined that the message length is larger than the size that can be received, OVFLW is to be returned.
N_Bs in the explanation of WAIT in the table above, which will be explained in the next section.
There are many types of timeouts in vehicle diagnostic communication, and N_Bs is one of them.
N_PCI for CF
Finally, N_PCI for CF.
N_PCI of CF
1byte | 2byte~ | |
---|---|---|
bit7-4 | bit3-0 | bit7-0 |
0x2 | SN | Data |
It is a fairly simple structure, and it is good if you know what SN stands for.
SN is a parameter called Sequence Number.
The initial value is 1, after which it is incremented for each CF transmission, with the maximum value being 0xF and returning to 0x0 after 0xF.
The purpose is to detect receive leakage.
If this occurs, the message is to be discarded.
By the way, the SN is not reset even if FC is inserted in the middle of the message.
The next SN is the value obtained by incrementing the SN of the CF sent before the FC.
Impressions of types of frames
There are only four types, but it would take a lot of work to implement them.
There is the process of decomposing and combining messages, detection of illegal frames, handling of BS and STmin, and a timeout error that I have not yet explained.
However, the specification is clear, so it will be manageable.
Conclusion
- Four types of frames are explained.
- The first N_PCItype is available for immediate judgment upon reception.
- Each has its own unique parameters.
- SF.
- SF_DL.
- FF.
- FF_DL.
- FC.
- FS.
- BS.
- STmin.
- CF.
- SN.
- SF.
Click here for back issues.
コメント