Return codes from the CANlib functions. More...
Return codes from the CANlib functions.
Generally, a return code greater than or equal to zero means success.
A value less than zero means failure.
You should avoid testing for a specific error code unless it is explicitly
stated in the documentation for the API in question that this specific error
code is returned. Instead, check if the error code is less than zero.
Use canGetErrorText() to obtain an error message suitable for a message to the
user, or for a line in an error log file.
enum canStatus |
Enumerator | |
---|---|
canOK | Normal successful completion; The driver is just fine, and really believes it carried out your command to everyone's satisfaction. |
canERR_PARAM | Error in one or more parameters; a parameter specified in the call was invalid, out of range, or so. This status code will also be returned when the call is not implemented. |
canERR_NOMSG | There were no messages to read; A function tried to read a message, but there was no message to read. |
canERR_NOTFOUND | Specified device or channel not found. There is no hardware available that matches the given search criteria. For example, you may have specified canOPEN_REQUIRE_EXTENDED but there's no controller capable of extended CAN. You may have specified a channel number that is out of the range for the hardware in question. You may have requested exclusive access to a channel, but the channel is already occupied. |
canERR_NOMEM | Out of memory; A memory allocation failed. |
canERR_NOCHANNELS | No channels available; There is indeed hardware matching the criteria you specified, but there are no channels available, or the channel you specified is already occupied. |
canERR_INTERRUPTED | Interrupted by signals. |
canERR_TIMEOUT | Timeout occurred; A function waited for something to happen (for example, the arrival of a message), but that something didn't happen. |
canERR_NOTINITIALIZED | The library is not initialized; The driver is not initialized. canInitializeLibrary() was probably not called? |
canERR_NOHANDLES | Out of handles; No handles are available inside canlib32. The application has too many handles open (i.e. has called canOpenChannel() too many times, or there's a memory leak somewhere.)
|
canERR_INVHANDLE | Handle is invalid; The CANLIB handle you specified (if the API call includes a handle) is not valid. Ensure you are passing the handle and not, for example, a channel number. |
canERR_INIFILE | Error in the ini-file (16-bit only) |
canERR_DRIVER | Driver type not supported; CAN driver mode is not supported by the present hardware. |
canERR_TXBUFOFL | Transmit buffer overflow; The transmit queue was full, so the message was dropped. |
canERR_RESERVED_1 | Reserved. |
canERR_HARDWARE | A hardware error has occurred; Something probably related to the hardware happened. This could mean that the device does not respond (IRQ or address conflict?), or that the response was invalid or unexpected (faulty card?). |
canERR_DYNALOAD | A driver DLL can't be found or loaded; (One of) the DLL(s) specified in the registry failed to load. This could be a driver installation problem. |
canERR_DYNALIB | A DLL seems to have wrong version; DLL version mismatch. (One of) the DLL(s) specified in the registry is - probably - too old, or - less likely - too new. |
canERR_DYNAINIT | Error when initializing a DLL; Something failed when a device driver was being initialized. In other words, we can open the driver but it makes a lot of fuss about something we don't understand. |
canERR_NOT_SUPPORTED | Operation not supported by hardware or firmware. |
canERR_RESERVED_5 | Reserved. |
canERR_RESERVED_6 | Reserved. |
canERR_RESERVED_2 | Reserved. |
canERR_DRIVERLOAD | Can't find or load kernel driver; A device driver (kernel mode driver for NT, VxD for W95/98) failed to load; or the DLL could not open the device. Privileges? Driver file missing? |
canERR_DRIVERFAILED | DeviceIOControl failed; Use Win32 GetLastError() to learn what really happened. |
canERR_NOCONFIGMGR | Can't find req'd config s/w (e.g. CS/SS) |
canERR_NOCARD | The card was removed or not inserted. |
canERR_RESERVED_7 | Reserved. |
canERR_REGISTRY | Error (missing data) in the Registry; A registry key is missing, invalid, malformed, has gone for lunch or what not. can_verify.exe might provide some insight. |
canERR_LICENSE | The license is not valid. |
canERR_INTERNAL | Internal error in the driver; Indicates an error condition in the driver or DLL, which couldn't be properly handled. Please contact the friendly support at suppo. rt@k vaser .com |
canERR_NO_ACCESS | Access denied; This means that you tried to set the bit rate on a handle to which you haven't got init access or you tried to open a channel that already is open with init access. See canOpenChannel() for more information about init access. |
canERR_NOT_IMPLEMENTED | Not implemented; The requested feature or function is not implemented in the device you are trying to use it on. |
canERR_DEVICE_FILE | Device File error; An error has occured when trying to access a file on the device. |
canERR_HOST_FILE | Host File error; An error has occured when trying to access a file on the host. |
canERR_DISK | Disk error; A disk error has occurred. Verify that the disk is initialized. |
canERR_CRC | CRC error; The CRC calculation did not match the expected result. |
canERR_CONFIG | Configuration Error; The configuration is corrupt. |
canERR_MEMO_FAIL | Memo Error; Other configuration error. |
canERR_SCRIPT_FAIL | Script Fail; A script has failed.
|
canERR_SCRIPT_WRONG_VERSION | The t script version dosen't match the version(s) that the device firmware supports.; |
canERR_SCRIPT_TXE_CONTAINER_VERSION | The compiled t script container file format is of a version which is not supported by this version of canlib.; |
canERR_SCRIPT_TXE_CONTAINER_FORMAT | An error occured while trying to parse the compiled t script file.; |
canERR_BUFFER_TOO_SMALL | The buffer provided was not large enough to contain the requested data.; |
canERR_IO_WRONG_PIN_TYPE | The I/O pin doesn't exist or the I/O pin type doesn't match the called function, e.g. trying to use input pins as outputs or use digital pins as analog pins. ; |
canERR_IO_NOT_CONFIRMED | The I/O pin configuration is not confirmed. Use kvIoConfirmConfig() to confirm the configuration.; |
canERR_IO_CONFIG_CHANGED | The I/O pin configuration has changed after last call to kvIoConfirmConfig. Use kvIoConfirmConfig() to confirm the new configuration. ; |
canERR_IO_PENDING | The previous I/O pin value has not yet changed the output and is still pending. This happens when e.g. kvIoPinSetAnalog() is called twice on the same pin within a short time. ; |
canERR_IO_NO_VALID_CONFIG | There is no valid I/O pin configuration. |
canERR__RESERVED | Reserved. |