1、 附 录: ERROR HANDLING Error Detection: There are 5 different error types (which are not mutually exclusive): BIT ERROR: A unit that is sending a bit on the bus also monitors the bus. A BIT ERROR has to be detected at that bit time, when the bit value that is monitored is different from the bit value
2、that is sent. An exception is the sending of a “recessive” bit during the stuffed bit stream of the ARBITRATION FIELD or during the ACK SLOT. Then no BIT ERROR occurs when a “dominant” bit is monitored. A TRANSMITTER sending a PASSIVE ERROR FLAG and detecting a “dominant” bit does not interpret this
3、 as a BIT ERROR. STUFF ERROR: A STUFF ERROR has to be detected at the bit time of the 6th consecutive equal bit level in a message field that should be coded by the method of bit stuffing. CRC ERROR: The CRC sequence consists of the result of the CRC calculation by the transmitter. The receivers cal
4、culate the CRC in the same way as the transmitter. A CRC ERROR has to be detected, if the calculated result is not the same as that received in the CRC sequence. FORM ERROR: A FORM ERROR has to be detected when a fixed-form bit field contains one or more illegal bits. (Note, that for a Receiver a do
5、minant bit during the last bit of END OR FRAME is not treated as FORM ERROR). ACKNOWLEDGMENT ERROR An ACKNOWLEDGMENT ERROR has to be detected by a transmitter whenever it does not monitor a “dominant” bit during the ACK SLOT. Error Signaling: A station detecting an error condition signals this by tr
6、ansmitting an ERROR FLAG. For an “error active” node it is an ACTIVE ERROR FLAG, for an “error passive” node it is a PASSIVE ERROR FLAG. Whenever a BIT ERROR, a STUFF ERROR, a FORM ERROR or an ACKNOWLEDGMENT ERROR is detected by any station, transmission of an ERROR FLAG is started at the respective
7、 station at the next bit. Whenever a CRC ERROR is detected, transmission of an ERROR FLAG starts at the bit following the ACK DELIMITER, unless an ERROR FLAG for another condition has already been started. FAULT CONFINEMENT OF CAN: With respect to fault confinement a unit may be in one of three stat
8、es: “error active” “error passive” “bus off” An “error active” unit can normally take part in bus communication and sends an ACTIVE ERROR FLAG when an error has been detected. An “error passive” unit must not send an ACTIVE ERROR FLAG. It takes part in bus communication, but when an error has been d
9、etected only aPASSIVE ERROR FLAG is sent. Also after a transmission, an “error passive” unit will wait before initiating a further transmission. A “bus off” unit is not allowed to have any influence on the bus. (E.g. output drivers switched off). For fault confinement two counts are implemented in e
10、very bus unit: TRANSMIT ERROR COUNT: RECEIVE ERROR COUNT: These counts are modified according to the following rules (note that more than one rule may apply during a given message transfer): When a RECEIVER detects an error, the RECEIVE ERROR COUNTwill be increased by 1, except when the detected err
11、or was a BIT ERROR during the sending of an ACTIVE ERROR FLAG or an OVERLOAD FLAG. When a RECEIVER detects a “dominant” bit as the first bit after sending an ERROR FLAG the RECEIVE ERROR COUNT will be increased by 8. When a TRANSMITTER sends an ERROR FLAG the TRANSMIT ERROR COUNT is increased by 8.
12、Exception 1: If the TRANSMITTER is “error active” and detects an ACKNOWLEDG- MENT ERROR because of not detecting a “dominant” ACK and does not detect a “dominant” bit while sending its PASSIVE ERROR FLAG. Exception 2: If the TRANSMITTER sends an ERROR FLAG because STUFF ERROR occurred during ARBITRA
13、TION, and should have been “recessive”, and has been sent as “recessive” but monitored as “dominant”. In exceptions 1 and 2 the TRANSMIT ERROR COUNT is not changed. If a TRANSMITTER detects a BIT ERROR while sending an ACTIVE ERROR FLAG or an OVERLOAD FLAG the TRANSMIT ERROR COUNT is increased by 8.
14、 If a RECEIVER detects a BIT ERROR while sending an ACTIVE ERROR FLAG or an OVERLOAD FLAG the RECEIVE ERROR COUNT is increased by 8. Any node tolerates up to 7 consecutive “dominant” bits after sending an ACTIVE ERROR FLAG, PASSIVE ERROR FLAG or OVERLOAD FLAG. After detecting the 14th consecutive “d
15、ominant” bit (in case of an ACTIVE ERROR FLAG or an OVERLOAD FLAG) or after detecting the 8th consecutive “dominant” bit following a PASSIVE ERROR FLAG, and after each sequence of additional eight consecutive “dominant” bits every TRANSMITTER increases its TRANSMIT ERROR COUNT by 8 and every RECEIVE
16、R increases its RECEIVE ERROR COUNT by 8. After the successful transmission of a message (getting ACK and no error until END OF FRAME is finished) the TRANSMIT ERROR COUNT is decreased by 1 unless it was already 0. After the successful reception of a message (reception without error up to the ACK SL
17、OT and the successful sending of the ACK bit), the RECEIVE ERROR COUNT is decreased by 1, if it was between 1 and 127. If the RECEIVE ERROR COUNT was 0, it stays 0, and if it was greater than 127, then it will be set to a value between 119 and 127. A node is “error passive” when the TRANSMIT ERROR COUNT equals or exceeds 128, or when the RECEIVE ERROR COUNT equals or exceeds 128. An error condition letting a node become “error passive” causes the node to send an ACTIVE ERROR FLAG.