论文标准WORD格式排版 74页
摘要
本次毕业设计是在Windows系统下利用VC++开发工具进行开发,主要内容是基于串口的文件传输系统的设计。在设计过程中,做了以下几个方面的工作,首先,对于串口通信的应用前景、实际意义进行简单的概括;其次,对本次设计要用到的Win32 API函数和MSComm控件进行介绍,熟悉各个函数的功能、意义;再次,对设计方案合理性和工程应用价值进行详细的阐述,对用到的技术进行介绍,对串口通信的特点,在特定领域的应用和开发技巧进行描述;最后,给出本次毕业设计的程序代码,供读者参考。
串口通信在各个行业中都有广泛的应用。通过本次毕业设计对VC++开发环境会有更熟练的掌握,对于熟悉开发串口通信的基本原理,对串口在通信产品中的应用会有更加深刻的认识,并根据实际应用需求进行适当的扩展。
关键字:Win32 API,文件传输,串口通信,MSComm控件,VC++
Abstract
This graduation design is developed with VC++ in Windows system, the main content is file transfer system based on Serial port. In the design process, we made the following aspects: First, to present the prospects for Serial port communications applications, a summation of the engineering significance; Secondly, to present the Win32 API function and MSComm controls; Again, to present the practical and the worth of scheme, and Serial port communications features in the application and development skills in specific areas to be describe; Finally, to give the code of current design for the reader reference.
Serial port communication have broad applications in various fields .We can understand the basic principles of Serial port communication in engineering applications and communications products ,and master the development tools VC++ through this design.
Keywords: Win32 API,File Transfer, Serial port communications, MSComm, VC++
目录
摘要 1
第一章 绪论 4
1.1本次毕业设计的选题背景和应用前景 4
1.2 Windows平台下操作系统对串口的管理 8
1.2.1 VC++中对多线程的支持 8
1.2.2多线程在串口通信中的应用 9
1.2.3 串口通信的重叠I/O方式 10
1.3基于串口的文件传输系统设计的主要内容 10
1.4 论文(设计)的整体结构 10
第二章 串口通信程序开发基础知识 11
2.1 串口通信概述 11
2.2 串行通信基础知识 12
2.2.1 串行通信的优点 12
2.2.2 串行通信工作方式 13
2.2.3 串行通信检错与纠错 14
2.2.4 串行通信的速率与传输距离 14
2.2.5 串行通信协议 15
2.2.6 串口通信工作原理 16
2.3 本章小结 18
第三章 串口在通信产品中的应用及开发串口程序的方法 19
3.1 串口在各种通信产品中的功能 19
3.1.1 串口在单片机中的应用 19
3.1.2 上位机与PLC利用串口通信 21
3.1.3 串口在MODEM中的应用 21
3.2 利用VC++开发串口通信程序的方法和特点 22
3.2.1 MSComm控件介绍 23
3.2.2 Windows的API函数介绍 36
3.3 本章小结 43
第四章 本次文件传输系统设计方案 44
4.1 通信协议分析 44
4.1.1 通信流程 44
4.1.2 数据包格式 45
4.2 通信实现思路 46
4.2.1 通信事件的处理方法 47
4.2.2 各种操作状态的含义 49
4.3 界面设计 50
4.3.1 主界面设计 51
4.3.2 参数设置对话框设计 53
4.4 程序流程图设计 54
4.4.1 发送操作各态流程图 54
4.4.2 接收操作各态流程图 57
4.5 串口下文件传输的特点 59
4.5.1 通信工作方式 59
4.5.2 双机间串口通信方式比较 60
4.6 文件传输系统设计用到的编程技术 62
4.7 程序运行的结果分析 64
4.8 程序对串口上可腀@鱿执砦蟮拇 68
4.9 本章小结 68
第五章 毕业设计个人总结 70
致谢 72
参考文献 73
附录 74