Advantech PCI-1602 Especificações Página 84

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 89
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 83
Appendix A Register Structure and Format
77
Programming example
The following C example shows how to program the PCL-743/745
registers directly. It uses I/O ports hex 3F8 and 2F8 to test the PCL-
743/745 send, receive and FIFO functions.
/
***************************************************/
/* Program: DEM001.C
*/
/* Description:
*/
/* Sends a string from COM1 to COM2 then reads
*/
/* it back from COM2 and displays it on the
*/
/* screen. It uses direct register control.
*/
/
***************************************************/
# include <dos.h>
# include <io.h>
# include <stdio.h>
# include <conic.h>
/* Timeout value in seconds */
#define TIME_OUT 10000
static int base0=0x3f8; /* Port 1 base address
(COM1)*/
static int base1=0x2f8;/*Port 2 base address
(COM2)*/
static char rec[16]; /* Receive buffer */
static char CMD[16]; /* Command buffer */
Void main()
{
int i;
timeout; /* counter for timeout */
char flag;
Vista de página 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89

Comentários a estes Manuais

Sem comentários