目录摘要......................................................................IIIAbstract....................................................................V第一章串行通信的介绍......................................................11.1串行通信方式.........................................................11.2串行通信的传送方向...................................................21.3串行输入/输出........................................................21.4串行接口标准.........................................................2第2章串口编程技术..........................................................52.1串口实现双机互联系统功能概述.........................................52.2VB串口查询法的实现方法..............................................5第3章SPCP通信协议设计.....................................................93.1串行通信协议.........................................................93.2SPCP协议的发送格式.................................................13第4章双机互联程序的实现...................................................154.1创建标准的项目文件..................................................154.2加入串口通信控件....................................................154.3设计程序主窗体......................................................16第5章程序的测试与运行.....................................................215.1软件及硬件测试......................................................215.2总结................................................................24附录.......................................................................25串口实现双机通信摘要计算机串口编程在通信软件中有着十分广泛的应用,如电话、传真、视频和控制等。很多行业会涉及到串口通信技术。串行通信中分为异步通信和同步通信两种基本串行通信方式,串行通信在两个设备之间传输,有单工、半双功、全双工三种形式。在本论文中,串口实现双机互联是通过串口线直接连接两台计算机,按照自定义的串口通信协议(简称为SPCP)进行信息交换。通过VB中MSComm控件处理底层串口通信细节,根据自定义串口通信协议建立连接,实现聊天和文件传输功能。关键字:VB,串口通信,SPCP,数据交换。serialcommunicationAbstractSerialcomputerprogramminginthecommunicationssoftwarehasaverywiderangeofapplications,suchastelephone,fax,videoandcontrol.Manyindustrieswouldinvolveserialcommunicationtechnologies.Serialcommunicationisdividedintoasynchronouscommunicationsandsynchronouscommunicationaretwobasicserialcommunication,serialcommunicationbetweenthetwotransmissionequipment,asingle-workers,half-duplex,full-duplexthreeforms.Inthispaper,toachievedouble-serial-lineInternetdirectlythroughtheserialporttoconnecttwocomputers,inaccordancewiththecustomofserialcommunicationprotocol(referredtoasSPCP)forinformationexchange.VBMSCommcontrolthroughtreatmentinthebottomofserialcommunicationdetails,accordingtocustomserialcommunicationprotocoltoconnect,andchatandfiletransferfeature.Keyword:VB,serialcommunication,SPCP,dataexchange.第一章串行通信的介绍1.1串行通信方式在计算机与外设之间的信息传送中,按照一次传送数据的位数分类,可分为:并行传送方式和串行传送方式。并行传送方式为数据的各位同时传送;串行传送方式为数据的各位按一定的顺序逐位分时传送。串行传送适用于长距离通信系统及各类计算机网络。由于信息在一个方向上传输只占用一根传输线,而这根线上既传送数据,又传送联络信号,为此为区分这根线传送的信息流中,哪一部分是联络信号,哪一部分是数据,就必须引出串行通信的一系列约定。于是,在串行通信中就有异...