National Instruments NI-CAN#
This interface adds support for NI-CAN controllers by National Instruments.
NI-CAN only seems to support 32-bit architectures so if the driver can’t be loaded on a 64-bit Python, try using a 32-bit version instead.
CAN filtering has not been tested thoroughly and may not work as expected.
- class can.interfaces.nican.NicanBus(channel, can_filters=None, bitrate=None, log_errors=True, **kwargs)[source]#
The CAN Bus implemented for the NI-CAN interface.
This interface does implement efficient filtering of messages, but the filters have to be set in
set_filters()does not work.
channel (str) – Name of the object to open (e.g. “CAN0”)
bitrate (int | None) – Bitrate in bit/s
can_filters (Sequence[CanFilter | CanFilterExtended] | None) – See
log_errors (bool) – If True, communication errors will appear as CAN messages with
is_error_frameset to True and
arbitration_idwill identify the error (default True)
CanInterfaceNotImplementedError – If the current operating system is not supported or the driver could not be loaded.
NicanInitializationError – If the bus could not be set up.
- exception can.interfaces.nican.NicanError(function, error_code, arguments)[source]#
Error from NI-CAN driver.
error_code (int) –
- Return type: