National Instruments NI-CAN User Manual page 18

Table of Contents

Advertisement

Chapter 1
Introduction
counters are increased more for errors than they are decreased for
successful reception/transmission. This ensures that the error counters will
generally increase when a certain ratio of frames (roughly 1/8) encounter
errors. By maintaining the error counters in this manner, the CAN protocol
can generally distinguish temporary errors (such as those caused by
external noise) from permanent failures (such as a broken cable). For
complete information on the rules used to increment/decrement the error
counters, refer to the CAN specification (ISO 11898).
With regard to error confinement, each CAN device may be in one of three
states: error active, error passive, and bus off.
Error Active State
When a CAN device is powered on, it begins in the error active state.
A device in error active state can normally take part in communication, and
transmits an active error flag when an error is detected. This active error
flag (sequence of dominant 0 bits) causes the current frame transmission to
abort, resulting in a subsequent retransmission. A CAN device remains in
the error active state as long as the transmit and receive error counters are
both below 128. In a normally functioning network of CAN devices, all
devices are in the error active state.
Error Passive State
If either the transmit error counter or the receive error counter increments
above 127, the CAN device transitions into the error passive state. A device
in error passive state can still take part in communication, but transmits a
passive error flag when an error is detected. This passive error flag
(sequence of recessive 1 bits) generally does not abort frames transmitted
by other devices. Since passive error flags are not able to prevail over any
activity on the bus line, they are noticed only when the error passive device
is transmitting a frame. Thus, if an error passive device detects a receive
error on a frame which is received successfully by other devices, the frame
is not retransmitted.
One special rule to keep in mind is that when an error passive device detects
an acknowledgment error, it does not increment its transmit error counter.
Thus, if a CAN network consists of only one device (for instance, if you do
not connect a cable to your National Instruments CAN interface), and that
device attempts to transmit a frame, it retransmits continuously but never
goes into bus off state (although it eventually reaches error passive state).
© National Instruments Corporation
1-7
NI-CAN User Manual

Advertisement

Table of Contents
loading

Table of Contents