LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DataLogger K8047 Velleman

Solved!
Go to solution

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.

 

Download All
0 Kudos
Message 1 of 10
(4,762 Views)

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.

Message 2 of 10
(4,740 Views)

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?

0 Kudos
Message 4 of 10
(4,671 Views)

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

0 Kudos
Message 5 of 10
(4,641 Views)

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

0 Kudos
Message 6 of 10
(4,610 Views)

 

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.

0 Kudos
Message 7 of 10
(4,576 Views)
Solution
Accepted by Marcel_S

Thanks for your tip. Unfortunately I do not know exactly how to implement it.
Have not done much with dll. 'll test a little.

0 Kudos
Message 8 of 10
(4,550 Views)

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?

0 Kudos
Message 9 of 10
(4,510 Views)

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;

0 Kudos
Message 10 of 10
(4,432 Views)