Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2004.07.04;
Скачать: CL | DM;

Вниз

помогите в написании драйвера для нестанд устройства   Найти похожие ветки 

 
миша   (2004-05-25 17:11) [0]

Я написал драйвер на паскале а программа (на делфи) не загружает его и не выдаёт ошибки
листинг DLL
Library ads1286dll;
var n,e,f:byte;
   b:integer;
   zn,d:real;

procedure acquisition;export;
   begin
      b:=$3F8; n:=12;
      port[b+4]:=1;
      port[b+3]:=64;
      port[b+4]:=0;d:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      for f:=0 to n-1 do
          begin
             port[b+4]:=2;
             e:=port[b+6] and 16;
             port[b+4]:=0;
             if e=16 then d:=d+exp((n-1-f)*ln(2));
          end;
      d:=(5*d)/(exp((n)*ln(2))-1);
      port[b+4]:=1;
      zn:=d;
   end;
exports
 acquisition;
begin
end.
листинг проги
unit vo;

interface

uses
 Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
 Dialogs, StdCtrls;

type
 TForm1 = class(TForm)
   Label1: TLabel;
   Button1: TButton;
   procedure FormActivate(Sender: TObject);
   procedure Button1Click(Sender: TObject);
 private
   { Private declarations }
 public
   { Public declarations }
 end;

var
 Form1: TForm1;

implementation

{$R *.dfm}
procedure acquisition ; external "ads1286d.dll";
procedure TForm1.FormActivate(Sender: TObject);
var zn:real;
begin
Label1.Caption:= floatToStr(zn);
end;

procedure TForm1.Button1Click(Sender: TObject);
begin
close;
end;

end.
а в паскале вот это работает
program volt;
uses crt;
var n,e,f:byte;
   b,g:integer;
   d:real;
procedure init;
   begin
      clrscr;
      b:=$3F8; n:=12;
      port[b+4]:=1;
      delay(100);
      port[b+3]:=64;
      delay(500);
   end;
procedure acquisition;
   begin

      port[b+4]:=0;d:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      port[b+4]:=2;port[b+4]:=2;
      port[b+4]:=2;port[b+4]:=0;
      for f:=0 to n-1 do
          begin
             port[b+4]:=2;
             e:=port[b+6] and 16;
             port[b+4]:=0;
             if e=16 then d:=d+exp((n-1-f)*ln(2));
          end;
      d:=(5*d)/(exp((n)*ln(2))-1);
      port[b+4]:=1;
   end;
procedure afihe;
   begin
      acquisition;
      d:=(int(1000*d))/1000;
      writeln(d);
      delay(1000);
   end;
begin
   init;
   for g:=1 to 200 do
     begin
       afihe;
     end;
end.
ответ в bistec@vlz.tkscom.ru


 
N170   (2004-05-25 21:05) [1]

IMHO, "драйвером" Windows ЭТО не является.


 
Игорь Шевченко ©   (2004-05-25 22:07) [2]

http://www.lvr.com/parport


 
tesseract ©   (2004-05-26 10:21) [3]

Сё не драйвер сё просто библиотека. И в 9х ещё есть шанс что она заработает, то в nt никаких - тебя не пустят. Качай спедрова на эту тему.



Страницы: 1 вся ветка

Текущий архив: 2004.07.04;
Скачать: CL | DM;

Наверх




Память: 0.48 MB
Время: 0.024 c
1-1087892731
}|{yk
2004-06-22 12:25
2004.07.04
Как передав SendMessage указатель на строку


8-1082628941
Аноним
2004-04-22 14:15
2004.07.04
Мигания в TImage


1-1087906257
Anton.
2004-06-22 16:10
2004.07.04
TComboBox


1-1087901342
Artem
2004-06-22 14:49
2004.07.04
Как узнать имя динамически создоваемого меню


1-1087382557
Cuper
2004-06-16 14:42
2004.07.04
Вопрос по Borland Pascal 7 (работа с записями)