logo资料库

USB-GPIB转接器驱动程序及相关应用软件的实现.pdf

第1页 / 共74页
第2页 / 共74页
第3页 / 共74页
第4页 / 共74页
第5页 / 共74页
第6页 / 共74页
第7页 / 共74页
第8页 / 共74页
资料共74页,剩余部分请下载后查看
电 子 科 技 大 学 UNIVERSITY OF ELECTRONIC SCIENCE AND TECHNOLOGY OF CHINA 硕士学位论文 MASTER DISSERTATION 论 文 题 目 USB-GPIB 转接器驱动程序及 相关应用软件的实现 学 科 专 业: 测试计量技术及仪器 指 导 教 师: 陈光礻禹   教授 博导 作 者 姓 名: 边海龙 班 学 号: 02S070013
分类号 密级 UDC 注 1 学 位 论 文 USB-GPIB 转接器的驱动程序及 相关应用软件的实现 (题名和副题名) 边海龙 (作者姓名) 指导教师姓名 陈光礻禹   教授 博导 电子科技大学 成都 (职务、职称、学位、单位名称及地址) 申请学位级别 硕士 专业名称 测试计量技术及仪器 论文提交日期 2004.4 论文答辩日期 2004.5 学位授予单位和日期 电子科技大学 答辩委员会主席 评阅人 注 1 注明《国际十进分类法 UDC》的类号 年 月 日
电子科技大学硕士论文 独 创 性 声 明 本人声明所呈交的学位论文是本人在导师指导下进行的研究工作及取得的 研究成果。据我所知,除了文中特别加以标注和致谢的地方外,论文中不包含其 他人已经发表或撰写过的研究成果,也不包含为获得电子科技大学或其它教育机 构的学位或证书而使用过的材料。与我一同工作的同志对本研究所做的任何贡献 均已在论文中作了明确的说明并表示谢意。 签名: 日期: 年 月 日 关于论文使用授权的说明 本学位论文作者完全了解电子科技大学有关保留、使用学位论文 的规定,有权保留并向国家有关部门或机构送交论文的复印件和磁 盘,允许论文被查阅和借阅。本人授权电子科技大学可以将学位论文 的全部或部分内容编入有关数据库进行检索,可以采用影印、缩印或 扫描等复制手段保存、汇编学位论文。 (保密的学位论文在解密后应遵守此规定) 签名: 导师签名: 日期: 年 月 日 I
电子科技大学硕士论文 摘 要 本文论述了基于 USB(Universal Serial Bus 通用串行总线)的 GPIB (General Purpose Interface Bus 通用接口母线)控制器的软件设计与实现。 USB 接口是在 90 年代兴起的新型的计算机外接设备的总线接口,发展到现 在,已经是一个成熟的,被众多的计算机设备厂商所广泛采用的接口技术。GPIB 是广泛应用于电子测量仪器的一种总线接口。利用该接口可以将电子测量仪器组 建成模块化,积木式的自动测试系统。过去对这种系统的控制是利用专用的工业 控制机来进行的。 将两种总线接口技术结合起来,便最大限度地发挥了这两种总线的优点。 使得自动测试系统的组建更为方便,而通过 USB 接口将通用的个人计算机引入 到自动测试系统中,利用 USB 接口即插即用和高速传输的特性,更是极大地方 便了测试者的使用。 本文在扼要说明 USB 总线协议和 GPIB 协议基础上,将重点讨论转接器的驱 动程序及相关软件部分,即该系统在 WINDOWS 系统内部的软件的设计与实现。 主要包括:基于 GPIB 总线命令的动态链接库的编写,以及上层测试和应用程序 的设计。 本文第一章介绍了基于 USB 的 GPIB 转接系统的理论与现实意义,和课题 的产生背景;第二章介绍 USB 和 GPIB 这两种总线的特点,并对转接系统的软 硬件层次结构作了简要介绍;第三章介绍接口卡在 WINDOWS 系统中的 WDM 模式的驱动的实现;第四章介绍该驱动程序在编写过程中发现并克服的主要难 点,以及编写该程序的几个关键部分;第五章介绍了驱动程序的调试与安装以及 面向操作者的应用程序的编写;第六章介绍在 WINDOWS 操作系统中通过该接 口操作 GPIB 仪器所实现的动态链接库程序的实现;第七章对整个系统做出了总 结,提出系统的不足以及应改善的部分,以便在后续的工作中,可以使整个系统 更趋于完善和稳定。 关键词: USB GPIB; 自动测试系统 驱动 动态链接库 1
电子科技大学硕士论文 Abstract This paper is focus on the GPIB (General Purpose Interface Bus) system based on the USB (Universal Series Bus). And we will talk about the design and implement of the software of this system in detail. USB is a kind of new technique developed from the 90’s. Now it is matured and adopted by more and more computer device manufactures. GPIB (General Purpose Interface Bus) is applied in the electronic automatic measure system widely. Using this kind of interface, we can setup the automatic measure system by many series of blocking. During the past long time we have to use the special industrial control machine to control this kind of test system. So if we combine these two kinds of buses and implement them in the ATS, the advantages of them will be exerted by the maximum,also we can set up the ATS with more convenience. Using the USB interface we can use the personal computer to control the automatic measure system. And because it has the characteristic of plug and play (PNP) and high-speed data transport, the USB interface lets the users of ATS feel more easily and convenience. First we will introduce the protocol of USB and GPIB briefly, then talk over the software of this system particularly, namely, the programming in the Windows system. The software includes of the driver of the transform card in the Windows system, the program of the dynamic link library based on the instruments of the GPIB system, and the application of the system faced to the users. Chapter one introduces the academic and practical signification of the implement of this system, and the background of the topic. Chapter two introduces the characteristics of the USB and GPIB, and the layered structure of the software. Chapter three introduces the implement of the driver of the controller in the Windows system in WDM model. Chapter four introduces the key points of the driver program. Chapter five introduces the install and debug of the driver program, and introduces application for the users. 2
电子科技大学硕士论文 Chapter six introduces the programming of the dynamic link library. Chapter seven makes a conclusion of the whole system. Key word: USB GPIB; Automatic-measure-system Driver Dynamic-link-library 3
电子科技大学硕士论文 目 录 中文摘要 英文摘要 摘 要 .....................................................................................................................1 Abstract..........................................................................................................................2 中文摘要 .......................................................................................................................1 英文摘要 .......................................................................................................................1 第一章 引言 ...............................................................................................................1 1.1 课题背景..................................................................................................................1 1.2 课题的实现思路.....................................................................................................1 1.3 课题任务.................................................................................................................2 1.4 课题实现的意义.....................................................................................................2 第二章 系统体系结构 .................................................................................................4 2.1 系统的协议体系.....................................................................................................4 2.1.1 USB 协议简介......................................................................................................4 2.1.2 GPIB 协议简介 ....................................................................................................6 2.2 系统的硬件结构.....................................................................................................6 2.3 系统的软件分层结构.............................................................................................7 第三章 驱动程序的设计与实现 .................................................................................9 3.1 WDM 与 NT 式驱动程序.......................................................................................9 3.1.1 WDM 与 NT 式驱动程序区别与联系................................................................9 3.1.2 WDM 的合理性 .................................................................................................10 3.2 驱动程序工程的文件组成...................................................................................11 3.2.1 INF 文件 .............................................................................................................11 3.2.1.1 Version 节 ........................................................................................................11 3.2.1.2 DestinationDirs 节 ...........................................................................................12 1
电子科技大学硕士论文 3.2.1.3 SourceDisksNames 节 .....................................................................................12 3.2.1.4 SourceDisksFiles 节.........................................................................................13 3.2.1.5 Manufacturer 节...............................................................................................13 3.2.1.6 Install 节...........................................................................................................14 3.2.1.7 Install.Service 节..............................................................................................15 3.2.1.7 Strings 节 .........................................................................................................16 3.2.2 C 与.H 文件........................................................................................................16 3.2.3 其他文件............................................................................................................17 3.3 驱动程序的结构...................................................................................................18 3.3.1 Windows 体系概述 ...........................................................................................18 3.3.2 驱动程序的类型................................................................................................20 3.3.3 驱动程序的分层................................................................................................20 3.4 USB 客户驱动的目标...........................................................................................21 3.4.1 USB 设备的结构简介........................................................................................21 3.4.2 USB 驱动程序的结构........................................................................................22 3.4.3 USB 驱动程序应该完成的任务........................................................................23 3.4.4 驱动程序的语言和库........................................................................................23 3.5 USB 设备驱动程序的实现...................................................................................24 3.5.1 驱动程序的入口点和回调例程........................................................................24 3.5.2 分发例程............................................................................................................25 3.5.3 创建设备............................................................................................................25 3.5.4 硬件资源的分配................................................................................................26 3.5.5 数据传输............................................................................................................26 3.5.6 电源管理............................................................................................................26 第四章 USB-GPIB 驱动程序实现的重点与难点 ....................................................29 4.1 接口卡的初始化...................................................................................................29 4.1.1 检查和配置设备................................................................................................29 2
分享到:
收藏