Skip to content
Back to top
View this page

# National Instruments NI-XNET

This interface adds support for NI-XNET CAN controllers by National Instruments.

Note

NI-XNET only supports windows platforms.

## Bus

class can.interfaces.nixnet.NiXNETcanBus(channel='CAN1', bitrate=500000, timing=None, can_filters=None, receive_own_messages=False, can_termination=False, fd=False, fd_bitrate=None, poll_interval=0.001, **kwargs)

  Bases: `BusABC`

  The CAN Bus implemented for the NI-XNET interface.

  Parameters:

    - channel (str) – Name of the object to open (e.g. ‘CAN0’)

    - bitrate (int) – Bitrate in bits/s

    - timing (BitTiming | BitTimingFd | None) – Optional `BitTiming` or `BitTimingFd` instance to use for custom bit timing setting. The f_clock value of the timing instance must be set to 40_000_000 (40MHz). If this parameter is provided, it takes precedence over all other timing-related parameters like bitrate, fd_bitrate and fd.

    - can_filters (list) – See `can.BusABC.set_filters()`.

    - receive_own_messages (bool) – Enable self-reception of sent messages.

    - poll_interval (float) – Poll interval in seconds.

    - can_termination (bool)

    - fd (bool)

    - fd_bitrate (int | None)

    - kwargs (Any)

  Raises:

    CanInitializationError – If starting communication fails

  send(msg, timeout=None)

    Send a message using NI-XNET.

    Parameters:

      - msg (can.Message) – Message to send

      - timeout (float) – Max time to wait for the device to be ready in seconds, None if time is infinite

    Raises:

      can.exceptions.CanOperationError – If writing to transmit buffer fails. It does not wait for message to be ACKed currently.

    Return type:

      None

  reset()

    Resets network interface. Stops network interface, then resets the CAN chip to clear the CAN error counters (clear error passive state). Resetting includes clearing all entries from read and write queues.

    Return type:

      None

  shutdown()

    Close object.

    Return type:

      None