Autor Beitrag
Thunder00
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Mi 09.04.03 19:21 
Hallo,

Ich möchte den Pin4 einer der COM-Ports auf High setzen und auf Low.

Wie sind die Prozeduren dazu?

Achja: Man soll vorher auswählen können, welcher COM-Port angesteuert werden soll.

Gruß,
Andreas

_________________
If you can't make it good, at least make it looks good. (Bill Gates)
Adrian
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 314



BeitragVerfasst: Mi 09.04.03 21:27 
Titel: COM-Port, Pin4 ansteuern
Hallo Andreas,

eine Antwort, aber mit der üblichen Einschrankung: NT/2000/XP mögen diesen Code nicht:
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
procedure OutPort(PortAddr: Word; DataByte: Byte);
{ Prozedur, mit der ein Byte direkt auf eine Port-Adresse unter Win32
  ausgegeben werden kann }
{$IFDEF WIN32}
assembler; stdcall;
asm
  mov al,DataByte
  mov dx,PortAddr
  out dx,al
end;
{$ELSE}
begin
  Port(PortAddr):=DataByte;
end;
{$ENDIF}

procedure DTR_an_COM1;
{  Es wird die Schnittstelle COM1 verwendet, für COM2 wäre anstelle
  von $3Fx der Wert $2Fx zu verwenden. }
begin
    OutPort($3FC,$FE and InPort($3FC));     {DTR auf 0 }
    OutPort($3FC,$01 or InPort($3FC));      {DTR auf 1 }
end;

Ich habs mal schnell aus einem Programm extrahiert, probiers einfach aus.

Gruß,

Adrian
Thunder00 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 52



BeitragVerfasst: Do 10.04.03 22:17 
Danke.

Wo steht jetzt genau, welcher Pin angesteuert wird und was mache ich bei Com3+4?

Und wie bringe ich das unter NT-Kernel zum laufen??
TVTool kann das au.

Vielleicht irgendn API-Aufruf oder so?

_________________
If you can't make it good, at least make it looks good. (Bill Gates)