Page 1 of 2
UDSApi.Initialize too much time?
Posted: Wed 19. Dec 2018, 14:32
by Cappo
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
Re: UDSApi.Initialize too much time?
Posted: Wed 19. Dec 2018, 15:16
by K.Wagner
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.
Re: UDSApi.Initialize too much time?
Posted: Wed 19. Dec 2018, 15:35
by Cappo
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
Re: UDSApi.Initialize too much time?
Posted: Wed 19. Dec 2018, 16:36
by K.Wagner
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
- SystemA.PNG (20.33 KiB) Viewed 81063 times
Running the Test App:

- Test on System A
- SystemA_Time.PNG (32.63 KiB) Viewed 81063 times
Tested in a developing-PC, Windows 10 Enterprise (newer Hardware). Average of initialize is 60ms:

- System B
- SystemB.PNG (22.3 KiB) Viewed 81063 times
Running the Test App (debugging with Visual Studio 2017):

- Test on System B
- SystemB_Time.PNG (19.13 KiB) Viewed 81063 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?
Re: UDSApi.Initialize too much time?
Posted: Thu 20. Dec 2018, 17:44
by Cappo
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
Re: UDSApi.Initialize too much time?
Posted: Fri 21. Dec 2018, 10:13
by K.Wagner
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.
Re: UDSApi.Initialize too much time?
Posted: Fri 21. Dec 2018, 11:35
by Cappo
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
Re: UDSApi.Initialize too much time?
Posted: Fri 21. Dec 2018, 14:04
by K.Wagner
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.
Re: UDSApi.Initialize too much time?
Posted: Wed 12. Jun 2019, 10:42
by vddvss
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
Re: UDSApi.Initialize too much time?
Posted: Wed 12. Jun 2019, 11:17
by K.Wagner
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).