K8055D.dll Problem with Windows resources

The function SearchDevices has a problem with Windows resources. I am using Windows XP. I wrote a basic programm with calls this function at regular times.
After some time a CPU overload is happening.
Using the Windows task manager I found that the number of handles is increasing with each call of the function SearchDevices and also the CPU load is increaded with every call.
I have used the K8055D.dll in version 4.0.0.0. I also loaded now the DLL with version 5.0.0.0, the problem ist still existing.

[quote=“pdebruin”]The function SearchDevices has a problem with Windows resources. I am using Windows XP. I wrote a basic programm with calls this function at regular times.
After some time a CPU overload is happening.
Using the Windows task manager I found that the number of handles is increasing with each call of the function SearchDevices and also the CPU load is increaded with every call.
I have used the K8055D.dll in version 4.0.0.0. I also loaded now the DLL with version 5.0.0.0, the problem ist still existing.[/quote]

Looking at the 4.0.0.0 code of findpath.pas, any call to givepath() will open 2 new handles for every card present without ever closing the existing ones. Note that givepath() is not only called from SearchDevices().

Regards,
Jan

Calling CloseDevice prior to SearchDevices should fix the problem.
The function CloseDevice closes all open handles for every card present.

Thanks for your suggestion.
I tried it out, but inserting CloseDevice is unfortunally not solving the problem.

Seems to help only with DLL version 4.0.0.0

Here is the link to download v5.0.0.1 of the K8055D.DLL:
box.com/s/izvxnpxqm7d72clftxmh
In this version the SearchDevices should not increase the number of handles.
Using this version there is no need to call CloseDevice before SearchDevices.

The modification delivered in V5.0.0.1 is OK.
Thank you for your quick help.

Trying out version 5.0.0.1 I got the idea it was quite a bit slower compared with previous versions.

A running light programmed with EasyProgIntFace ran twice as slow compared with version 4.0.0.0.
Version 5 ran 0,035 ms.
Version 4 ran at 0,016 ms.

My students (age 14-15) like to run it as quick as possible, but I also want to check if the interface is still connected.

So I’m still interested in the latest version, but can it get the speed of version 4?
Am I the only one who noticed this problem?

B.t.w. it’s running under Windows 8 Pro.

Hilbrand.

I also noted that the Version V5 is remarkebly slower than V4.
I only cheched the functions: OutputAnalogChannel and SetDigitalChannel.
I just logged in to write a new topic for this, but if possible we use this topic too.

In the last post of this thread there are some test results of the response time of the VM110N/K8055N card using DLL versions 4 and 5:
viewtopic.php?f=3&t=8358

When version 4 of the DLL is used, the VM110N/K8055N card is running in the VM110/K8055 compatibility mode.
In this mode the card is transmitting all the time the input status data to the USB bus.

When the version 5 of the DLL is used, the input status of the card is requested by the PC software. This is why the response time of the functions ReadAnalogChannel, ReadAllAnalog, ReadDigitalChannel, ReadAllDigital and ReadCounter is about 2ms with version 5 and about 1ms with version 4 of the DLL.

The response time of all output functions as WriteAllDigital, OutputAnalogChannel, SetDigitalChannel, ClearDigitalChannel etc. is equal with both DLL versions 4 and 5.
The response time is normally 2ms and about 1ms if the VM110N/K8055N card is connected to the PC via an external USB HUB.

Using the DLL version 4 may cause some latency to the data read. The data sent from the VM110N/K8055N card to the USB bus is fed to a ring buffer in PC.
To avoid the latency, the data have to be read as fast as it is written to the buffer.
The latency problem is avoided by using the version 5 of the DLL.

Please do not put the SearchDevices function to the main loop of the software.
Use it only occasionally to check the card connection.
The original purpose of the SearchDevices was to use it just at the beginning of the program only.
The execution time of the SearchDevices function is about 15ms with DLL version 4.0.0.1 and about 30ms with version 5.0.0.1.
You may also use the Connected function of the version 5 DLL to check card disconnection.

Now also the version 4 of the DLL is modified.
Here is the link to download v4.0.0.1 of the K8055D.DLL:
box.com/s/i69481t0zi8do0vwvku7
In this version the SearchDevices will not increase the number of handles.