Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

Read rate is very slow when Write and read CAN FD frames at same time

I am trying to write and read CAN FD frames for my ECU by using the USB-8502. The following picture shows my program.

However I get a problem that the speed of read CAN FD from my ECU is very slow and actually my ECU will send out message in 100ms per frame. Then I use CANoe(vector) to read the CAN FD message at the same time, CANoe can get all the message from my ECU and at a correct rate. So I can get the result that write CAN FD is successful of my program. 

Could you help me to find the problem in my program.

And I also have another question: When I use CANoe write and read CAN FD message, and also use NI bus monitor to read the message from CAN bus which will stop the CANoe project. I don't know why.

 

image.png

0 Kudos
Message 1 of 4
(5,565 Views)

Well, you have a 100ms sleep in each loop. That will limit the frequency of writing a can frame to one per 100ms.

0 Kudos
Message 2 of 4
(5,542 Views)

Thank you for your reply.

However, I modified the loop time to 20ms, the speed of read message is still very slow, like one message 3s and very random.

0 Kudos
Message 3 of 4
(5,529 Views)

Hey, you problems seems odd but found this information. Perhaps you could double check your sampling points.

 

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z000000P7mDSAS&l=en-US

 

Juan Navarro
0 Kudos
Message 4 of 4
(1,950 Views)