Friday, May 2, 2014

ISOTP-CAN

ISOTP-CAN(I15765-3)

Four Different Message Type Defined:

1.Single-Frame
2.First-Frame
3.Consecutive-Frame
4.Flow-Control

The single-frame is used when the message is less than or equal to 7 bytes long, as illustrated.



Reason: A CAN message can hold a total of 8 bytes and the first byte is used as the protocol control information PCI. With a single-frame, the first four bits of the PCI-bytes are set to 0. The second four bits of this byte contain the data length of following data. The user data can now be large from one to seven bytes.




If a diagnostic message from more than 7 bytes of data exist, a segmentation is required. This is the first message of a so-called first-frame sent, as illustrated. There are also a PCI. However, there is two bytes. In the first 4 bits of the first byte is the value 1 It recognizes the recipient a first-frame. The remaining four bits and the whole of next byte together for a total of 12-bit, according to the number of data of the entire diagnostic message. Total of 4095 bytes. The remaining six remaining bytes of the first message to be filled with data.



  
Then send as many frames Consecutive follow until the entire message was. Consecutive in-frame, only the first byte of the PCI byte is used. With the top four bits to the value 2 and the following four bits with a set sequence number. This one just starting at 1 each Consecutive frames. And because we have only four bits are available, Modulo is expected 16th The first Consecutive frame has sequence number one and so on up to fifteen. Then it starts again from zero.

These three types of message sent by the transmitter. The fourth message type, the so-called flow-control frame, as opposed to the previous sent by the receiver. The flow-control frame consists of three bytes, which together form a PCI. The first byte begins in the upper 4 bits of value 3, indicating that there is a flow-control. Then follows the flow status. This flow state can be either 0. This shows the station that will send the data block that it can actually send. The value can be one too. This indicates to the recipient that he needs time and that the sender should wait. With the value two can indicate the recipient that it has come with him to a memory overflow, that the data block was ignored, and sending, if necessary, repeated.




The second byte, block size, the sender is informed about how many Consecutive frames in a row, he is allowed to send before the receiver again time for processing needs. The last shows the minimum separation distance between the minimum-time consecutive Consecutive frames to be observed by the station. The entire process is demonstrated by the following simple example, see illustration:



We assume that we have a diagnostic message with 35 bytes and the receiver can buffer only 24 bytes. The whole process starts from the transmitter with a first-frame message. It has placed in the top 4 bits is a one. This is followed by twelve bits that show the entire data length. Since we have 35 bytes, equivalent to 0x23 hexadecimal, here follows the value 0x23. Then come the first 6 bytes of data.
The reactions to the first frame, by returning a flow control frame in which the top 4 bits are indicative of the flow control to 3. We assume that the receiver is able to buffer 24 bytes. He is also ready to receive data. Therefore, in the lower 4 bits of the first byte ClearToSend set to 0. The following byte contains the number of blocks. Here these are 3 blocks (= 24 / 8). Here in the last byte the Minimum Separation Time is set to ten milliseconds (= 0x0A).
On the flow control frame, the transmitter responds by starting to send its Consecutive frames with the rest of the data. The Consecutive-frame begins with a PCI-byte, in which the upper 4 bits are set to 2. Then follows the sequence number one, because it is the first Consecutive frame. The remaining 7 bytes of the CAN message to be filled with the next 7 user data bytes. Since we have a block size of three, this process goes in accordance with the Separation Time further out of ten milliseconds this way: The next Consecutive frame follows the sequence number has changed and the 7 next data bytes are sent. Then the third Consecutive frame also follows with another 7 bytes of data, the sequence number has increased to 3.
Since the block size was set to three, can now be followed no further Consecutive frame. The sender waits for the receiver to him now on a second flow control frame notifies that the transmission can continue. Here are now in our example, the same values ​​as in the first flow-control frame. Theoretically, the receiver could ask at this point to wait or he could with a different block size or work of another separation-Time.
After the actual station has now received this second flow control frame, it continues sending the data block. It follows another Consecutive frame with sequence number 4 and a final with the sequence number 5 Overall, the 35 data bytes have been sent successfully.


1 comment:

  1. Bk bai..u r images are broken ..
    can you look into that ?

    ReplyDelete