1. Vellerman K8055 interface
- Posted by alanjohnoxley Jun 16, 2011
- 1741 views
Hello,
I have assembled an interface board with several digital and analog inputs and outputs, programmable via a USB port.
There is sample code in VB, C plus plus and Delphi provided. So, obviously I want to write a Euphoria wrapper for this cool $50 board.
The search on OpenEuphoria did not show any hits for "8055" so I'll ask if anyone has already written a wrapper for the board,
or knows about any "gotcha's" . It shouldn't be difficult, but why re-invent the wheel :)
TIA,
Alan
2. Re: Vellerman K8055 interface
- Posted by Vinoba Jun 16, 2011
- 1762 views
http://eeberfest.net/AbelCam/pluginhelp.php?page=1
This device Abelcam will extract a K8055 DLL
FRom their description: "This will result in K8055Plugin.dll being extracted into AbelCam\Plugin\Web and the rest of the files (a supporting DLL and some sample HTML pages) being extracted into AbelCam\Plugin\Web\K8055Plugin"
If you know the details you can use this DLL in euphoria and similar.
"Low Level API Velleman provide a DLL to make it easier to write your own programs to control their card. The functions provided by the DLL are pretty much straight forward and self-explanatory but to make them easier to digest I have put them into functional groups below..."
If you have the DLL and info on the APIs, and minimal knowledge of Cplus (which is where I have a problem) you can write a wrapper easily. Look at wxeud.e in wxEuphoria and you will see how easily the wrappers are created in Euphoria.
3. Re: Vellerman K8055 interface
- Posted by alanjohnoxley Jun 16, 2011
- 1649 views
Thanks,
I have got it working. At the moment I am turning on/off the digital outputs.. just LED lights, but with relays that could be anything!
My wife wants me to use it to turn on alarms in the kids rooms to get them up in the morning ;)
Here is some simple code:
include std/dll.e atom dll_address integer K8055_OpenDevice, K8055_CloseDevice integer K8055_SetDigitalChannel, K8055_ClearAllDigital -- procedure load_dll() sequence s1 s1 = "C:\\Program Files\\Vellerman\\K8055\\K8055D.dll" -- 2003 version dll_address = open_dll(s1) if dll_address = 0 then puts(1,"\nCannot load DLL, aborting!") abort(8) end if -- define K8055 functions K8055_OpenDevice = define_c_func(dll_address, "OpenDevice", {C_INT},C_INT) K8055_CloseDevice = define_c_proc(dll_address, "CloseDevice", {C_INT}) K8055_ClearAllDigital = define_c_proc(dll_address, "ClearAllDigital", {C_INT}) K8055_SetDigitalChannel = define_c_func(dll_address, "SetDigitalChannel", {C_INT}) end procedure procedure test() integer i1 i1 = c_func(K8055_OpenDevice{3}) -- device 3 is with both jumpers off c_proc(K8055_ClearAllDigital,{0}) -- turn off all LEDs by default c_proc(K8055_SetDigitalChannel{3}) -- turn on LED 3 c_proc(K8055_SetDigitalChannel{7}) -- turn on LED 7 c_proc(K8055_CloseDevice,{0}) end procedure load_dll() test()