Advantech PCI-1602 Spezifikationen Seite 84

  • Herunterladen
  • Zu meinen Handbüchern hinzufügen
  • Drucken
  • Seite
    / 89
  • Inhaltsverzeichnis
  • LESEZEICHEN
  • Bewertet. / 5. Basierend auf Kundenbewertungen
Seitenansicht 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;
Seitenansicht 83
1 2 ... 79 80 81 82 83 84 85 86 87 88 89

Kommentare zu diesen Handbüchern

Keine Kommentare