Chapter 8 - Using MS-DOS
PL-5910 Series User Manual
8-29
This section explains how to perform serial-type communication with
a PL unit.
RS-232C (COM1/COM2) Cable Connections
<Example 1>
<Example 2>
PL
Dsub 25-pin
PL
Dsub 25-pin
Sample output program
Below is a sample program for sending 1 character from the RS-232C connector.
Because the PL uses an AT-compatible BIOS, the serial communication
BIOS (INT 14 h) does not support communications by interrupt. There-
fore, install a reception interrupt function in the application.
#include <stdio.h>
#include <dos.h>
union REGS ir,or;
main( ){
ir.h.ah
=
0x00 ;
/* Initialization */
ir.h.al
=
0xe3 ;
/* 9600bps,8bit,NONE,1stop */
ir.x.dx
=
0 ;
/* COM1 */
int86 (0x14,&ir,&or) ;
ir.h.ah
=
0x01 ;
/* 1 character output */
ir.h.al
=
0x32 ;
/* ‘2’ */
ir.x.dx
=
0 ;
/* COM1 */
int86 (0x14,&ir,&or) ;
}
Changing commands or parameters also changes function (mode setting, data
reception, etc.).
1
CD
1
FG
1
CD
1
FG
2
RKD
2
SD
2
RKD
2
SD
3
TXD
3
RD
3
TXD
3
RD
4
DTR
4
RTS
4
DTR
4
RTS
5
GND
5
CTS
5
GND
5
CTS
6
DSR
6
DSR
6
DSR
6
DSR
7
RTS
7
SG
7
RTS
7
SG
8
CTS
8
CD
8
CTS
8
CD
9
RI
20
DTR
9
RI
20
DTR
8.2
Serial Communication