LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find the current CAN BUS Utilization in Labview?

Hi,

 

I want to detact the Current CAN BUS utilization. Can any body suggest for that?

0 Kudos
Message 1 of 12
(4,577 Views)

Are you using NI-CAN or NI-XNET?  The implementation should be slightly different depending on which you are using.

 

If you don't need to do this programmatically you should be able to look at the bus monitor.

Matt J | National Instruments | CLA
0 Kudos
Message 2 of 12
(4,569 Views)

Hi Matt,

 

can you show us an implementation for both drivers? (Mainly I'm interested in NI-CAN, but maybe I switch to XNet in the future…)

 

Or are there any AppNotes / KB articles an exactly that topic?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 12
(4,555 Views)

This question would probably be better suited at the Automotive Networks section.

 

http://forums.ni.com/t5/Automotive-and-Embedded-Networks/bd-p/30

 

Even so I've never seen a LabVIEW implmenetation for NI-CAN or XNET that actual measured bus load.  Which is a little odd because the test panels in MAX have this feature.  For me I usually put another node on the bus and measure it this way as a test.  But if I wanted to know what it is from a VI the best that I know of is you can calculate it.  There is a VI burried that does the math for you.

 

This VI can calculate how long it will take to transmit a frame, and how many frames per second can be sent.  Using this information you can calclate bus load of your actual messages.

 

<LabVIEW>\examples\CompactRIO\Module Specific\NI 985x\cRIO CAN Periodic Transmit\CAN Rate Calculator.vi

0 Kudos
Message 4 of 12
(4,482 Views)

I'm really not sure how you would do this programmatically but just using the bus monitor you can get a decent idea of your bus load.  For me, I find it is usually good enough for simple troubleshooting to know approximately how much your bus load is.  For NI-CAN you can do the following.

 

http://digital.ni.com/public.nsf/allkb/567C4038A2CD279486256FCC00565D07

 

The XNET bus monitor can be launched from the start menu.  I couldn't find a KB but I took a screenshot of what it looks like for me (I don't have anything set up so it's blank).

 

XNET Bus Load.png

 

Hooovahh, that's a neat tool to know about (I think I can use it for an issue I'm currently working on thanks).  I haven't been working with CAN for a terribly long time so could you enlighten me as to some reasons you would want to know the bus load programatically?  It seems like a nice to know thing but how would you use that info?

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 12
(4,475 Views)

@Jacobson-ni wrote:

 

I haven't been working with CAN for a terribly long time so could you enlighten me as to some reasons you would want to know the bus load programatically?  It seems like a nice to know thing but how would you use that info?


My UUT has multiple CAN buses, and there is a requirement that each bus load loaded to a simailar amount.  Right now we do small checks like what you showed by opening the test panel temporarily.  But what would be more tracable is if the bus load was a recorded value in a report.

Message 6 of 12
(4,465 Views)

Thanks for the reply.  

 

As someone who doesn't get to go through the design process of larger systems it is nice to get some insight.

Matt J | National Instruments | CLA
0 Kudos
Message 7 of 12
(4,455 Views)

I've been doing some work recently with software that uses two CAN buses - I think with CAN it's recommended that the CAN bus loading is under about 70% to avoid missing messages due to arbitration/conflicts on the bus so it's a useful statistic to have to verify you're not overloading the bus. Also, most other CAN tools I've used allow you to see this - Kvaser CANKing and PCAN Explorer.

 

Plus, it can also help you see at a glance if a device or part of the CAN bus isn't working - if you're used to seeing 50% utilisation and it suddenly drops to 10%, there's a good chance that either some devices are unpowered or there's a break in the CAN bus.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 8 of 12
(4,435 Views)

Hi,

I am using NI-XNET.  I want to use in labview program.

Regards,

Ajeet Kumar

0 Kudos
Message 9 of 12
(4,316 Views)

@Ajeet_Kumar wrote:

 

I am using NI-XNET.  I want to use in labview program.


Then do it what's the problem?

 

On a more serious note if English isn't the language you are most comfortable with feel free to post in another subforum for your most native speaking language.

 

Another suggestion is to make your own post instead of continuing one that isn't relavent to your question.

 

And if you do post please follow the guidelines linked in my signature.  Use clear sentences, and provide as much information as possible.

0 Kudos
Message 10 of 12
(4,303 Views)