Lire port parallèle

revsys Messages postés 15 Date d'inscription lundi 13 mars 2006 Statut Membre Dernière intervention 7 juin 2007 - 3 mai 2007 à 17:20
revsys Messages postés 15 Date d'inscription lundi 13 mars 2006 Statut Membre Dernière intervention 7 juin 2007 - 4 mai 2007 à 12:11
Bonjour,

J'utilise ZLportIO pour pouvoir communiquer avec le port parallèle, et plus précisement pouvoir lire la pin n°14.

procedure TForm1.FormCreate(Sender: TObject);
begin
        begin
                ZLInit;
                ZLIOSetIOPm(True);
                PortWriteB($378, 0); // Ecriture LPT1
                Timer1.Interval := 100;
                Timer1.Enabled := True;
        end;
end;


procedure TForm1.Timer2Timer(Sender: TObject);
begin
        Try
                Label4.Caption := IntToStr(PortReadB($378)); // Lecture LPT1
        Except
        end;
end;

procedure TForm1.FormDestroy(Sender: TObject);
begin
        ZLFinalize;
end;

Ici le programme de Sub0 permet de lire le port, mais comment fait-on pour récupérer seulement l'information située sur la pin 14 ?
Il faut faire un masque binaire d'accord, mais comment coder cela ? (J'ai commencé le Delphi il y a 1semaine)

Merci d'avance...

1 réponse

revsys Messages postés 15 Date d'inscription lundi 13 mars 2006 Statut Membre Dernière intervention 7 juin 2007
4 mai 2007 à 12:11
0
Rejoignez-nous