论文部分内容阅读
介绍PC机通讯的书籍、杂志很多,一般是利用PC机的异步通讯适配器与PC机、VAX机、单片机等进行通讯,编写的通讯程序大多数采用BASIC语言、汇编语言和C语言。下面介绍一种用DOS命令直接实现PC机通讯的方法。首先,通讯双方设置异步适配器参数应一致。例如,设置异步通讯口COM1:传输速率为1200BPS,无校验,8位数据位,1位停止位。在PC机中,用MODE命令设置异步适配器参数。 MODE COM1:1200,N,8,1 然后,利用DOS中的COPY命令把异步通讯适配器Com1:作为I/O设备进行通讯。例如: COPY Com1:FILENAME接收文件 COPY COM1:CON: 控制台接收字符 COPY/B FILENAME COM1:发送二进制文件 COPY CON:Comi: 控制台发送字符注意:在异种机进行通讯时,只可以从PC机异步通讯口发送二进制文件,不可以接收二进制文件;而在PC机间进行通讯时则无此限制。
The introduction of PC communication books, magazines a lot, usually the use of PC asynchronous communication adapter and PC, VAX machine, microcontroller and other communication, the preparation of the communication program most of the BASIC language, assembly language and C language. The following describes a DOS command to achieve PC communication method. First of all, the parameters of the asynchronous adapter set by both parties should be the same. For example, set asynchronous communication port COM1: transfer rate is 1200BPS, no parity, 8 data bits, 1 stop bit. In the PC, use the MODE command to set asynchronous adapter parameters. MODE COM1: 1200, N, 8,1 Then, use the COPY command in DOS to communicate the asynchronous communication adapter Com1: as an I / O device. For example: COPY Com1: FILENAME Receive file COPY COM1: CON: Console receives characters COPY / B FILENAME COM1: Send binary COPY CON: Comi: Console sends characters Note: When communicating with a different machine, Communication port to send binary files, can not receive binary files; and PC-to-machine communication is no such restriction.