CAN has several different physical layers you can use. These physical layers classify certain aspects of the CAN network, such as electrical levels, signaling schemes, cable impedance, maximum baud rates, and more. The most common and widely used physical layers are described below:
High-speed CAN is by far the most common physical layer. High-speed CAN networks are implemented with two wires and allow communication at transfer rates up to 1 Mbit/s. Other names for high-speed CAN include CAN C and ISO 11898-2. Typical high-speed CAN devices include antilock brake systems, engine control modules, and emissions systems. CAN with Flexible Data-Rate (CAN FD) is the next generation of high-speed CAN communication with evolving standards for higher data rates. NI has enabled speeds up to 8 Mbit/s using the TJA1041 and TJA1043 transceivers through the NI-XNET driver. As transceiver vendors complete qualifications for CAN FD speeds, NI will update our documentation as necessary.
Low-Speed/Fault-Tolerant CAN Hardware
Low-speed/fault-tolerant CAN networks are also implemented with two wires, can communicate with devices at rates up to 125 kbit/s, and offer transceivers with fault-tolerant capabilities. Other names for low-speed/fault-tolerant CAN include CAN B and ISO 11898-3. Typical low-speed/fault-tolerant devices in an automobile include comfort devices. Wires that have to pass through the door of a vehicle are low-speed/fault-tolerant in light of the stress that is inherent to opening and closing a door. Also, in situations where an advanced level of security is desired, such as with brake lights, low-speed/fault-tolerant CAN offers a solution.
Single-Wire CAN Hardware
Single-wire CAN interfaces can communicate with devices at rates up to 33.3 kbit/s (88.3 kbit/s in high-speed mode). Other names for single-wire CAN include SAE-J2411, CAN A, and GMLAN. Typical single-wire devices within an automobile do not require high performance. Common applications include comfort devices such as seat and mirror adjusters.
Software-Selectable CAN Hardware
With National Instruments CAN hardware products, you can configure the software-selectable CAN interfaces to use any of the onboard transceivers (high-speed, low-speed/fault-tolerant, or single-wire CAN). Multiple-transceiver hardware offers the perfect solution for applications that require a combination of communications standards. With software-selectable CAN hardware, you also can choose your own external CAN transceiver.
CAN Programming in LabVIEW and Other Languages
NI-XNET Software Driver
NI-XNET software is included with PCI/PXI-851x and NI 986x devices and is available as a free download on ni.com. This new driver is used to develop CAN, local interconnect network (LIN), and FlexRay applications in NI LabVIEW, NI LabWindows/CVI, and C/C++ on Windows and LabVIEW Real-Time OSs. As part of the NI-XNET platform, NI 851x and NI 986x devices work well for applications requiring real-time, high-speed manipulation of hundreds of frames and signals, such as hardware-in-the-loop simulation, rapid control prototyping, bus monitoring, automation control, and more.
NI-XNET: One API, Many Embedded Networks
The NI-XNET platform combines a series of high-performance CAN, LIN, and FlexRay interfaces with the NI-XNET API, a common set of easy-to-use functions for reading and writing CAN, LIN, and FlexRay frames and signals.
Top Performance With Less Programming
NI-XNET interfaces bring together the performance associated with low-level microcontroller programming and the speed and power of Windows and LabVIEW Real-Time OS development. The patent-pending NI-XNET device-driven DMA engine reduces system latency, a common pain point for PC-based CAN interfaces, from milliseconds to microseconds. The engine enables the onboard processor to move CAN frames and signals between the interface and the user program without CPU interrupts, freeing host processor time for processing complex models and applications.
For more information about the benefits and applications of NI-XNET, refer to the NI-XNET CAN, LIN, and FlexRay Platform Overview.
NI-CAN Software Driver
National Instruments includes NI-CAN driver software with all National Instruments Legacy CAN interfaces and provides it as a free software download on ni.com. With other CAN interfaces, you can take advantage of only a small percentage of the board functionality if you do not purchase the turnkey software tool. However, all of the National Instruments CAN board functionality is fully exposed, so you can develop your own custom-defined applications in the programming language of your choice. The NI-CAN driver provides high-level, easy-to-use functions to help you develop entire CAN applications quickly, saving you both time and money.
There are two APIs exposed with the NI-CAN driver software. The Frame API is the original API for CAN programming. In the Frame API, you can transmit and receive CAN frames that contain raw data bytes. Your program must parse and scale these bytes to come up with scaled engineering units. For more information on programming with the Frame API, view the "Using the Frame API" section of the NI CAN Hardware and Software Manual.
NI first introduced the Channel API in the NI-CAN 2.0 driver software. You can read from and write to CAN channels using channel names defined in database files (.dbc or .ncd). The Channel API provides the following benefits:
- High-level programming
- Easy-to-use physical units
- Primary use for easy CAN/data acquisition synchronization
- Ability to incorporate Vector database files
For more information about programming with the Channel API, refer to NI-CAN Channel API documentation.