Package: canlib
canlib - a Python wrapper for Kvaser CANlibSupported Libraries and InstallationThe Python canlib module wraps the Kvaser CANlib API in order to make it easy to control most aspects of any Kvaser CAN interface. For more information about Kvaser please go tohttps://www.kvaser.com/.The latest version of this package is available on theKvaser Download page(pycanlib.zip).Supported platformsWindows and Linux using Python v3.6+ (both 32 and 64 bit).Supported librariesThe following libraries are currently supported:LibraryModuleWindowsLinuxCANlibcanlib.canlibcanlib32.dlllibcanlib.sokvaMemoLibXMLcanlib.kvamemolibxmlkvaMemoLibXML.dlllibkvamemolibxml.sokvrlibcanlib.kvrlibkvrlib.dll,
irisdll.dll,
irisflash.dll,
libxml2.dllnot supportedkvmlibcanlib.kvmlibkvaMemoLib0600.dll,
kvaMemoLib0700.dll,
kvaMemoLib.dll,
kvmlib.dllnot supported,[2]libkvamemolib0700.so,
libkvamemolib.so,
libkvmlib.sokvlclibcanlib.kvlclibkvlclib.dll[1]libkvlclib.sokvaDbLibcanlib.kvadblibkvaDbLib.dlllibkvadblib.soLINlibcanlib.linliblinlib.dllliblinlib.so[1]The kvlclib.dll depends on dll files from matlab wich are installed alongside kvlclib.dll.[2]The kvaMemoLib0600.dll, which supports older devices, is not supported under Linux.InstallationInstall the Python package fromPyPIusing e.g.pip:$pipinstallcanlibIf you have downloaded the package zip file from theKvaser Download page, first unzippycanlib.zip. Then navigate to the unzipped pycanlib using the command line. It should contain the filecanlib-x.y.z-py2.py3-none-any.whl, where x,y,z are version numbers.
Run the following command:$pipinstallcanlib-x.y.z-py2.py3-none-any.whlThe Kvaser CANlib DLLs or shared libraries also need to be installed:WindowsOnWindows, first install thecanlib32.dllby downloading and installing “Kvaser Drivers for Windows” which can be found on theKvaser Download page(kvaser_drivers_setup.exe) This will also installkvrlib.dll,irisdll.dll,irisflash.dllandlibxml2.dllused by kvrlib.The “Kvaser CANlib SDK” also needs to be downloaded from the same place (canlib.exe) and installed if more than just CANlib will be used. This will install the rest of the supported library dll’s.The two packages, “Kvaser Drivers for Windows” and “Kvaser CANlib SDK”, contains both 32 and 64 bit versions of the included dll’s.LinuxOnLinux, first install thelibcanlib.soby downloading and installing “Kvaser LINUX Driver and SDK” which can be found on theKvaser Download page(linuxcan.tar.gz).If more than just CANlib will be used, the rest of the supported libraries will be available by downloading and installing “Linux SDK library” (kvlibsdk.tar.gz).UsageExample of using canlib to list some information about connected Kvaser devices:fromcanlibimportcanlibnum_channels=canlib.getNumberOfChannels()print(f"Found{num_channels}channels")forchinrange(num_channels):chd=canlib.ChannelData(ch)print(f"{ch}.{chd.channel_name}({chd.card_upc_no}/{chd.card_serial_no})")Which may result in:Found4channels0.KvaserMemoratorPro2xHSv2(channel0)(73-30130-00819-9/12330)1.KvaserMemoratorPro2xHSv2(channel1)(73-30130-00819-9/12330)2.KvaserVirtualCANDriver(channel0)(00-00000-00000-0/0)3.KvaserVirtualCANDriver(channel1)(00-00000-00000-0/0)SupportYou are invited to visit the Kvaser web pages athttps://www.kvaser.com/support/. If you don’t find what you are looking for, you can obtain support on a time-available basis by sending an e-mail tosupport@kvaser.com.Bug reports, contributions, suggestions for improvements, and similar things are much appreciated and can be sent by e-mail tosupport@kvaser.com.What’s newA complete set of release notes are available in the package documentation included in the zip file available at theKvaser Download page.LinksKvaser CANlib SDK Page:https://www.kvaser.com/developer/canlib-sdk/Description of CANlib SDK library contents:https://www.kvaser.com/developer-blog/get-hardware-kvaser-sdk-libraries/LicenseThis project is licensed under the terms of the MIT license.