Recent

Author Topic: starting Procedure by change of InputChannel from USB-Interface (K8055)  (Read 2077 times)

Frank8001

  • Newbie
  • Posts: 3
Hello!
I'm not very experienced in programming. I'm working with a Vellemann's K8055 USB-IO-Interface.
Everything works correctly. I can change states of the digital output channel without problems. But...

I want to trigger a message or a procedure, if one of the digital input channels change its state. Something like:

     if the digital input channel 1 changes its state -> start a procedure 

How can I do this?

Many thanx for help
greetings

Frank
« Last Edit: March 25, 2017, 05:22:00 pm by Frank8001 »

Frank8001

  • Newbie
  • Posts: 3
...nobody can help?

I know, I'm impatient....

Thaddy

  • Hero Member
  • *****
  • Posts: 10730
Well, what platform are you using? Did the Kit come with example code? E.g. in C?
It is possibly not too difficult but we need to know if the kit came with a driver etc..
Usually you would either capture events or use polling in a thread.

Frank8001

  • Newbie
  • Posts: 3
Ok, it came with a K8055.dll. As I reported, everything is working fine with the interface.
I think the only problem is, that I don't know, how to start a procedure automatically by an event like change of a variable or the status of the InputChannel.

readDigitalChannel(i) is the normal commandline to check the status of an InputChannel. It can be true or false.

With this I can check the status with a manually started procedure (eg procedure TButtonClick(Sender: TButton...if readDigitalChannel(1) = true then begin.....

But I have no idea to start a procedure automatically

thx for your patience

Thaddy

  • Hero Member
  • *****
  • Posts: 10730
I just converted the D6 demo software from the velleman website to Lazarus win32 and it compiled straight away.I don't have this board, but that may be a good start. Note the dll is win32 only. You can only use it with Laz for win32.
https://www.velleman.eu/support/downloads/?code=K8055

Just click the dpr file and Lazarus will convert it for you.
It seems polling is done with a TTimer.

Do you have this? https://www.velleman.eu/downloads/0/user/usermanual_k8055_dll_uk.pdf

You may also be interested in http://libk8055.sourceforge.net/ (which seems a basis for a 64 bit version too ;) )
« Last Edit: March 25, 2017, 06:26:01 pm by Thaddy »

 

TinyPortal © 2005-2018