Status frames can be received or discarded by configuring the parameter AllowStatusFrames on the connected PCAN Channel. This is carried out using the SetValue(PcanChannel, PcanParameter, UInt32) method.
The status frame data will be placed into a PcanMessage object. The field MsgType of these objects will have the flag Status set.
The ID and DLC fields can be ignored. The first 4 data bytes of the message represent a 32 bit value in big endian format (MSB is byte 0, LSB is byte 3), that maps the reported PcanStatus value. The following table shows the possible values for a status frame:
Data0 | Data1 | Data2 | Data3 | Identifier | Code | Description |
|---|---|---|---|---|---|---|
00h | 00h | 00h | 00h | 0000h | The CAN controller has been successfully activated. | |
00h | 00h | 00h | 02h | 0002h | The CAN controller has been read out too late. | |
00h | 00h | 00h | 04h | 0004h | Bus error: An error counter has reached the 'light' limit. | |
00h | 00h | 00h | 08h | 0008h | Bus error: An error counter has reached the 'warning' limit. | |
00h | 04h | 00h | 00h | 4000h | The CAN controller is in error passive state. | |
00h | 00h | 00h | 08h | 0008h | Bus error: An error counter has reached the 'heavy' limit. | |
00h | 00h | 00h | 10h | 0010h | Bus error: CAN Controller is in 'bus-off' state. |
According to the communication being used (CAN / CAN FD) some of the status values described above may or may not be supported.