Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Read buffer Overflow error from ncReadObjMult

Hello...

 

i have a CANopen device that transmits PDO frames at the rate of 2048 frames/sec.

 

I have configured a PDO rx object on a NI-CAN 8461 Card with a read buffer of 100 frames. (I have NOT used the CANOpen library from NI)

 

if i read these frames typically in a loop with a loop time of every 20 msec, i should not get the buffer overflow as the #PDOframes will be much less than 100 frames in 20 msec.

 

but i am getting after few reads the buffer is accumulated and shows that there is a buffer overflow. I am using 'read entries pending' attribute to know how many frames in the buffer to be read. and i use 'ncReadObjMult' VI to read those frames. I assume the read buffer is cleared after every read. it is appearantly not cleared. Is it?

 

 

if not, how can clear the read buffers everytime so that i would not get 'buffer overflow error'

 

and also...is there any link that the read buffer of a network and read buffer of PDO object? (i am setting the read buffer of CAN Network to be 100). Is it necessary to set it even though i do not use the netwrok handle?

0 Kudos
Message 1 of 9
(7,850 Views)

If you use an object for your PDO, there is no need to configure a buffer for the Network Interface Object (Port).

Can you see any increase in "entries pending" before the buffer overflows. It might be enough to increase the object buffer to 150, or you could use the network interface read mult which is mor performant then the object one.

Could you post the error HEX number for the overflow?

 

DirkW

0 Kudos
Message 2 of 9
(7,845 Views)

Hi DirkW,

 

i have tried the option of increasing the buffer size and tried monitoring the frames read.

 

after few reads, the pending entries of the attribute VI is always 150 (max buffer size i configured). This gives me a doubt that the messages on the network might be ignored by the CAN Card because of the buffer-full and the driver is not giving me the buffer overflow error (BFF62028),

 

My point is that when the buffer is not overflown, the 'pending entries' shall always be less than the read buffer size. right?

 

the important is that the CAN Card i am using have 2 ports and 1 port is used for the above module.

2nd port is used for listening to a different Network. (the network is a CANOpen based but i use message VIs and process the data to find out the objects. this is just for your information)

 

 

 

i am not able to test the module in real environment (not ready yet), 

 

how can i believe that the buffer is not overflowing?

 

 

0 Kudos
Message 3 of 9
(7,836 Views)

Hi,

The BFF62028 is no good news. This overflow happens at board level already and that means the onboard processor is not able to handle all incoming frames fast enough.

The reason could be the traffic at the other port, because the processor handles both ports at the same time.

if you just use one port, the overflow situation might go away. If that is the case only a second board can fix this situation.

 

DirkW

 

0 Kudos
Message 4 of 9
(7,828 Views)

oh Dirkw,

 

i have another problem if i use a second board.

 

As i discussed with you in my earlier threads, i am synchronizing both the ports with a M-series DAQ Card. if i use to different boards and take the start trigger frame from each board, they differ by 6-10 msec which is not acceptable in my application.

this is the reason why i am using 2 ports from the same board that gives me the differenece is in few microseconds.

 

i am afraid the listen port may have to listen to PDO frames of a CANOpen Node and would get this buffer overflow...

 

i am left high and dry.

 

i even contacted NI support. they hate to come back on why the difference is more when i use CAN port from different boards.

 

thanks for your extended help...

 

0 Kudos
Message 5 of 9
(7,817 Views)

Hey Share_Good!

Just out of curiosity, were you able to get the application to work with 2 can boards?  We want to be able to isolate your problem.  Also, the differing 6msec speed while using trigger from 2 different CAN cards is very interesting.  I can't say I have seen that myself; however, I will try to test this out.  

Best Regards,
Song Mu
National Instruments San Diego
0 Kudos
Message 6 of 9
(7,793 Views)

Hello SongM,

 

good to see the reply. my application works with 2 CAN boards also...infact the application i built is from NI example 'Synchronizing multiple CAN Ports with DAQ'

 

so it works.

 

i have tested it with 2 ports on a single CAN Board and 2 ports on different CAN Boards. I have even contacted NI INDIA support. they were initially in touch with me.

 

they have suggested me to use Start Trigger Board which according to me is not required because i dont want sychronization delays in terms of ns. (and also i dont have spare slot)

 

it is ok for me to tolerate us delays. i expected this with the RTSI triggering.

 

But it did not work if i select 2 ports from different boards - the delay i observed is 6-10 msec (i dont think the clock propogation delay would be in msec)

it does work if i select 2 ports from a same board - the delay is 70 us all the time (which is acceptable for me)

 

The delay i mean is the difference of time-stamp of 'start trigger frame' of both the ports.

hope you woul test it and come back as soon as possible.

Thanks...

 

I am attaching the code for your reference

 

 

0 Kudos
Message 7 of 9
(7,790 Views)

Hi,

 

I remember your last post regarding the timestamp difference for two boards/2 ports compared to one board/2 ports. I answered your question back then and didn't get any answer from you.

Now it seems you have not even read the post.

See the answer here again.

 

DirkW

0 Kudos
Message 8 of 9
(7,781 Views)

Hi Dirkw,

 

i am sorry for not coming back...

 

but i have later tried calling ncOpen vi in parallel for each port. if you the code that i have attached recently, you will notice that.

i assume ncOpen vi shall run in parellel for both the ports as the ncOpen vi is a reentrant VI. please correct me if i am wrong.

 

but with the modified code, i do get same results.

 

can you plesae look at it once?

 

 

0 Kudos
Message 9 of 9
(7,771 Views)