Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

XNET CAN frame lost randomly

Hello,

 

I have a custom app that implements a UDS service over XNET, through a C# wrapper of the basics XNET functions, over a CAN-HS/FD interface USB 8502.

 

The application works fine, however, recently I started to noticing some missing frames that forces me to retry request randomly.

 

In order to debug the problem, I've been using bus monitor on the same USB using the subordinate mode, and also a second USB-8502 connected to the same first CAN via a T-cable. With this setup, I found that the missing frames are present in the net, as the second USB-8502, the external sniffer, is able to seeing them. However, in the original USB, these frames are not seeing neither by my custom app or the bus monitor, as the following attach shows:

 

BusMonitorBusMonitor

 

As anyone experience similar problems with XNET applications?

 

Best regards,Javier.

 

0 Kudos
Message 1 of 4
(3,513 Views)

I haven't had this exact issue, but I have had cases where my code sees the response late on NI-9860's (too late for its 500 ms timeout - I am using Queued Frame Input/Output sessions), but the response shows up in CAN logs as being less than 10 ms after the command.  This issue seems to be at least somewhat related to the CPU load (and seems more prevalent on Dell computers).

Is it possible that your code/Bus Monitor is actually receiving the response a second or two after you give up waiting for it - possibly immediately before it receives the response for the next request?

 

Note the >500ms gap between the two 773 writes despite the immediate response.  The timed out message has a later timestamp than its order in the log because it uses a Windows timestamp, while all the other lines use the XNET hardware timestamp.

2019-09-22 00:30:00.621 CAN FD+BRS Data 773 Write
2019-09-22 00:30:00.625 CAN FD+BRS Data 673 Read
2019-09-22 00:30:01.542 First Frame or Single Frame Timed Out    
2019-09-22 00:30:01.318 CAN FD+BRS Data 773 Write
2019-09-22 00:30:01.322 CAN FD+BRS Data 673 Read

 

This is in contrast to normal communications

2019-09-22 00:30:02.251 CAN FD+BRS Data 773 Write
2019-09-22 00:30:02.252 CAN FD+BRS Data 673 Read
2019-09-22 00:30:02.377 CAN FD+BRS Data 773 Write
2019-09-22 00:30:02.383 CAN FD+BRS Data 673 Read
0 Kudos
Message 2 of 4
(2,791 Views)

Hello TomOrr0W,

 

Thanks for your reply.

 

I've been cheking my cpu consumption while running the test, and while is somewhat high,as teststand uses 30% of the cpu according to windows task manager, and considering the rest of applications running, the total load of the system seems to be around 60%. Cheking the cpu cores individually via resource monitor the results are the same, having no core over 75% of capacity, so I assume that shouldn't be the problem.

 

Besides, I also tested with a bigger timeout, expecting the response for 1 minute(which will violate the timeout defined by the protocol, but interesting to diagnose the issue) and the missing frame never arrived, is like it is being discarted by the CAN interface, but I don't know why.

 

 

0 Kudos
Message 3 of 4
(2,742 Views)

Hi JaviRubio,

 

It sounds like your issue and my observations aren't related, then.  Hopefully someone from NI can help further.

0 Kudos
Message 4 of 4
(2,728 Views)