NI-CAN

NI-XNET 20.5 Help

Edition Date: August 2020

Part Number: 372841AD-01

»View Product Info
Download Help (Windows Only)

NI-CAN is the legacy application programming interface (API) for National Instruments CAN and LIN hardware. Generally speaking, NI-CAN is associated with the legacy CAN and LIN hardware, and NI-XNET is associated with the new NI-XNET hardware.

If you are starting a new application, you typically use NI-XNET (not NI-CAN).

Compatibility

If you have an existing application that uses NI-CAN, a compatibility library is provided so that you can reuse that code with a new NI-XNET CAN or LIN product. Because the features of the compatibility library apply to the NI-CAN API and not NI-XNET, it is described in the NI-CAN documentation. For more information, refer to the NI-CAN Hardware and Software Manual.

NI-XNET CAN Products in MAX

When the compatibility library is installed, NI-XNET CAN and LIN products also are visible in the NI-CAN branch under Devices and Interfaces. Here you can configure the devices for use with the NI-CAN API. This configuration is independent from the configuration of the same device for NI-XNET under the root of Devices and Interfaces.

The following table shows how the NI-XNET devices are displayed as NI-CAN devices when the compatibility library is installed. It also shows which operating systems support the NI-XNET devices when used with the compatibility library.

Displayed NI-CAN Device NI-XNET Device Operating System(s) Comment
NI-PCI-8511 (1 port) NI PCI-8511 Windows  
NI-PCI-8511 (2 ports) NI PCI-8511 Windows  
NI-PCI-8512 (1 port) NI PCI-8512 Windows  
NI-PCI-8512 (2 ports) NI PCI-8512 Windows  
NI-PCI-8513 (1 port) NI PCI-8513 Windows  
NI-PCI-8513 (2 ports) NI PCI-8513 Windows  
NI-PXI-8511 (1 port) NI PXI-8511 Windows, PharLap  
NI-PXI-8511 (2 ports) NI PXI-8511 Windows, PharLap  
NI-PXI-8512 (1 port) NI PXI-8512 Windows, PharLap  
NI-PXI-8512 (2 ports) NI PXI-8512 Windows, PharLap  
NI-PXI-8513 (1 port) NI PXI-8513 Windows, PharLap  
NI-PXI-8513 (2 ports) NI PXI-8513 Windows, PharLap  
USB-8502 USB-8502 Windows One and two-port devices are available, indicated by the number of interfaces displayed. Only the two-port device has a sync port.
USB-8506 USB-8506 Windows One and two-port devices are available, indicated by the number of interfaces displayed. Only the two-port device has a sync port.
PCI-8511 (1 port) NI 9861 Windows Since NI-CAN did not support cSeries devices, the compatibility library presents them as PCI devices.
PCI-8512 (1 port) NI 9862 Windows Since NI-CAN did not support cSeries devices, the compatibility library presents them as PCI devices.

Transition

If you have an existing application that uses NI-CAN and intend to use only new NI-XNET hardware from now on, you may want to transition your code to NI-XNET.

NI-XNET unifies many concepts of the earlier NI-CAN API, but the key features are similar.

The following table lists NI-CAN terms and analogous NI-XNET terms.

NI-CAN Term NI-XNET Term Comment
CANdb file Database NI-XNET supports more database file formats than the NI-CAN Channel API, including the FIBEX, AUTOSAR, and LDF formats.
Message Frame The term Frame is the industry convention for the bits that transfer on the bus. This term is used in standards such as CAN.
Channel Signal The term Signal is the industry convention. This term is used in standards such as FIBEX and AUTOSAR.
Channel API Task Session (Signal I/O) Unlike NI-CAN, NI-XNET supports simultaneous use of channel (signal) I/O and frame I/O.
Frame API CAN Object (Queue Length Zero) Session (Frame I/O Single-Point) The NI-CAN CAN Object provided both input (read) and output (write) in one object. NI-XNET provides a different object for each direction, for better control. If the NI-CAN queue length for a direction is zero, that is analogous to NI-XNET Frame I/O Single-Point.
Frame API CAN Object (Queue Length Nonzero) Session (Frame I/O Queued) If the NI-CAN queue length for a direction is nonzero, that is analogous to NI-XNET Frame I/O Queued.
Frame API Network Interface Object Session (Frame I/O Stream) The NI-CAN Network Interface Object provided both input (read) and output (write) in one object. NI-XNET provides a different object for each direction, for better control.
Interface Interface NI-CAN started interface names at CAN0, but NI-XNET starts at CAN1 (or FlexRay1).

WAS THIS ARTICLE HELPFUL?

Not Helpful