Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Need help trying to interface DBP with Velleman K8055 interface board

Author
Message
dark nooby
18
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 14th Dec 2010 18:48
Hi guys/gurls im trying to create a program to test my Velleman K8055 experimenters USB interface board.
im using windows xp and darkbasic pro, the only way i can use the board in darkbasic is with the K8055D.dll file supplied with the board. I should also mention that i have never used a dll file before so my code probably has a lot of flaws in it.
heres me code

Also the interface board is plugged into a usb port if that makes a difference. The compiler gets a error at the line which says "call dll 1, opendevice(3)"
The error reads "'CALL DLL'did not match the 'DLL Number,Function Name' at line 24.
KISTech
18
Years of Service
User Offline
Joined: 8th Feb 2008
Location: Aloha, Oregon
Posted: 14th Dec 2010 19:17
You've left the quotes off of the commands you're sending to the DLL.

That's just off the top of my head. There may be more.

dark nooby
18
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 14th Dec 2010 19:40
Thanks very much KISTECH, when i read about the commands in the help file it didnt say to enclose the commands in quotes, however it state they were strings which are normally put with quotes.
yay the error has moved on further down the list which is a good start
dark nooby
18
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 16th Dec 2010 22:29
Hi, ive got rid of all those obvious bugs and made changes as shown, but the program as shown below doesnt seem to actually connect to the interface board. The interface card has leds on all the channels that indicate the on/off state of each individual channel. As of the time of this posting the card does nothing to indicate that the program is communicating with it, other than a power led that is on.


im guessing maybe i need turn on the USB port or something and maybe i am missing some command parameters.
BillR
23
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 16th Dec 2010 22:56
1) Does the setup.exe demo software work, you can download it from their web site, it will let you play with the board after setting up the DIP switches correctly.
2) Do you get all the yes they exist messages from your software?
3) PLEASE indent your code as a courtesy to others, it also makes good programming style
dark nooby
18
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 18th Dec 2010 03:56
hi Billr,

1.yes the setup.exe works fine and everything lights up like it should but its very limited in any user control.

2.The answer to that question is yes, Those commands are only opening the K8055.dll library file and looking inside it to see if those commands exist. If the command exists inside the dll file it prompts me with a yes.

3.yes i really need to make indenting the code a habit, sorry


i've indented the code.

thanks for the pointers
dark nooby
18
Years of Service
User Offline
Joined: 30th Mar 2008
Location:
Posted: 18th Dec 2010 04:34
Hi its me again, Ive been playing around with the code and discovered why it didnt work.
I wasnt Opening the correct Device number, the correct device number was 3. Sweet it works mighty fine now and everything is working like it should

thanks guys/gals for your help.

Login to post a reply

Server time is: 2026-07-21 07:03:47
Your offset time is: 2026-07-21 07:03:47