Miscellaneous¶
bitrateSetting¶
-
class
canlib.canlib.bitrateSetting(freq=1000000, tseg1=4, tseg2=3, sjw=1, nosamp=1, syncMode=0)[source]¶ Class that holds bitrate setting.
Variables: - freq – Bitrate in bit/s.
- tseg1 – Number of quanta from (but not including) the Sync Segment to the sampling point.
- tseg2 – Number of quanta from the sampling point to the end of the bit.
- sjw – The Synchronization Jump Width, can be 1,2,3, or 4.
- nosamp – The number of sampling points, only 1 is supported.
- syncMode – Unsupported and ignored.
dllversion()¶
getErrorText()¶
getNumberOfChannels()¶
getVersion()¶
-
canlib.canlib.getVersion()[source]¶ Get the CANlib DLL version number as a
strDeprecated since version 1.5: Use
dllversioninstead.
prodversion()¶
reinitializeLibrary()¶
-
canlib.canlib.reinitializeLibrary()[source]¶ Reinitializes the CANlib driver.
Convenience function that calls
unloadLibraryandinitializeLibraryin succession.
ScriptText¶
-
class
canlib.canlib.ScriptText[source]¶ Text returned by
Channel.scriptGetTextSubclass of built-in
str, so it can be used just like a normal string.It also has the following attributes:
Variables: - slot (
int) – Which script-slot the text came from. - time (
int) – Timestamp of when the text was printed. - ScriptText.flags (
canlib.canlib.Stat) – Any flags associated with the text.
New in version 1.7.
- slot (
translateBaud()¶
-
canlib.canlib.translateBaud(freq)[source]¶ Translate bitrate constant
This function translates the canBITRATE_xxx constants to their corresponding bus parameter values.
Parameters: freq – Any of the predefined constants canBITRATE_xxx Returns: - A bitrateSetting object containing the actual values of
- frequency, tseg1, tseg2 etc.
unloadLibrary()¶
-
canlib.canlib.unloadLibrary()[source]¶ Unload CANlib
Unload canlib and release all internal handles.
Warning
Calling
unloadLibraryinvalidates every canlib-object. Use at your own risk.