K8055 - Problem with Digital Inputs

Hello everybody,

I am currently using two inputs of the module K8055 (VM110N) (the Inp1 and the Inp2 inputs). When I received a signal from a relay, I will increment a “textbox” in my program. When I detect the signal from the relay, the input is “on” and I increment the “textbox”.

For example :

  • First, textbox = “0”
  • Signal from the relay to the digital input Inp1 is “on”, textbox = “1”
  • The DI Inp1 is always “on” and sometimes and without reasons, the textbox is increasing, textbox = “2”. And then , textbox = “3” etc.

I tried to understand what happened and I don’t find anything.

I used correctly the functions from the DLL enclosed with the K8055.
“K8055D.dll”,“SetCounterDebounceTime”,1,2000
“K8055D.dll”,“ReadDigitalChannel”,1

If you have any idea about a hypothtic solution, I will be glad.

Not really sure what might be the cause.
The first thing you should do is go through the assembly and make sure every thing is in the correct place and polarity.

Next test it with the demo software (this will tell you if is a hardware or software issue)

Hope this helps.

[quote=“Wrong Way”]Not really sure what might be the cause.
The first thing you should do is go through the assembly and make sure every thing is in the correct place and polarity.

Next test it with the demo software (this will tell you if is a hardware or software issue)

Hope this helps.[/quote]

Thank you for your reply (very fast as well!)!

Everything is in the correct place and the polarity is correct.
I will try the demo software and I am coming to tell you if the problem persists.

By information, I am using an “loop function” which detects if the “K8055D.dll”,“ReadDigitalChannel”,1" is equals “1”. If so, I do a “thread sleep” (about 100ms). I’ve changed the “thread sleep” into 10ms for a test, and the textbox increases rapidly (textbox goes to “60” in a only 2 seconds). And when I tried to change the “thread sleep” (about 500 ms), the problem disappears.

Do you think there is a link between that?

The debounce configuration of the K8055 does not affect the ON/OFF state, reported by the card. It is only affecting the counter, maintained by the firmware for the first two inputs. You are not using that counter, so your software might see some bouncing or flicker of the input signal.

Also, the original K8055 sends a constant series of HID packets, one every 10 ms. If your code does not consume those reports by reading from the card fast enough, the effect is that they fill up the Windows maintained HID ring buffer (32 packets) and your program will always get a 320 ms old report, when it reads.

I suggest you use the firmware maintained counters and find the correct debounce setting where the effect disappears. And I also suggest that instead of thread sleeping, you use a background worker to read from the card and the “report progress” feature of the background worker to update the textbox, whenever the counter value changes. That way your program will read HID reports at exactly the speed, the card is sending them, without doing any sleeping or timer event handling.

Thank you for the reply. The fact is when I try to set the debounce time to 300ms, the effect appears again. I don’t know how to do now, this is very problematic…

You should increment your textbox value only when the result of ReadDigitalChannel changes from 0 to 1. The result will stay 1 as long as the contact is closed.