Appendices
App-10
PL-5900 Series User Manual
1
CD
1
FG
1
CD
1
FG
2
RD
2
SD
2
RD
2
SD
3
TD
3
RD
3
TD
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
A.3
Serial Communication
This section explains how to perform serial communications with the
PL.
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. Therefore, 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 re-
ception, etc.).