Take a look into the pcan.h file, part of the driver source. There you find the error code definition.
Code: Select all
/*
* error codes
*/
#define CAN_ERR_OK 0x0000 // no error
#define CAN_ERR_XMTFULL 0x0001 // transmit buffer full
#define CAN_ERR_OVERRUN 0x0002 // overrun in receive buffer
#define CAN_ERR_BUSLIGHT 0x0004 // bus error, errorcounter limit reached
#define CAN_ERR_BUSHEAVY 0x0008 // bus error, errorcounter limit reached
#define CAN_ERR_BUSOFF 0x0010 // bus error, 'bus off' state entered
#define CAN_ERR_QRCVEMPTY 0x0020 // receive queue is empty
#define CAN_ERR_QOVERRUN 0x0040 // receive queue overrun
#define CAN_ERR_QXMTFULL 0x0080 // transmit queue full
#define CAN_ERR_REGTEST 0x0100 // test of controller registers failed
#define CAN_ERR_NOVXD 0x0200 // Win95/98/ME only
#define CAN_ERR_RESOURCE 0x2000 // can't create resource
#define CAN_ERR_ILLPARAMTYPE 0x4000 // illegal parameter
#define CAN_ERR_ILLPARAMVAL 0x8000 // value out of range
#define CAN_ERRMASK_ILLHANDLE 0x1C00 // wrong handle, handle error
14 DEC is 0x000e HEX - it is the same Information.
The Error codes are BIT decoded (multiple Errors / Warnings / Information in one Value)
Your Error 14DEC/0x000e is a combination of these 3 Errors:
Code: Select all
#define CAN_ERR_OVERRUN 0x0002 // overrun in receive buffer
#define CAN_ERR_BUSLIGHT 0x0004 // bus error, errorcounter limit reached
#define CAN_ERR_BUSHEAVY 0x0008 // bus error, errorcounter limit reached
Looks like you have a physical problem - no termination, wrong bitrate timing, no second active CAN Node that could ACK etc.
Also the receive buffer was not written in time (always read until buffer is empty)
For LINUX, using our CharDev driver, we recommend to use the PCAN-Basic API, because it is much more comfortable and could also be used cross platform (Windows and LINUX)
See "libpcanbasic" folder.