Jump to content
Sign in to follow this  
Jujo

Velleman P8055

Recommended Posts

Jujo

Hi every1.

It's me again ^_^ I need some more help with my Velleman P8055 (K8055) board.

In one topic I found how to load its functions to AutoIt from DLL. That is all clean without problem:

Func USBOpenDevice($CardAddress)
   $result = DLLCall("k8055d.dll", "int", "OpenDevice", "int", $CardAddress)
   Return $result[0]
EndFunc

Func USBCloseDevice()
   $result = DLLCall("k8055d.dll", "none", "CloseDevice")
   Return;;$result[0]
EndFunc

Func USBReadAnalogChannel($Channel)
   $result = DLLCall("k8055d.dll", "int", "ReadAnalogChannel", "int", $Channel)
   Return $result[0]
EndFunc

Func USBOutputAnalogChannel($Channel, $Data)
   $result = DLLCall("k8055d.dll", "none", "OutputAnalogChannel", "int", $Channel, "int", $Data)
EndFunc

Func USBOutputAllAnalog($Data1, $Data2)
   $result = DLLCall("k8055d.dll", "none", "OutputAllAnalog", "int", $Data1, "int", $Data2)
EndFunc

Func USBClearAnalogChannel()
   $result = DLLCall("k8055d.dll", "none", "ClearAnalogChannel")
EndFunc

Func USBSetAllAnalog()
   $result = DLLCall("k8055d.dll", "none", "SetAllAnalog")
EndFunc

Func USBClearAllAnalog()
   $result = DLLCall("k8055d.dll", "none", "ClearAllAnalog")
EndFunc

Func USBSetAnalogChannel($Chanel)
   $result = DLLCall("k8055d.dll", "none", "SetAnalogChannel", "int", $Channel)
EndFunc

Func WriteAllDigital($Data)
   $result = DLLCall("k8055d.dll", "none", "WriteAllDigital", "int", $Data)
EndFunc

Func USBClearDigitalChannel($Channel)
   $result = DLLCall("k8055d.dll", "none", "ClearDigitalChannel", "int", $Channel)
EndFunc

Func USBClearAllDigital()
   $result = DLLCall("k8055d.dll", "none", "ClearAllDigital")
EndFunc

Func USBSetDigitalChannel($Channel)
   $result = DLLCall("k8055d.dll", "none", "SetDigitalChannel", "int", $Channel)
EndFunc

Func USBSetAllDigital()
   $result = DLLCall("k8055d.dll", "none", "SetAllDigital")
EndFunc

Func USBReadDigitalChannel($Channel)
   $result = DLLCall("k8055d.dll", "bool", "ReadDigitalChannel", "int", $Channel)
   Return $result[0]
EndFunc

Func USBReadAllDigital()
   $result = DLLCall("k8055d.dll", "int", "ReadAllDigital")
   Return $result[0]
EndFunc

Func USBReadCounter()
   $result = DLLCall("k8055d.dll", "int", "ReadCounter")
   Return $result[0]
EndFunc

Func USBResetCounter($count)
   $result = DLLCall("k8055d.dll", "none", "ResetCounter", "int", $count)
EndFunc

Func USBSetCounterDebounceTime($count, $detime)
   $result = DLLCall("k8055d.dll", "none", "SetCounterDebounceTime", "int", $count,"int", $detime)
EndFunc

But, now, I typed a very simple program:

USBOpenDevice(0)
USBSetDigitalChannel(1)

At the top, I added include function, which successfully includes functions file.

The problem is that this program DOES NOT WORK - it doesn't turn on LD1, which it is supposed to do when USBSetDigitalChannel(x) is called (x is channel # - from1 to 8 ;) )

Please, help me if anyone can. Also, if any1 uses this interface for robotics, can u tell me how do u control it thru AutoIt?

Thanks

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×