Developer Blog

06/04/2018 by Magnus Carlsson

Get more from your hardware with Kvaser SDK libraries

This is an update of an old blog post at the Kvaser Developer Blog.

If you want to develop your own application that interacts with your Kvaser device, you’ll need to download the software development kit, Kvaser CANlib SDK. The Kvaser CANlib SDK is universally available across all supported Kvaser Devices. Inside the SDK you’ll find that there are a number of libraries:

CANlib – The first library is CANlib, and this is used to interact with Kvaser CAN devices connected to your computer and the CAN bus. At its core you have functions to set bus parameters (e.g. bit rate), go bus on/o and read/write CAN messages. You can also use CANlib to download and start t programs on supported devices. If you can see your device listed in the Kvaser Device Guide tool, it is connected and you can communicate with it through CANlib.

LINlib – The LINlib library is used to interact with the LIN bus. Similar to CANlib, it holds functions to set bus parameters, go bus on/o and read/write LIN messages.

kvaDbLib – The database library kvaDbLib is used for creating, reading, writing and modifying CAN databases that holds descriptions of packages that is received or sent on the CAN network.

kvlclib – The converter library kvlclib is used for converting Kvaser Memorator log files. It can be used to convert between a number of formats, e.g. from Kvaser binary format KME 5.0 (.kme50) to CAN frames in MDF 4.1 (.mf4).

kvmlib – The Memorator library kvmlib is used to interact with Kvaser Memorator devices that can record CAN messages, e.g. Kvaser Memorator Professional 5xHS. You can download configuration data (e.g. triggers, filters, scripts) allowing you to disconnect the device from your computer, connect the device to a (powered) CAN bus and let it record the traffic autonomously. When done, you can reconnect the device with your computer and use kvmlib to read the recorded data.

kvaMemoLibXML – The kvaMemoLibXML is used to convert XML formatted logger settings into a binary format used by Kvaser Memorator devices. The binary settings file can then be downloaded to a Kvaser Memorator device using the kvmlib mentioned above. With the help of kvaMemoLibXML and kvmlib, you can create your own tool for configuring Kvaser Memorator devices.

kvrlib -Some Kvaser devices, known as remote devices, can be connected via Ethernet or WiFi, e.g. Kvaser Ethercan Light HS and Kvaser BlackBird v2, and you need to configure those devices before they are connected to your computer. This is where kvrlib comes into play with functions to discover and connect to a Kvaser Device on the network, making it accessible for the CANlib functions. The kvrlib has functions to configure how the remote device connects to the network (e.g. dynamic/static IP). It also contains extra functions for wireless setup, such as scanning and getting connection status.

For more details about the functions included in the libraries contained in the CANlib SDK, please visit the CANlib help pages.

Author Image

Magnus Carlsson

Magnus Carlsson is a Software Developer for Kvaser AB and has developed firmware and software for Kvaser products since 2007. He has also written a number of articles for Kvaser’s Developer Blog dealing with the popular Python language.

Debug on...