Timeout ? +problem with getting RX frames

The free CAN Software API (Application Programming Interface) for Windows®
Post Reply
rachedrech
Posts: 9
Joined: Mon 20. Mar 2017, 11:11

Timeout ? +problem with getting RX frames

Post by rachedrech » Fri 16. Jun 2017, 15:04

Hello everyone,

is there a way to detect a timeout when waiting for reception of a frame: I send a CAN frame ( some sort of command) and I am waiting for a response, and if I dont get a response, the program will go on forever)

Another thing, Sometimes the Peak CAN doesnt detect message but still able to send, even in PCAN Viewer, I always have to reconnect it to usb so it will detect incoming CAN frames again, i d like an explanation for that too please.

I am using the PCAN USB Pro .

Thanks.

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Timeout ? +problem with getting RX frames

Post by PEAK-Support » Fri 16. Jun 2017, 15:33

s there a way to detect a timeout when waiting for reception of a frame: I send a CAN frame ( some sort of command) and I am waiting for a response, and if I dont get a response, the program will go on forever)
No, this must be implemented in your code - simpl set the Filter up in front to read only the Msgs you are waiting for, and setup a Receive Event /Thread based receiving - see Help File and sample code.
Another thing, Sometimes the Peak CAN doesnt detect message but still able to send, even in PCAN Viewer, I always have to reconnect it to usb so it will detect incoming CAN frames again, i d like an explanation for that too please.
Looks like you didi not check the MsgType of the incomming CAN Data - you will see that you have errors on your BUS - check cable, termination etc.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

rachedrech
Posts: 9
Joined: Mon 20. Mar 2017, 11:11

Re: Timeout ? +problem with getting RX frames

Post by rachedrech » Fri 16. Jun 2017, 15:43

No it is all good, i have the CAN bus linking the microcontroller and the PCAN Pro
Even in PCAN viewer, it looks like that i dont receive anything and theres no Bus off or buss passive ... errors

This problem happens once in a while, not everytime but it's really bothering me and making it harder to detect it in my GUI

Thank you for the reply anyways ! :)

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Timeout ? +problem with getting RX frames

Post by PEAK-Support » Fri 16. Jun 2017, 15:54

TIP: Run your application and call CAN_Init(..) red LED is flahsing .. run PCAN-View and connect to the same HW (ignore warning) - now PCAN-View use the same Hardware as your Application and see all Messages that your Application see, you also could send from the PCAN-View data to your Application. Do not close PCAN-View when you finish your Application - if you restart your Application again, it will reconnect to the hardware without stop PCAN-View First.
This is a nice tool to debug your Application. You also could use the Tracer inside PCAN-View, set Logging features to "Error only" start logging - than you will only see massages in the trace windows when you have error frames on the bus.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

rachedrech
Posts: 9
Joined: Mon 20. Mar 2017, 11:11

Re: Timeout ? +problem with getting RX frames

Post by rachedrech » Fri 16. Jun 2017, 16:00

thank you for the reply, yes that's what I am doing actually, I open my application and PCANviewer to see all messages using the trace, but the problem is that the microcontroller sometimes sends a CAN frame but it won't be detected by neither of the two programs ( PCAN viewer and my program)

I guess it could be a bug in the driver

User avatar
PEAK-Support
Sales & Support
Sales & Support
Posts: 1646
Joined: Fri 10. Sep 2010, 19:34

Re: Timeout ? +problem with getting RX frames

Post by PEAK-Support » Fri 16. Jun 2017, 16:11

check it with a scope if you realy send out a "complete" CAN Frame.
--------------------------------
PEAK-System Technik
Technical Support Team
support[at]peak-system.com
-------------------------------

MarianP
Posts: 2
Joined: Tue 8. Apr 2025, 11:05

Re: Timeout ? +problem with getting RX frames

Post by MarianP » Tue 8. Apr 2025, 13:33

I have this problem. This tool from Tesla connects via Pcan to the car interface via CAN_H,CAH_L. They recommend this PCAN-USB peak device. And I have these time out errors that repeat.

****link removed by admin**** see forum rules!

MarianP
Posts: 2
Joined: Tue 8. Apr 2025, 11:05

Re: Timeout ? +problem with getting RX frames

Post by MarianP » Tue 8. Apr 2025, 17:11

MarianP wrote:
Tue 8. Apr 2025, 13:33
I have this problem. This tool from Tesla connects via Pcan to the car interface via CAN_H,CAH_L. They recommend this PCAN-USB peak device. And I have these time out errors that repeat.

Usage ID Attempt #1:Operation has timed out
Reading Sub Usage Id
Sub Usage Id Attempt #1:Operation has timed out

It tells me it is connected to the MCU but it does not read the values ​​in the tool.The RX errors are shown above

M.Maidhof
Support
Support
Posts: 1751
Joined: Wed 22. Sep 2010, 14:00

Re: Timeout ? +problem with getting RX frames

Post by M.Maidhof » Thu 10. Apr 2025, 09:39

Hi,

please contact the developer of that tool. We don't know this tool and can't tell you the reason for this problems.

regards

Michael

Post Reply