Advantech PCL-740 Especificações Página 26

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 29
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 25
Appendix A Register structure and format 23
/* Receive data on Port 2 (COM2) */
i=0;
flag=1;
timeout=TIME_OUT;
while (flag)
{
/* Check for received data on port*/
if ((inportb(base1+5) & 1) !=0)
{
rec[i]=inportb(base1); /* Receive data */
if (rec[i] == 0x0d)
{
rec[i+1]=’\0';
flag=0;
printf(“\nReceived data: %s\n”, rec);
}
i++;
}
else
{ /* Check timeout */
timeout—;
if (timeout == 0)
{
flag = 0;
printf(“\nTimeout error\n”);
}
}
} /* End of receive data while() */
printf("\nEnter string (max 15 char) or Q to quit:");
gets(cmd);
} /* End of "Enter string" while() */
} /* End of main() */
Vista de página 25
1 2 ... 21 22 23 24 25 26 27 28 29

Comentários a estes Manuais

Sem comentários