Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there a C Interface to the Bus Monitor Bus Statistics for PXI-8512 CAN board?

I am using a PXI 8512 CAN board in a PXI-1044 system.   I have two C programs, one that runs on our product board (running ARM-based Linux), and the other running on the NI PXI-1044 system.  CAN frames are sent/received between these two programs over a CAN cable harness.   While these programs are running and talking to each other, I can bring up the Bus Monitor via MAX and see the bus statistics.  What I want is to be able to get these statistics in the C program that runs on the NI box.   That way I can produce various statistics in a report, such as the bus loading level at which CAN frmes are dropped, what was the average frames/sec in the run, etc.

The C program on the NI box uses the NI-XNET interface to program the PXI-8512.  I have tried to look through the NI-XNET properties but have not found any that look like what I want.   Could this interface be through VISA, which I am not quite up to speed on yet?   My thinking is that Bus Monitor must be getting these statistics somewhere and I'd like to do the same thing programmatically.

 

Thanks,

Tony

0 Kudos
Message 1 of 2
(2,776 Views)

What I am trying to do is characterize the performance of the CAN bus on our product in two scenarios: read throughput and write throughput.  I just got this NI box 2 weeks ago and have never worked with one before, however, I have done a lot of hardware validation in the past, so I am familiar with all the concepts.

 

As I try to develop the CAN robustness tests for our product, I found the following:

In this performance scenario you do not want to run the bus monitor at the same time as your test program is running or it will cut the frame rate down by a large factor (10 or 15).   Because of that, it's statistics aren't even accurate.  

So, I decided to roll my own.  When doing the receive test (the UUT is receiving, the PXI-1044 is transmitting), I prebuild all the frames in a buffer, then I call QueryPerformanceCounter before sending the frames, after all frames are sent, I call QueryPerformanceCounter again and use QueryPerformanceFrequency to get the wallclock time taken.   I use this as a rough measure of the bus loading. Averaged over many runs, It takes approximately 50 seconds to send 100,000 frames (without any drops), which gives a bus loading estimate of 2000 frames per second, which is about 80% bus load average on a hi-speed CAN bus (250,000 kbps).    With Bus Monitor running, this same run takes over 500 seconds on average. 

 

In conclusion I will calculate my own statistics.

0 Kudos
Message 2 of 2
(2,764 Views)