Page 1 of 1

UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Thu 4. May 2023, 12:54
by fabio.parodi@technoleader.it
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.

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Thu 4. May 2023, 14:38
by F.Vergnaud
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.

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Thu 4. May 2023, 15:44
by fabio.parodi@technoleader.it
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

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Fri 5. May 2023, 08:42
by fabio.parodi@technoleader.it
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, ...

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Fri 5. May 2023, 09:26
by K.Wagner
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.

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Tue 9. May 2023, 15:12
by fabio.parodi@technoleader.it
minimalistic test-project attached

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Thu 11. May 2023, 09:41
by K.Wagner
Hello,

thanks for the test-project.

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Fri 13. Oct 2023, 10:12
by F.Vergnaud
Issue fixed in PCAN-ISO-TP v3.5.0 and PCAN-UDS v2.3.1.

Re: UDSApi.Initialize_2013 fails with PUDS_STATUS_NOT_INITIALIZED

Posted: Fri 13. Oct 2023, 10:24
by K.Wagner
Closed.