上位机软件设计
摘要
设计高速突发误码测试仪上位机的主要目的是配合高速误码测试仪下位机工 作,提供了用户和设备的接口。 本文的主要内容介绍了一种基于 C++语言开发的控制软件。简要叙述软件的各 个功能模块的主要功能,重点介绍程序设计流程设计思想,多线程技术在处理串口 通信时的应用和 Access 数据库的使用以及程序设计、界面设计、控件使用的方法。 对下位机高速突发误码测试仪的工作原理和设计思想进行了简要的阐述。在介绍软 件编写流程以及编程技巧的同时,本文着重讲述了编程思路以及编写流程等内容。 本文讲述了使用 Microsoft Visual Studio, MFC 基于对话框 .NET FrameWork 框架设计 的程序调试的基本方法,以及数据可靠性传输,错误处理机制,调试过程,程序运 行结果分析等内容。 在运行调试过程中,遇到的一些问题通过查阅资料等方法得到了一套很好的解 决方案。程序运行的结果均达到了预期的结果,上位机和下位机之间通讯可靠性满 足要求。但是,也有不足之处。例如:界面美化方面可以进一步加强,数据库操作 方面应该更加灵活。
关键词:上位机软件
串口通信 Access 数据库
C++
控件
界面设计
I
Abstract
The main purpose is to design high-speed burst BER tester host computer with high-speed BER tester-bit machine, a user and device interface. The main content introduce a kind of C+ + language development of control software.Briefly describes the software of the various functional modules main function, focus introduced the program design process design thinking, multi-threading technology in the handling serial communication applications and the Access database to use , as well as program design, interface design, the control methods used. A brief exposition of the lower machine speed burst error tester works and design ideas. In the introduction of software development, processes, and programming skills at the same time, the article focuses on the content of the programming ideas and writing process. This article describes the Microsoft Visual Studio MFC dialog box. NET FrameWork framework programs designed debugging methods. As well as the content of the reliability of data transmission, error handling, debugging process, the results of analysis of the program is running. The Result of the program, some of the problems encountered by the data access methods such as a good solution. The results of the program is running to achieve the desired results, communication between the PC and the next bit machine reliability to meet the requirements. However, there are deficiencies. For example: interface landscaping to further strengthen the database operations to be more flexible.
3.1 通讯协议实现可靠性传输设计 .................................................................................... 9 3.2 3.3 4 组建和解析通讯帧....................................................................................................... 10 出错处理机制............................................................................................................... 10
Key words: PC software serial communication C + + control interface design
II
目
录
摘 要........................................................................................................................................... I Abstract................................................................................................................................... II 绪论 ............................................................................................................................................ 1 1 设计思路及系统简介......................................................................................................... 2
4.1 4.2 5
主要控件介绍................................................................................................................... 16 MSComm 控件使用.......................................................................................................... 16 ADO 控件使用................................................................................................................ 17 DateGrid 控件使用 ......................................................................................................18 常用控件使用............................................................................................................... 18
5.1 5.2 5.3 5.4 6
数据库操作 ........................................................................................................................22 创建数据库连接........................................................................................................... 22 数据库读写操作........................................................................................................... 23
2.1 软件设计流程.......来自......................................................................................................... 5 2.2 软件层次划分以及主要功能模块 ................................................................................ 7 2.3 模块功能的实现 ............................................................................................................. 7 3 可靠性数据传输................................................................................................................. 9