Advantech PCI-1602 Especificaciones Pagina 84

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 89
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 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 pagina 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89

Comentarios a estos manuales

Sin comentarios