文档介绍:用VC开发在Windows下的串口异步通信程序
学生:
指导老师:
计算机科学系
2008年 5月 1 日
用VC开发在Windows下的串口异步通信程序
摘要
异步串行通信在现在的生产生活中被得到广泛的应用,2,常用的串行外设有电传打字机、CRT终端设备、传真机以及远程数据采集设备、通信设备等。串行通信接口标准经过使用和发展,目前已经有多种。但都是在RS-232标准的基础上经过改进而形成的。如何在Windows平台下实现串口通信,也越来越来越多地被得到研究,m控件和直接用Windows API 编程。m控件编程相对来说更简单一些,而直接使用Windows API 编程更灵活一些。m控件来开发串口通信程序,而界面是利用VC++ MFC来做的,这样编程灵活性大,并且能够将主要工作集中在串口编程方面。口实现异步通信,并能根据设置调整异步传行通信参数。
【关键词】串口通信、异步通信、终端、句柄
Abstract
 munication is used more and more in our job and livings. There are two munication port at least in the 1 2. Typewriter, CRT terminal device, electrograph , remote dada receiver, munication device are depended on serial port. With the development of munication port standard, there are many kinds of port standard, but they are developed from the RS-232 standard. How to program munication based on the Windows platform is studied more and more. There are two methods of programming , using Windows API and using m. Using m to program is discussed in the article ,the graphical interface is carried out using MFC. So this method is flexible and we can set focus in programming munication. Two PC municate to each other port and you can change the serial port parameter with the program.
Keywords: serial munication, munication, terminal device, HANDLE
目录
摘要 2
ABSTRACT 3
引言 2
第1章绪论 3
问题的提出 3
研究的意义 3
第2章相关技术简介 6
  串行接口标准 6
  RS-232串行接口标准 8
  其他EIA标准接口 13
++ 的串口通讯 15
munications Control 16
++访问串口。 18
m控件介绍 24
m控件的通讯的方式 24
m控件的属性 25
第3章系统设计 31
系统功能设计 31
算法分析 33
第4章系统调试与运行 38
38
38
38
39
39
第5章结论 40
致谢 41
参考文献 42
引言
在Windows应用程序的开发过程中,相互之间常常需要通信。而串口是工业控制中计算机与外部串行设备之间常用的数据传输通道,由于串行通信方便易行,其应用非常广泛。本文将介绍串行通信的基本原理、在Windows平台下的工作机制和用VC实现串行通信的方法。
串口是工业控制中计算机与外部设备之间常用的数据传输通道。但在Windows环境下,计算机系统完全接管了各种硬件资源,不允许用户直接控制串口的中断管理,用户只能通过一些Windows开发软件,如Visual Basic、Visual C++等才能控制计算机的底层资源。Visual C++因其高性能编译技术、面向对象设计方法、可视化开发环境等特点得到广泛的应用,它包含了丰富的