CAN Statistic Counter

From CANopen-Lift
Revision as of 09:59, 28 August 2013 by WikiSysop (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

To get statistic information about the CAN bus connection, we suggest the following objects:

Bus State

We have four states of the CAN bus:

  • Error active (REC < 96 and TEC < 96)
  • Warning (Error active, REC >= 96 or TEC >= 96)
  • Error passive
  • Bus off

(REC = Receive error counter; TEC = Transmit error counter)

We define a counter for every change from 'Error active' to 'Warning', from 'Warning' to 'Error passive' and from 'Error passive' to 'Bus off'.

Objekt 0x5800, Record: CAN status counter

Subindex 0, UNSIGNED8,  rw:  Number of objects (read), 
                             write zero: clear status counter, 
Subindex 1, UNSIGNED16, ro:  Warning counter (counter 'Error active' to 'Warning')
Subindex 2, UNSIGNED16, ro:  Error counter (counter 'Warning' to 'Error passive')
Subindex 3, UNSIGNED16, ro:  Bus off counter (counter 'Error passive' to 'Bus off')

Receive Counter

Some receive counter are defined. The Rx message counter counts all successful received messages (indicated by the CAN controller). If a new received message overwites an old one, so that the old one get lost, increase the Rx overrun counter. If there is a FIFO in the application and a new received message can't be stored in the FIFO, increase the Rx overflow counter. The Rx max. counter indicates the maximum number of messages in the FIFO (max. fill level since the last counter reset). Rx FIFO size is the size of the FIFO.

Objekt 0x5801, Record: CAN rx counter

Subindex 0, UNSIGNED8,  rw:  Number of objects (read), 
                             write zero: clear rx counter, 
Subindex 1, UNSIGNED32, ro:  Rx message counter (counter of successful received messages)
Subindex 2, UNSIGNED16, ro:  Rx overrun counter (counter of lost messages - hardware overflow)
Subindex 3, UNSIGNED16, ro:  Rx overflow counter (counter of lost messages - software overflow)
Subindex 4, UNSIGNED16, ro:  Rx max. counter (max. number of messages in the FIFO queue)
Subindex 5, UNSIGNED16, ro:  Rx fifo size (size of the FIFO)

Transmit Counter

Some transmit counter are defined. The Tx message counter counts all successful transmitted messages (indicated by the CAN controller). If there is a FIFO in the application and it gets completely full, increase the 'Tx overflow counter. If the application loose a message because of a full FIFO, increase the Tx overrun counter. The Tx max. counter indicates the maximum number of messages in the FIFO (max. fill level since the last counter reset). Tx FIFO size is the size of the FIFO.

Objekt 0x5802, Record: CAN tx counter

Subindex 0, UNSIGNED8,  rw:  Number of objects (read), 
                             write zero: clear tx counter, 
Subindex 1, UNSIGNED32, ro:  Tx message counter (counter of successful transmitted messages)
Subindex 2, UNSIGNED16, ro:  Tx overrun counter (counter of lost messages - hardware/software overflow)
Subindex 3, UNSIGNED16, ro:  Tx overflow counter (counter of software overflow without lost of messages)
Subindex 4, UNSIGNED16, ro:  Tx max. counter (max. number of messages in the FIFO queue)
Subindex 5, UNSIGNED16, ro:  Tx fifo size (size of the FIFO)