Miscellaneous

dllversion()

canlib.linlib.dllversion()[source]

Retrieve the LIN library version as a VersionNumber

Note

Requires CANlib v5.3

getChannelData()

canlib.linlib.getChannelData(channel_number, item=ChannelData.CARD_FIRMWARE_REV)[source]

This function can be used to retrieve certain pieces of information about a channel.

Note

You must pass a channel number and not a channel handle.

Parameters
  • channel (int) – The number of the channel you are interested in. Channel numbers are integers in the interval beginning at 0.

  • item (ChannelData) – This parameter specifies what data to obtain for the specified channel. Currently the only item available is CARD_FIRMWARE_REV, which is the default.

getTransceiverData

canlib.linlib.getTransceiverData(channel_number)[source]

Get the transceiver information for a CAN channel

The application typically uses this call to find out whether a particular CAN channel has a LIN interface connected to it. For a Kvaser LIN Leaf it retrieves the transceiver type and device information.

This function call will open the CAN channel, but no CAN messages are transmitted on it. In other words, it’s risk-free to use even if no LIN interface is connected, or if the channel is connected to a CAN system.

Note

Attempts to use the channel for LIN communication will be meaningful only if the returned TransceiverData’s ~type~ attribute is one of TransceiverType.LIN or TransceiverType.CANFD_LIN

A LIN interface need not be powered for this call to succeed.

The information may not always be accurate. Especially after changing transceiver on a running LAPcan card, you should go on bus and off bus again to be sure the transceiver information is updated.

initializeLibrary

canlib.linlib.initializeLibrary()[source]

Initialize LINlib

Note

LINlib is automatically initialized when canlib.linlib is imported. This function is only necessary when LINlib has been manually unloaded with unloadLibrary.

TransceiverData

class canlib.linlib.TransceiverData(ean, serial, type)
property ean

Alias for field number 0

property serial

Alias for field number 1

property type

Alias for field number 2

unloadLibrary

canlib.linlib.unloadLibrary()[source]

Deinitialize LINlib

This function de-initializes the LIN library. After this function is called linInitializeLibrary must be called before any other LIN function is called.