Autor Beitrag
hedie
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 16:12 
Hallo Zusammen


Ich benutze Die IO.dll um den LPT Port anzusteuern (habe eine 7 Segment anzeige Angesteuert) Jezt möchte ich das wen ich die hardware anschliesse (7Segment anzeige) eine checkbox ge checkt ist ja das ist nicht das problem
das problem ist, wenn ich einer der eingangs pins des LPT mit masse (gnd) verbinde, um herauszufinden ob die hardware angeschlossen wurde wird automatisch d2 Aktiviert. Aber dass wil ich nicht weil ich ja sonst die zahlen nicht anzeigen kann :wink: also hat jemand ne idee

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Sa 26.03.05 17:09 
Servus!

Wenn ich meine Kristallkugel richtig justiert habe, dann willst Du feststellen, ob die 7-Segment-Anzeige am LPT angesteckt ist. Dazu solltest Du einen der Eingänge SLCT, PE, BUSY, ACK oder ERROR auf Masse legen und dann diesen Eingang, der normalerweise auf Adresse $379 liegt, abfragen. Zumindest bei meinen bisherigen Versuchen hat das einwandfrei funktioniert, auf D2 hat das keinen Einfluß.

Gruß,

Adrian
hedie Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 249

WIN XP WIN 2000 WIN Longhorn
D7 Pers D2005 Architect Vollversion
BeitragVerfasst: Sa 26.03.05 18:25 
Wie Funktioniert das Mit der IO.dll (bitte ein beispiel tschege es überhaupt nicht :oops: )

_________________
Grüsse hedie
hört auf traurig zusein hört lieber radio Basilisk
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Sa 26.03.05 19:13 
Servus hedi!

Wenn man weiß, wie's geht, ist's ganz einfach :wink:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
unit Unit1;

interface

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

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

var
  Form1: TForm1;

implementation

{$R *.DFM}

procedure PortOut(Port : Word; Data : Byte); stdcall; external 'io.dll';
function PortIn(Port:Word):Byte; stdcall; external 'io.dll';

procedure TForm1.Button1Click(Sender: TObject);
var
  Gelesen: Byte;
  DingDran: Boolean;
begin
  Gelesen:=PortIn($379);
  if (Gelesen and $10)=0 then
    DingDran:=False
  else
    DingDran:=True;
end;

end.

Im Beispiel gehe ich davon aus, daß Du eine Leitung vom Pin25(GND) auf Pin13(SLCT) auf der Platine mit der 7-Segment-Anzeige gezogen hast. Der SLCT-Eingang wird über Bit4(0..7) abgefragt, ist das Bit4=0, dann liegt an SLCT Masse-Potential. Da die LPT-Schnittstelle interne Pull-up-Widerstände hat, ist also bei offenem Eingang das Bit4=1. Und wie ich schon sagt: Die Ausgänge bleiben vom Zustand der Eingänge unbeeinflußt.

Gruß,

Adrian

(Bzgl. Deiner PN: nix für ungut)