Description of the procedures of the dsolink.dll, Running the dsolink in delphi, Running the dsolink in visual basic – Velleman PCSU1000 DSO User Manual
Page 18

PC Oscilloscope PCSU1000
17
© 2005 ... Velleman
Description of the procedures of the DSOLink.DLL
ReadCh1
ReadCh2
Syntax
PROCEDURE ReadCh1(Buffer: Pointer);
PROCEDURE ReadCh2(Buffer: Pointer);
Parameter
Buffer
: A pointer to the data array of 5000 long integers where the data
will be read.
Description
Read all the data and the settings of channel 1 or channel 2 of the PCSU1000.
As a return the following data is put to the buffer:
[0] : Sample rate in Hz
[1] : Full scale voltage in mV
[2] : Ground level in A/D converter counts. The value may be beyond the 0...255 range if GND level
is adjusted beyond the waveform display area.
[3...4098] : The acquired data in A/D converter counts (0...255), from PCSU1000.
The triggering point of the PCSU1000 is at the data location [1027].
Running the DSOLink in Delphi
Check the \PC-Lab2000 tools\PCSU1000 - PCS500 - PCS100 - K8031\Data transfer
DSOLink_DLL\DSOLink_Demo_VB\ folder on the Velleman CD to locate the demo files.
This folder contains a ready to run DSOLink_Demo.EXE program and its source code.
You may copy the files to any folder and use Delphi to examine, edit and compile the files.
Example (in Delphi)
var
data: array[
0
..
5000
] of longint;
procedure ReadCh1(Buffer: Pointer); stdcall; external
'DSOLink.dll'
;
procedure TForm1.Button1Click(Sender: TObject);
var i: longint;
p:pointer;
begin
p:= @data[
0
];
ReadCh1(p);
memo1.clear;
memo1.lines.add(
'Sample rate [Hz]'
+chr(
9
)+inttostr(data[
0
]));
memo1.lines.add(
'Full scale [mV]'
+chr(
9
)+inttostr(data[
1
]));
memo1.lines.add(
'GND level [counts]'
+chr(
9
)+inttostr(data[
2
]));
memo1.lines.add(
''
);
begin
for i:=
0
to
20
do
memo1.lines.add(
'Data ('
+inttostr(i)+
')'
+chr(
9
)+chr(
9
)+inttostr(data[i+
3
]));
end;
end;
Running the DSOLink in Visual Basic
Make sure that the file DSOLink.DLL is copied to Windows' SYSTEM32 folder.
Check the \PC-Lab2000 tools\PCSU1000 - PCS500 - PCS100 - K8031\Data transfer
DSOLink_DLL\DSOLink_Demo_VB\ folder on the VELSOFT CD to locate the demo files.
This folder contains a ready to run DSOLink_Demo.EXE program and its source code.
You may copy the files to any folder and use Visual Basic to examine, edit and compile the files.
Example (in Visual Basic)