K8055 call to ReadAllDigital() blocking indefinitely

Hi all,

I’m hoping someone may be able to help me with a problem I’m having with the K8055 board. Specifically, I’m creating a Windows service that continually monitors the board’s input for change. The project is written in C#, so I’ve created a simple pinvoke wrapper around the exposed functionality of the K8055D.dll. When I start the service, I open a connection to the device, then if successful I start a poll timer to read all digital and analog inputs, just as in the provided example C++ application. What I’m seeing however, is that all seems to be well for a short period of time (ie, the timer fires and values can be read successfully), but then after a while nothing. No reaction to any changes in input on the board. If I attach a debugger, I can see that my worker thread handling the timer is stuck inside a call to ReadAllDigital(). Obviously, I can’t get any more information than this as I can’t debug into the dll.

Can anyone shed any light on this issue? I’m wondering what could cause that particular call to block indefinitely? I’m thinking it’s probably something to do with the implementation of the dll … is it thread safe? Does it have any dependencies on Windows Messaging, etc?

Any assistance would be much appreciated,
Regards,
Craig Shaw

I tried to repeat this problem without success.
I wrote a simple C# program including following timer procedure:

private void timer1_Tick(object sender, EventArgs e) { int n = api.ReadAllDigital(); label2.Text = n.ToString(); }Seems to run “forever” without any problems.
The timer interval is 100ms.

If you like to check my code, here’s a link to download the project files:
box.net/shared/ao7n039ute

Thanks for the help … I think I’ve actually now got to the bottom of the problem though.

It was the dll I was using. I thought I was using the latest 3.0.2 but obviously wasn’t. Now I’ve replaced the dll, everything seems to be ok. Well, the service has been running now for an hour and a half and it’s still going and reporting Input events as I’d hoped.