canlib.kvDevice

class canlib.kvDevice.kvDevice(ch=None, flags=0, canlibHnd=None, ean=None, serial=None, cardChannel=0)[source]

Holds information about a Kvaser CAN device

Parameters:
  • ch (int) – CANlib channel where the device is currently connected.
  • flags (int) – Optional flags such as canlib.canOPEN_EXCLUSIVE.
  • canlibHnd – Optional canlib.canlib object, usually creates a new one.
  • ean (str) – EAN for the device, e.g. “73-30130-00778-9”. Used instead of ch.
  • serial (str) – Optional serial number of the device, can be used in conjuntion with ean.
  • cardChannel (int) – Optional local channel on card, can be used in conjunction with ean.
static allDevices(reinitialize=True)[source]
cardChannel()[source]

Read card channel number from device

Returns:cardChannel (int) – The local channel on card, first channel is number 0.
cardChannels()[source]
cardNumber()[source]
close()[source]
defaultHostname()[source]
driverName()[source]
ean()[source]
static ean2ean_hi(ean)[source]
static ean2ean_lo(ean)[source]
static ean_hi_lo2ean(ean_hi, ean_lo)[source]
fw()[source]
hasScript()[source]
isLogger()[source]
lastKnowncanlibChannel()[source]
memoClose()[source]
memoOpen(deviceType=<Device.MHYDRA_EXT: 1>)[source]
memoOpenEx()[source]
memoReadEvents(fileIndx)[source]
name()[source]
open(flags=0, timeout=10, unloadCanlib=False)[source]
readConfig()[source]
serial()[source]
setModeNormal()[source]
setModeVirtualLogger()[source]
write(frame)[source]

Write a CAN message to the bus.

Parameters:frame (canlib.frame.Frame) – The data frame to be sent
writeConfig(config=None)[source]
writeWait(frame, timeout)[source]

Write a CAN message to the bus.

Parameters:message (canlib.frame.Frame) – The data frame to send