cyril
April 20, 2010, 7:51pm
1
Bonjour actuellement en stage dans le cadre de mon cursus j’ai à realiser une interface homme/machine ( IHM ) pour piloter un modul.
Le GUI que je realise est à faire avec QT creator et pour que cela puisse se faire j’ai besoin du K8055D.a ( equivalent sous delphy du K8055.lib )
Savez vous qui je dois contacter pour obtenir ce que je cherche ?
Avez vous peut etre un lien ?
Cordialement
Cyril Guiet
Etudiant en DUT GEII
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Hello at present in training course within the framework of my programme I have to realize a man/machine interface ( IHM) to pilot a modul.
The Graphic User interface (GUI ) which I realize is to be made with QT creator and so that it can be made I need K8055D.a (equivalent under delphy of K8055.lib)
Know you who I have to contact to obtain for what I look?
Have you a link?
Cordially:)
Cyril Guiet
Studying in DUT(TWO-YEAR TECHNICAL DEGREE) GEII
cyril
April 29, 2010, 6:39am
2
finalement le .lib que j’ai recuperé precedement était corrompu.
Désolé de la gêne occasioné.
Cordialement
Speggo
August 27, 2014, 10:35am
3
Hi,
I’ve been looking for an answer to this question for a while and made out a simple solution.
Anyway it was not possible to use the .lib file from the package in Qt4 (don’t know exactly why…).
So I linked the k8055d.dll dynamically by using QLibrary. Full source code see below.
The k8055d.dll is the only file you need for using the code.
myK8055D.h
#include <windows.h>
#include <QLibrary>
typedef void(CALLBACK* t_func)(int );
typedef void(CALLBACK* t_func0)();
typedef int(CALLBACK* t_func1)();
typedef void(CALLBACK* t_func2)(int *, int *);
typedef void(CALLBACK* t_func3)(int , int );
typedef int(CALLBACK* t_func4)(int );
typedef bool(CALLBACK* t_func5)(int );
extern t_func4 OpenDevice;
extern t_func0 CloseDevice;
extern t_func0 Version_;
extern t_func4 ReadAnalogChannel;
extern t_func2 ReadAllAnalog;
extern t_func3 OutputAnalogChannel;
extern t_func3 OutputAllAnalog;
extern t_func ClearAnalogChannel;
extern t_func0 ClearAllAnalog;
extern t_func SetAnalogChannel;
extern t_func0 SetAllAnalog;
extern t_func WriteAllDigital;
extern t_func ClearDigitalChannel;
extern t_func0 ClearAllDigital;
extern t_func SetDigitalChannel;
extern t_func0 SetAllDigital;
extern t_func5 ReadDigitalChannel;
extern t_func1 ReadAllDigital;
int initBoardFunctions(QLibrary& k8055d);
myK8055D.cpp
#include "myK8055D.h"
t_func4 OpenDevice;
t_func0 CloseDevice;
t_func0 Version_;
t_func4 ReadAnalogChannel;
t_func2 ReadAllAnalog;
t_func3 OutputAnalogChannel;
t_func3 OutputAllAnalog;
t_func ClearAnalogChannel;
t_func0 ClearAllAnalog;
t_func SetAnalogChannel;
t_func0 SetAllAnalog;
t_func WriteAllDigital;
t_func ClearDigitalChannel;
t_func0 ClearAllDigital;
t_func SetDigitalChannel;
t_func0 SetAllDigital;
t_func5 ReadDigitalChannel;
t_func1 ReadAllDigital;
int initBoardFunctions(QLibrary& k8055d)
{
OpenDevice = (t_func4)k8055d.resolve("OpenDevice");
if(!OpenDevice) return -1;
CloseDevice = (t_func0)k8055d.resolve("CloseDevice");
if(!CloseDevice) return -2;
Version_ =(t_func0)k8055d.resolve("Version");
if(!Version_) return -3;
ReadAnalogChannel =(t_func4)k8055d.resolve("ReadAnalogChannel");
if(!ReadAnalogChannel) return -4;
ReadAllAnalog =(t_func2)k8055d.resolve("ReadAllAnalog");
if(!ReadAllAnalog) return -5;
OutputAnalogChannel = (t_func3)k8055d.resolve("OutputAnalogChannel");
if(!OutputAnalogChannel) return -6;
OutputAllAnalog = (t_func3)k8055d.resolve("OutputAllAnalog");
if(!OutputAllAnalog) return -7;
ClearAnalogChannel = (t_func)k8055d.resolve("ClearAnalogChannel");
if(!ClearAnalogChannel) return -8;
ClearAllAnalog = (t_func0)k8055d.resolve("ClearAllAnalog");
if(!ClearAllAnalog) return -9;
SetAnalogChannel = (t_func)k8055d.resolve("SetAnalogChannel");
if(!SetAnalogChannel) return -10;
SetAllAnalog = (t_func0)k8055d.resolve("SetAllAnalog");
if(!SetAllAnalog) return -11;
WriteAllDigital = (t_func)k8055d.resolve("WriteAllDigital");
if(!WriteAllDigital) return -12;
ClearDigitalChannel = (t_func)k8055d.resolve("ClearDigitalChannel");
if(!ClearDigitalChannel) return -13;
ClearAllDigital = (t_func0)k8055d.resolve("ClearAllDigital");
if(!ClearAllDigital) return -14;
SetDigitalChannel = (t_func)k8055d.resolve("SetDigitalChannel");
if(!SetDigitalChannel) return -15;
SetAllDigital = (t_func0)k8055d.resolve("SetAllDigital");
if(!SetAllDigital) return -16;
ReadDigitalChannel = (t_func5)k8055d.resolve("ReadDigitalChannel");
if(!ReadDigitalChannel) return -17;
ReadAllDigital = (t_func1)k8055d.resolve("ReadAllDigital");
if(!ReadAllDigital) return -18;
return 1;
}
Bevore executing functions for board communication initBoardFunctions() has to be called! (as below)
QLibrary k8055d("K8055D.dll");
if(initBoardFunctions(k8055d)<0)
{
QMessageBox::critical(0, "Velleman K8055D.dll missing", "K8055D.dll could not be loaded!", QMessageBox::Close);
return 0;
}
Greets