我在研究怎样做一个在Delphi中PCi总线设备进行通讯的系统,不知那位大侠有这方面的资料或者技术,请不吝赐教

解决方案 »

  1.   

    应该人家都有说明书和DEMO的,以前弄高速公路收费系统的时候一安装驱动就有DEMO了。修改DEMO就可以使用了。下面随便贴段代码,参考一下:
    procedure TForm3.Timer1Timer(Sender: TObject);
    var
     buf,inputstring:string;
     dotpos:integer;
     x:integer;
     begin
      try
       x:=1;
       i:=i+1;
       inputstring:='#'+'02'+chr(13);
       Mscomm1.Output:=inputstring;
       sleep(150);
       buf:=trim(Mscomm1.Input);
       buf:='+0.3200+0.4400+0.5600+0.6700+0.7800';
       if buf='' then
       begin
         timer1.Enabled:=false;
         showmessage('取值失败!');
         exit;
       end;
       if pos('.',buf)<1 then
        begin
        timer1.enabled:=false;
        showmessage('返回的数据错误!请重新采集.');    exit;    end
       else
        begin
           dotpos:=pos('.',buf);
           a[i]:=strtofloat(copy(buf,dotpos-1,6));
           buf:=copy(buf,dotpos+4,length(buf)-7);
           dotpos:=pos('.',buf);
           b[i]:=strtofloat(copy(buf,dotpos-1,6));
           buf:=copy(buf,dotpos+4,length(buf)-7);
           dotpos:=pos('.',buf);
           c[i]:=strtofloat(copy(buf,dotpos-1,6));
           buf:=copy(buf,dotpos+4,length(buf)-7);
           dotpos:=pos('.',buf);
           d[i]:=strtofloat(copy(buf,dotpos-1,6));
           buf:=copy(buf,dotpos+4,length(buf)-7);
           dotpos:=pos('.',buf);
           e[i]:=strtofloat(copy(buf,dotpos-1,6));
           with paintbox1.Canvas do
             begin
              pen.Width:=2;
              if flag1=1 then
               begin
                edit1.Text:=floattostr(a[i]);
                pen.Color:=clred;
                moveto((i-1),400-trunc(400*a[i-1]));
                lineto(i,400-trunc(400*a[i]));
               end;
              if flag2=1 then
               begin
                edit2.Text:=floattostr(b[i]);
                pen.Color:=clmaroon;
                moveto((i-1),400-trunc(400*b[i-1]));
                lineto(i,400-trunc(400*b[i]));
               end;
              if flag3=1 then
                begin
                edit3.Text:=floattostr(c[i]);
                 pen.Color:=clpurple;
                 moveto((i-1),400-trunc(400*c[i-1]));
                 lineto(i,400-trunc(400*c[i]));
              end;
              if flag4=1 then
               begin
                edit4.Text:=floattostr(d[i]);
                pen.Color:=cllime;
                moveto((i-1),400-trunc(400*d[i-1]));
                lineto(i,400-trunc(400*d[i]));
               end;
              if flag5=1 then
                begin
                 edit5.Text:=floattostr(e[i]);
                 pen.Color:=clblue;
                 moveto((i-1),400-trunc(400*e[i-1]));
                 lineto(i,400-trunc(400*e[i]));
                end;
             end;
          end;
       except
         showmessage('rong');
         timer1.enabled:=false;
       end;
     end;
      

  2.   

    我也正在研究这个问题,希望能够有高手答复!
    有没有什么api访问pci卡?
      

  3.   

    是数据采集卡吗?可以用研华的,他们的PCI数据采集卡有官方驱动下载,支持2000/xp。而且包含Delphi示例。