National Instruments NI-CAN#
This interface adds support for NI-CAN controllers by National Instruments.
Warning
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.
Warning
CAN filtering has not been tested thoroughly and may not work as expected.
Bus#
- 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.
Warning
This interface does implement efficient filtering of messages, but the filters have to be set in
__init__
using thecan_filters
parameter. Usingset_filters()
does not work.- Parameters
channel (str) – Name of the object to open (e.g. “CAN0”)
can_filters (Optional[Sequence[Union[can.typechecking.CanFilter, can.typechecking.CanFilterExtended]]]) – See
can.BusABC.set_filters()
.log_errors (bool) – If True, communication errors will appear as CAN messages with
is_error_frame
set to True andarbitration_id
will identify the error (default True)
- Raises
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.
- Return type
None