folgende Funktionen rufe ich auf.
Delphi-Quellcode:
//Deklaration:
type TLumax_OpenDevice = function(const l_devnumber, l_channel: integer): integer; stdcall;
type TLumax_CloseDevice = function(const l_dev: integer): integer; stdcall;
var Lumax_OpenDevice: TLumax_OpenDevice;
var Lumax_CloseDevice: TLumax_CloseDevice;
var ladr_opendev: TFarProc;
var ladr_closedev: TFarProc;
ladr_opendev:=GetProcAddress(luhandle, 'Lumax_OpenDevice');
if ladr_opendev <> nil then
begin
@Lumax_OpenDevice:=ladr_opendev;
ladr_closedev:=GetProcAddress(luhandle, 'Lumax_CloseDevice');
if ladr_closedev <> nil then
begin
@Lumax_CloseDevice:=ladr_closedev;
//Aufrufe:
procedure TForm1.Laseropen_lumax;
var idev: integer;
begin
ldevl1:=0;
frams11:=0;
ohe1:=0;
if lxdevnr1 > 0 then
begin
idev:=Lumax_GetPhysicalDevices();
if idev > 0 then
begin
ldevl1:=Lumax_OpenDevice(lxdevnr1, 0);
ohe1:=1;
end;
end;
end;
procedure TForm1.Laserclose_lumax;
var s: integer;
var z: integer;
begin
if lxdevnr1 > 0 then
begin
if frams11 = 1 then
begin
z:=Lumax_StopFrame(ldevl1);
end;
frams11:=0;
if ldevl1 > 0 then
begin
s:=Lumax_CloseDevice(ldevl1);
ldevl1:=0;
ohe1:=0;
end;
end;
end;
Ich hoffe das hilft.
Gruß Jürgen