Indramat MINIDRIVE DMD02.1 Manuel D'utilisation page 87

Table des Matières

Publicité

MiniDrive
DOK-MINIDR-DMD/MMD*POS-AW03-FR-P
void readpacket(void)
{
int test;
test=readbyte(com);
if(test == 0x05)
{
writebyte(com,0x04);
test=readbyte(com);
test=readbyte(com);
test=readbyte(com);
test=readbyte(com);
test=readbyte(com);
writebyte(com,0x06);
}
}
void setparam(valeur longue)
{
if (valeur== 1)com = COM1;
if (valeur== 2)com = COM2;
}
void ser_init(int port,long brate,unsigned char para)
{
outp(port + LCR,DLENABLE);
outp(port + DLL,(unsigned int)((MAXBAUD/brate) & 0xff));
//Positionnement Lowbyte
outp(port + DLM,(unsigned int)(((MAXBAUD/brate) >> 8) & 0xff));
//Positionnement Highbyte
outp(port + LCR,para);
outp(port + IER,0x00);
outp(port + MCR,0x02);
outp(port + FCR,0x07);
inp(port + THR);
}
int writebyte(int port,unsigned char writebyte)
{
while(!(inportb(port + LSR) & THREMPTY));
//attendre jusqu'à ce que le tampon soit vide
outportb(port + THR, writebyte);
output
return 0;
}
int readbyte(int port)
{
while(!byteavail(port));
return(inportb(port + RHR));
}
int byteavail(int port)
{
return(inportb(port + LSR) & DATARECEIVED);
}
Interface
// émission de enq
// lecture des info en retour
// du variateur
// émission de ack
//activation registre diviseur
//Réglage des paramètres
//Effacer PEPS + valider
//sortie caractère en
//attendre sortie caractère
//puis retourner
6-9

Publicité

Table des Matières
loading

Ce manuel est également adapté pour:

Minidrive mmd

Table des Matières