UDSApi.Initialize too much time?

A free API for the communication with control devices according to UDS (ISO 14229-1)
Cappo
Posts: 14
Joined: Wed 19. Dec 2018, 14:19

UDSApi.Initialize too much time?

Post by Cappo » Wed 19. Dec 2018, 14:32

Hello,

When I call function UDSApi.Initialize I receive response after about 30s.
The version of API are:
PCANBasic.dll -> 4.3
PCAN-ISO-TP.dll -> 2.0
PCAN-UDS.dll -> 1.3

The C# code is:

Code: Select all

UInt16 channel = UDSApi.PUDS_USBBUS1;
TPUDSStatus status;
status = UDSApi.Initialize(channel, TPUDSBaudrate.PUDS_BAUD_500K,0,0,0); /* here too much time*/
uint iBuffer = UDSApi.PUDS_SERVER_ADDR_TEST_EQUIPMENT;
status = UDSApi.SetValue(channel, TPUDSParameter.PUDS_PARAM_SERVER_ADDRESS, ref iBuffer, 1);
UDSApi.Uninitialize(channel);
It seems the same problem of this thread https://www.peak-system.com/forum/viewt ... 181&t=2123 but I have the last library


Have you an idea?

Thanks
Cappo
Last edited by M.Gerber on Fri 4. Jan 2019, 09:13, edited 1 time in total.
Reason: Inserted code tag for improved readability

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

Re: UDSApi.Initialize too much time?

Post by K.Wagner » Wed 19. Dec 2018, 15:16

Hello,

well, we cannot reproduce this. Regarding the versions you are listing, please check the third version number of each. The current releases are:
  • PCAN-Basic: 4.3.1.158 (13.12.2018)
  • PCAN-ISO-TP: 2.0.3.111 (07.12.2018)
  • PCAN-UDS: 1.3.1.30 (01.03.2018)
If you have older versions of any, then update these and try again. If the problem persists it will helpful to know which operating system and platform you are using.
Best regards,
Keneth

Cappo
Posts: 14
Joined: Wed 19. Dec 2018, 14:19

Re: UDSApi.Initialize too much time?

Post by Cappo » Wed 19. Dec 2018, 15:35

Hello,

I have this releases:
PCAN-Basic: 4.3.1.158 (13.12.2018)
PCAN-ISO-TP: 2.0.3.111 (07.12.2018)
PCAN-UDS: 1.3.1.30 (01.03.2018)

PCAN-USB FD - IPEH-004022

I'm using:
Windows 10 Pro for Workstations 64 bit
Visual Studio Professional 2017
.Net Framework 4.6.1

If I use only PCAN-Basic I have no problem, all works fine.

Thanks and Reagrds
Cappo

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

Re: UDSApi.Initialize too much time?

Post by K.Wagner » Wed 19. Dec 2018, 16:36

Hello,

just tested with the same constellation as you... I still don't see the problem.

First a Windows 10 Pro 64-Bit (old Hardware). Average of Initialize is 185ms:
System A
System A
SystemA.PNG (20.33 KiB) Viewed 81061 times
Running the Test App:
Test on System A
Test on System A
SystemA_Time.PNG (32.63 KiB) Viewed 81061 times
Tested in a developing-PC, Windows 10 Enterprise (newer Hardware). Average of initialize is 60ms:
System B
System B
SystemB.PNG (22.3 KiB) Viewed 81061 times
Running the Test App (debugging with Visual Studio 2017):
Test on System B
Test on System B
SystemB_Time.PNG (19.13 KiB) Viewed 81061 times
I'm using the same versions you have, Visual Studio 2017, and also a PCAN-USB FD hardware. Please check if your PCAN device is up to date (current firmware is v3.2.0 - you can check this using the PCAN-View / PCAN-USB FD Tab), and also the device driver version (current is v4.1.4 - via Device-Manager or Peakcpl in the control panel).

Do you have any other device from us for testing? Could you test in a different computer and see if the behavior is reproducible?
Best regards,
Keneth

Cappo
Posts: 14
Joined: Wed 19. Dec 2018, 14:19

Re: UDSApi.Initialize too much time?

Post by Cappo » Thu 20. Dec 2018, 17:44

Hello,

I have found the problem... is the internet connection. We use a Proxy and we can surf on internet only by the browser. If I disable ethernet card the software works fine, if I enable ethernet card the software doesen't work. It possible the your library try to connect to internet? And how can I resolve this problem without disable the ethernet card?

