12-30-2010 04:41 PM
Ich hab einen data Logger K8047 von der Firma Velleman.
Ich will den Logger in Labview einbinden und hab noch nicht viel Erfahrung mit DLL Zugriffe.
Ich weiß nicht wie ich die Funktion ReadData in Labview umsetzen soll.
Ich hab eine Beschreibung aus VS und die K8047.dll
Bei meinen Versuchen schließt sich Labview oder es passiert nichts.
Starten des Devices und Stoppen des Devices hab ich hinbekommen.
Kann die LED auf dem Logger auch an und ausschalten.
Hab nur Probleme ein VI zu erzeugen,welches die Daten einließt.
Ich hänge mal die dll Datei an und die Beschreibung aus Visual Basic an.
Vieleicht kann mir jemand helfen,die ein VI zu Entwickeln.
Solved! Go to Solution.
12-31-2010 01:29 PM
Google Translation:
I have a data logger Velleman K8047 from the company.
I will include the logger in Labview and I have not much experience with DLL access.
I do not know how to implement the function read data in Labview.
I've got a description from USA and K8047.dll
In my experiments is followed Labview or nothing happens.
Starting and stopping of the device of the device I hammer out.
The LED can turn on the logger, and also.
Have only problems to produce a VI that parse the data.
I hang times on the dll file and the description from Visual Basic to.
Maybe someone can help me, a VI to develop.
01-03-2011 10:32 AM
01-04-2011 07:08 AM
Thanks for the links.
In order to import a dll file in Labview, Labview requires a header file.
Can someone help me where can I get the for the K8047 from?
01-05-2011 09:00 AM
Hi
You only need the header(.h) file if you want to use the Import shared Library wizard to generate VIs from a DLL.
try to email or contact the Velleman support
01-07-2011 02:10 PM
Thanks for your tip.
I got the header file from Velleman.
Everything worked.
I just have a problem. The data is displayed as int32.
How can I convert them into an array 0-7?
Header file:
#ifdef __cplusplus
extern "C" {
#endif
#define FUNCTION __declspec(dllimport)
FUNCTION __stdcall StartDevice();
FUNCTION __stdcall StopDevice();
FUNCTION __stdcall LEDon();
FUNCTION __stdcall LEDoff();
FUNCTION __stdcall ReadData(int *ptr);
FUNCTION __stdcall SetGain(int Channel, int Gain);
#ifdef __cplusplus
}
#endif
Thanks
01-09-2011 11:07 AM
When you pass an array of data to a DLL function, you will see that you have the option to pass the data as an Array Data Pointer or a LabVIEW Array Handle.
If you must return an array of data, allocate an array of sufficient size in LabVIEW, pass it to your function, and have it act as the buffer.
01-10-2011 01:57 PM
Thanks for your tip. Unfortunately I do not know exactly how to implement it.
Have not done much with dll. 'll test a little.
01-13-2011 01:22 PM
I've tried to convert VI to read the data as an array.
Will not that point. Permanently exclude my Labview.
Can anyone help rebuild the VI from I32 to array?
01-18-2011 01:20 PM
Who can help me to read the data in an array?
Here's the source code from Delphi where it goes.
DataBuffer: ARRAY[0..7] OF Integer;
procedure TForm1.Button1Click(Sender: TObject);
var p:pointer;
i:integer;
s:string;
begin
p:=@DataBuffer; // Address of the data buffer
ReadData(p); // Read the data from K8047
memo1.clear;
s:='';
for i:=0 to 7 do s:=s +inttostr(DataBuffer[i]+chr(9);
memo1.lines.add(s); // Display the data
end;