Example Code

NI-CAN CAN Receive with Bus Load Monitoring

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Hardware

  • Industrial Communication

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This example demonstrates how to receive CAN frames via the Network Interface. 

Description

It also calculates the bus load as done in Measurement & Automation Explorer's Bus Monitor.

Requirements

LabVIEW 8.6 "or compatible"

NI CAN 2.3.6 "or compatible"

Steps to Implement or Execute Code

1.) Download and open the attached example

2.) Select your CAN device and Baudrate

3.) Run the LabVIEW example

Additional Information or References

This example displays the same arbitration ID on multiple lines if it is received more than once.  If you would like formatting like Measurement & Automation Explorer's Bus Monitor, refer to CAN Receive Frame and Display Current Arbitration Data Instead of Multiple Lines.  This example uses the Frame API.  NI-CAN driver must be installed as well.

**This document has been updated to meet the current required format for the NI Code Exchange. For more details visit this discussion thread**

CAN Receive with Bus Load Monitoring_LV86_FP.jpg

CAN Receive with Bus Load Monitoring_BD.jpg

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
johny_smith
Member
Member
on
can u please suggest me where i can find missing sub vi files for this code
Ken-This-is-my-stinking-a
Member
Member
on
I would like to see the information on the calculation, is there any way of getting that? I use Lab Windows, so please don't reply with Lab View stuff. Also, the calculations that Bus Monitor uses is way off. Has someone ever looked at that, and measured what Bus Monitor reports versus something else, like Vector CANalyzer? Here is a table I made showing the NI Bus Monitor bus load percentages compared to the Vector CANalyzer bus load percentages: NI Vector 44 83.5 37 69.7 33 63 29 55.7 22 41.7 15 27.8 11 20.8 7 13.9 4 8.4
Contributors