Advantech PCI-1602 Spécifications Page 84

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 89
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 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;
Vue de la page 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89

Commentaires sur ces manuels

Pas de commentaire