Thanks
Cappo

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

Re: UDSApi.Initialize too much time?

Post by K.Wagner » Fri 21. Dec 2018, 10:13

Dear,
Cappo wrote:It possible the your library try to connect to internet?
Our libraries don't have any access to internet, or LAN/Wifi. Though, we use the functions hton/htos for Big-Endian value conversions. These functions are in the Winsock2 library from Windows.
Cappo wrote:We use a Proxy and we can surf on internet only by the browser. If I disable ethernet card the This is software works fine, if I enable ethernet card the software doesn't work.
This is definitely not a PEAK-System problem. Note that the tests I did were done in computers with internet connection (also through an Ethernet card). Your PC has a kind of special configuration that is slowing down the load of some Windows libraries.

As I remarked before, the only network related operations are bytes movements in some variables. This seems to be a problem in your PC configuration. It would mean that only loading the Winsock2 [/b]library takes 30 seconds on your PC! (Seems to be a "network timeout" for me).
Cappo wrote: how can I resolve this problem without disable the ethernet card?
Since the htonl and htons functions are pretty simple to implement, we could just avoid using those defined in Winsock2. This will principally help the API to start normally on your system, but sooner or later you will have another application or API that cannot be easily changed. So, please check your configuration or try on another computer as I suggested.

We can provide you with a version of the PCAN-UDS.dll, that not loads the Winsock library, for testing purposes. Please let me know if you are willing to test the adjusted library.
Best regards,
Keneth

Cappo
Posts: 14
Joined: Wed 19. Dec 2018, 14:19

Re: UDSApi.Initialize too much time?

Post by Cappo » Fri 21. Dec 2018, 11:35

Dear Keneth,

thanks for support. In another two computer (totaly different model) with the same network configuration is the same situation. Now we know the problematic setup condition and we try to find a definitive solution inside our company. For now if is possible to have a modded library for internal use during the pahse of problem solving.

Only for your information the lan configuration is:
Windows lan settings only for internal LAN without internet access, so the system can not surf on internet (for internal security reason)
Browser with proxy settings (for web surfing)

Have a nice Holiday
Kind Regards
Cappo

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

Re: UDSApi.Initialize too much time?

Post by K.Wagner » Fri 21. Dec 2018, 14:04

Hello,

if these are workstation similar to your, then it is an indication for a general configuration problem. Some company policies can cause problem in diverse software.

We have sent you an email with a download link for the test version. PLease let us know if you received it and if the delay time is gone.
Best regards,
Keneth

vddvss
Posts: 10
Joined: Wed 12. Jun 2019, 10:21

Re: UDSApi.Initialize too much time?

Post by vddvss » Wed 12. Jun 2019, 10:42

Hi,

My name is Balazs Bornyasz, I am implementing test systems using PEAK CAN products for products featuring CAN interfaces.
I have almost the exact same problem on my system.

Details:
CAN HW:
PCAN-PCI Express FD (4 Channels) Firmware 3.2.1

Driver: Pcan_pci.sys Version: 4.1.4.16279

APIs:
PCANBasic.dll 32 bit Version: 4.3.0.150
PCAN-UDS API: Version: 1.2 (32 bit), File Version: 1.2.1.18
PCAN-ISO-TP API: Version: 1.4 (32 bit) File Version: 1.4.3.53

OS: Windows 10 Pro 64 bit
Development environment for wrapper DLL: MS Visual Studio 2015

Problem sympthome:
When ethernet is connected on PC - only company intranet, no internet access - the initialisation takes about 30 seconds. When the same HW + SW setup is connected to an ethernet newtork, that has Internet access, it works as fast as possible (couple of 100ms).

Mr. K.Wagner gave this hint about the usage of htonl and htons functions in Winsock2 library, I have to investigate this, and as part of this investigation, could I also get this modified DLL for trial in my system please? I use my wrapper written in C# in MS Visual studio to interface to UDS DLL and ISO-TP DLL.

Thank you and Best Regards:
Balazs

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

Re: UDSApi.Initialize too much time?

Post by K.Wagner » Wed 12. Jun 2019, 11:17

Hello,

all APIs you are using are being updated and released. Please update the files and try again.

Check the changes history of the APIs
Downloaded the new versions from our website or from our Product-DVD online (Develop\PC Interfaces\Windows\HighLayerProtocols).
Best regards,
Keneth

Locked