UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

A free API for the communication with control devices according to UDS (ISO 14229-1)
Locked
fabio.parodi@technoleader.it
Posts: 21
Joined: Thu 28. Apr 2022, 14:48

UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by fabio.parodi@technoleader.it » Thu 4. May 2023, 12:54

Sometimes function UDSApi.Initialize_2013() fails with code PUDS_STATUS_NOT_INITIALIZED.
Arguments: channel = cantp_handle.PCANTP_HANDLE_USBBUS1 .. 16; baudrate = PCANTP_BAUDRATE_250K.

The PCAN-VIEW is connected installed and working, PCAN-VIEW is just fine, showing the messages on the line.
However the function UDSApi.Initialize_2013() fails.

When it fails, calling the function again does not solve. Also restaring the application does not solve. Also removing the interface and plugging-in again does not solve.
Sometimes restarting the PC solves the problem temporary; however it may happen again at any randome time.
Just wondering if someone has seen this problem before.

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by F.Vergnaud » Thu 4. May 2023, 14:38

Hello Fabio,

Unfortunately I've never seen this issue. When this occurs, could you try connecting to that device/channel with PCANBasicExample.exe included in the PCANBasic package?
This will help us to know if the problem lies in the higher API or not.
Thank you.
Best regards,
Fabrice

fabio.parodi@technoleader.it
Posts: 21
Joined: Thu 28. Apr 2022, 14:48

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by fabio.parodi@technoleader.it » Thu 4. May 2023, 15:44

Thanks for answering.
I downloaded and launched PCANBasicExample.exe.
The dropdown list on the top-left shows PCAN_DNG (31h) and PCAN_ISA 1 to 8. The USB interface is not listed. Clicking the button "initialize" I get the error "driver not loaded".
Now I will reboot the PC and try again
Fabio

fabio.parodi@technoleader.it
Posts: 21
Joined: Thu 28. Apr 2022, 14:48

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by fabio.parodi@technoleader.it » Fri 5. May 2023, 08:42

Some more info.

The application was calling Initialize_2013 and Uninitialize_2013 several times during operation. After many calls, something bad happens in the lower layer and you must reboot windows. However PCAN-View keeps working.

Another way to reproduce the problem is calling Initialize_2013 and then terminating the application without calling Uninitialize_2013. I am using visual studio and terminate the application through the debugger. Do that a few times and Initialize_2013 will start returning PUDS_STATUS_NOT_INITIALIZED and you must reboot windows.

I've changed the application, now I am calling Initialize_2013 just one time at the beginning, then I make sure to call Uninitialize_2013 before to exit. This way my application is usable; as long as the user do no terminate the application with the task manager.

I came to the conclusion that ther must be a bug in some of the layers: peak libraries or drivers, I do not know. If someone in PEAK wants to dig deeper, understand and fix, I am willing to support with testing, experiments, ...

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by K.Wagner » Fri 5. May 2023, 09:26

Hello,
fabio.parodi@technoleader.it wrote:
Fri 5. May 2023, 08:42
I came to the conclusion that ther must be a bug in some of the layers: peak libraries or drivers, I do not know. If someone in PEAK wants to dig deeper, understand and fix, I am willing to support with testing, experiments, ...
yes, we are always interested to find and fix any problem that our APIs may have.
fabio.parodi@technoleader.it wrote:
Fri 5. May 2023, 08:42
Another way to reproduce the problem is calling Initialize_2013 and then terminating the application without calling Uninitialize_2013. I am using visual studio and terminate the application through the debugger. Do that a few times and Initialize_2013 will start returning PUDS_STATUS_NOT_INITIALIZED and you must reboot windows.
We didn't manage to see the problem by trying this. Probably we are not doing the same. Could you provide us with a minimalistic test-project for problem reproduction and a description of how the CAN environemnt should be to get the error (sening/writing, bitrate, etc)?

Thanks in advance for your help on this.
Best regards,
Keneth

fabio.parodi@technoleader.it
Posts: 21
Joined: Thu 28. Apr 2022, 14:48

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by fabio.parodi@technoleader.it » Tue 9. May 2023, 15:12

minimalistic test-project attached
Attachments
bugreport-2023-05-09-fp.zip
(2.29 MiB) Downloaded 980 times

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by K.Wagner » Thu 11. May 2023, 09:41

Hello,

thanks for the test-project.
Best regards,
Keneth

F.Vergnaud
Software Development
Software Development
Posts: 305
Joined: Mon 9. Sep 2013, 12:21

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by F.Vergnaud » Fri 13. Oct 2023, 10:12

Issue fixed in PCAN-ISO-TP v3.5.0 and PCAN-UDS v2.3.1.
Best regards,
Fabrice

K.Wagner
Software Development
Software Development
Posts: 1080
Joined: Wed 22. Sep 2010, 13:36

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Post by K.Wagner » Fri 13. Oct 2023, 10:24

Closed.
Best regards,
Keneth

Locked