Converting Frames To and From Channels (Signals)
- Updated2025-10-09
- 3 minute(s) read
The CAN Input and CAN Output nodes in LabVIEW FPGA access CAN data as frames. Frames are the raw unit of transfer on the CAN bus.
For some applications, it is useful to access CAN data as channels, also
known as signals.
- A CAN channel represents a field in the data of a frame with specific CAN identifier.
NI-CAN is the software for National Instruments PCI, PXI, and PCMCIA cards for CAN. The NI-CAN software provides features to enable conversion of CAN frames to/from channels. This frame to channel conversion can be used with the CompactRIO CAN module, even if you do not use an NI CAN PCI, PXI, or PCMCIA card.
The NI-CAN software is supported on Windows as well as LabVIEW RT controllers. upported LabVIEW
RT controllers include:
- Any PXI controller
- cRIO-9002 CompactRIO Real-Time Controller
- cRIO-9004 CompactRIO Real-Time Controller
Some examples of CompactRIO applications that use NI-CAN frame to channel conversion:
- Logging: The rugged enclosure and real-time capabilities of CompactRIO make it an ideal product for data logging in the field, such as drive testing of an automobile. For logging applications, the LabVIEW application on CompactRIO is simple: read CAN frames and store them in a file. When the CAN log file is later transferred from CompactRIO to a lab computer (usually running Windows), the application on the lab computer can read frames from the log file, and use NI-CAN to display the frames as CAN channel waveforms. In addition, if the LabVIEW application on CompactRIO stores a second log file with analog/digital samples, that data can be displayed on the lab computer as waveforms synchronized with the CAN channels.
- Triggering/Filtering: In a logging or other test application, you may need to evaluate CAN data to trigger some other task. For example, you may want to log a 5 second window of CAN/analog data when the "rpm" channel in CAN ID 5 first exceeds 4000 RPM. Although you could evaluate the raw data in CAN ID 5 to trigger the log, in some cases it is easier to simply evaluate the channel named "rpm" as defined in a CAN database. By installing NI-CAN on a CompactRIO Real-Time Controller such as the cRIO-9004, you can transfer CAN frames to NI-CAN, then read the "rpm" channel to detect when the value is greater than 4000.00.
- Prototyping/Simulation: For applications in which you must execute a control model within the CompactRIO Real-Time Controller, you typically wire CAN channels as inputs and outputs to the control model. In order to implement this, you can install NI-CAN on the CompactRIO Real-Time Controller. Your LabVIEW FPGA VI reads and writes CAN frames, and transfers those CAN frames to/from LabVIEW RT as you would any other I/O. Your LabVIEW RT VI uses NI-CAN to convert the CAN frames to/from CAN channels, which are then wired into the control model.