Hello,
I have bought a Velleman k8055 card one year ago and I used Grafcet to program it.
But today, I learn C and C++ language at school. I wanna use my card without “Automgen” and I don’t understand how to use it.
I don’t know how to use dll or header files for this product. I have a driver cd. I found some *.h file. But I can’t use them. I have too much errors about library.
I which I used it on Windows 7 and Linux OS like Ubuntu or Fedora, thatswhy I would like to use headers files but not dll file.
Could you show me a little piece of source code in C++ in which you juste look if OpenDevice() does work, and maybe juste turn an Output on ?
I have already seen some .cpp example files but I didn’t understand them.
I tried a lot of things like that :
#include <stdlib.h>
#include <stdio.h>
#include <windows.h>
#include “K8055D.h”
#include “StdAfx.h”
int main(void)
{
if (OpenDevice(0) == -1)
printf(“Okay, it works\n”);
else
printf(“Fail!\n”);
return (0);
}
but it never worked. I have a lot of library errors but I can’t find them.
Thanks for your help.
Nicolas Girard.
Please download the latest software package for the K8055.
Here is the link to download page:
velleman.eu/distributor/supp … 8055&type=
The package “Complete SDK Pack (Rev 4.0)” includes new K8055D.DLL and sample projects written in various programming languages.
C and C++ examples are included.
Pleas read the “README.TXT”, “K8055_DLL_manual.pdf” and the “K8055 & VM110 Getting Started.pdf”.
[quote]I don’t know how to use dll or header files for this product. I have a driver cd. I found some *.h file. But I can’t use them. I have too much errors about library. [/quote]You can use the K8055D.h and the K8055D.LIB only for the Borland C++ Builder. There in the software package are no .lib files for other compilers.
Instead you can use explicit (run time) linking to the DLL.
Please see the example in the subfolder \examples\K8055DemoDevC
There is a simple C++ console application for Bloodshed Dev-C++.
I think you may easily modify the source code for your compiler.
Here you’ll find instructions how to use the explicit (run time) linking: http://msdn.microsoft.com/en-us/library/784bt7z7(VS.71).aspx
Please check also this link how to use GetProcAddress: msdn.microsoft.com/en-us/library/64tkc9y5.aspx
[quote]I which I used it on Windows 7 and Linux OS like Ubuntu or Fedora, thatswhy I would like to use headers files but not dll file. [/quote]You have to use the K8055D.DLL. All the functions are there.
Here is a code snippet from the Dev-C++ example
[code] h = OpenDevice(0);
if (h == 0)
{
cout << “Card 0 opened” << endl;
}
else
{
cout << “Card not found” << endl;
}
//…
cout << "Press Enter to \"OutputAllDigital 0x55\"" << endl;
cin.get();
WriteAllDigital(0x55);[/code]
Hello,
You can use C, C++ and Python without problems under Linux. I made a page (in French) about installing and developping with this card. I’m also releasing two open sources programs for driving stepper motors with the 8 digital outputs of the card, so you will ind the sources too soon by following the google code links on this page. I made the same program under the two languages for benchmarking purposes.
Over there: david.meziere.eu/wiki/systeme/k8055
David.