VC2005 - always CAN_ERR_QRCVEMPTY

CAN Development Packages for Windows®
Post Reply
BBretschek
Posts: 3
Joined: Tue 18. Jun 2013, 15:42

VC2005 - always CAN_ERR_QRCVEMPTY

Post by BBretschek » Tue 18. Jun 2013, 16:00

Hello,

I have the following problem:
We developped a CAN simualation. It sends and received CAN messages incl. UDS diagnostic messages.
I am using VC2005 MFC, because it is a very old project. The driver and api versions are:
peakcan.sys: 2.49.14.4542
pcan_usb.sys: 3.8.2.10146

If I build my application in debug mode, everything is working fine. I can read and send CAN messages.
If I build my application as "Release", the receive method CAN_Read always replies with
CAN_ERR_QRCVEMPTY 0x0020.

In this case I can send messages, but can not receive any.
Could you help here?

Thank you and kind regards

Berthold

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

Re: VC2005 - always CAN_ERR_QRCVEMPTY

Post by M.Maidhof » Tue 18. Jun 2013, 16:08

Hi,

which version of the canapi2.dll do you use?

regards

Michael

BBretschek
Posts: 3
Joined: Tue 18. Jun 2013, 15:42

Re: VC2005 - always CAN_ERR_QRCVEMPTY

Post by BBretschek » Wed 19. Jun 2013, 14:25

Hello,

I use 2.56.2.0

Berthold

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

Re: VC2005 - always CAN_ERR_QRCVEMPTY

Post by M.Maidhof » Wed 19. Jun 2013, 16:31

Hi,

it is the latest version. Please check with PCAN-Status Display the settings of your filter code and mask register. Maybe it will also be helpfull to contact us by phone to discuss that problem. Must be something wrong in your application.

best regards

Michael Maidhof

BBretschek
Posts: 3
Joined: Tue 18. Jun 2013, 15:42

Re: VC2005 - always CAN_ERR_QRCVEMPTY

Post by BBretschek » Thu 20. Jun 2013, 12:48

Hi,

it was the Client filter. I did not set the filter and this was the problem.
After adding the function CAN_SetClientFilter to the initialization sequence, everything
works fine.

Thank you for the hint

Kind regards

Berthold

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

Re: VC2005 - always CAN_ERR_QRCVEMPTY

Post by M.Maidhof » Thu 20. Jun 2013, 16:06

Hi,

thanks for the feedback. You could also use the CAN_RegisterMsg() API to open the filters in an user friendly way (message ID based).

regards

Michael

Post Reply