摘 要
计算机技术与测试测量仪器技术的结合,是第三代自动测试系统的发展方向。虚拟仪器技术深受国内外测试测量系统人员的欢迎。由于它不但具有简单易懂的图形化显示界面,而且具有非常强大的信号处理与分析的功能。以数据库为中心,以数据管理为重点,构造的基于数据库管理数据的虚拟仪器系统是现代的测试测量系统的发展趋势。本设计就是在这种背景下,利用LabVIEW虚拟仪器技术、数据库访问技术ADO、数据库技术以及相关的一些知识,利用LabVIEW虚拟仪器的强大信号分析处理能力以及简单易懂的图形化编程的特点,设计实现了多种虚拟仪器设备,重点研究了基于数据库技术的具有记忆功能的虚拟仪器设备的实现。应用本设计,用户可以很方便的进行信号采集、信号发生、图形显示、多种信号分析及历史波形复现等功能。本设计充分证明应用ADO技术可以实现LabVIEW访问Access数据库的功能,并且实现简单,使用灵活,无需其他编程语言和复杂的程序,是一种很好的数据库访问方法。 关键字:ADO;LabVIEW;数据库;信号发生器;谐波分析; ABSTRACT With the flying development of computer science, Large Scale Integrated circuit technology and communication technology, there has been large change in the field of instrument technology. As a result of this, one bran-new conception of instrument is apparent, that is Virtual Instrumentation. At present, LabVIEW is applied the most widely as a kind of computer langue in the field of Virtual Instrumentation. LabVIEW which per se is a development environment of software, has been comprehensively used to any field, such as super large scale integration test, factory test, modern electronic household appliance test, and military affairs, navigation, spaceflight, communications, biology and other fields. This paper is on the basis of LabVIEW which introduces the conception of Virtual Instrumentation, ADO which is a method of Accessing to Database, the technique of Database and other knowledge. The characteristic of Virtual Instrumentation is powerful ability of analyze and management, and simple and pellucid graphic program. Using those, this paper designs and carries out several Virtual instrumentations. Among those, the most important design is the Virtual instrumentation which has the function of memory and is base on the technology of Database. With this instrumentation, the user can progress signal acquisition, signal production, graphic display, kinds of signal analysis, the reproducibility of historical waveform and some other functions. Using ADO which is the method of Accessing to Access Database, not only is implemented very simply and used very neatly, but also do not need other language program and complicated program. This paper proves that ADO is a good kind of method of Accessing to Database. Key words:ADO;LabVIEW;Database;Signal generator;Harmonic analysis 目 录 第1章 绪论•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1 1.1 概述•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••1 1.2 基于数据库管理数据的虚拟仪器系统•••••••••••••••••••••••••••••••••••••••••••••••••2 1.3 本设计要实现的功能•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••2 第2章 LabVIEW概述••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••4 2.1虚拟仪器简介••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••4 2.1.1虚拟仪器含义•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••4 2.1.2虚拟仪器的构成•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••4 2.2 LabVIEW概述•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••5 2.2.1 LabVIEW模板简介••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••5 2.2.2虚拟仪器设计步骤•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••6 2.2.3程序调试技术•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••6 2.2.4创建和调用子虚拟仪器程序•••••••••••••••••••••••••••••••••••••••••••••••••••••••7 2.3本章小结••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••8 第3章 信号采集装置与信号发生器的实现•••••••••••••••••••••••••••••••••••••••••••9 3.1信号采集装置与上位机分析软件的接口的程序实现••••••••••••••••••••••••••9 3.2通用信号发生器的原理介绍••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••12 3.2.1傅立叶级数•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••12 3.2.2傅立叶积分和傅立叶变换•••••••••••••••••••••••••••••••••••••••••••••••••••••••••13 3.3通用信号发生器的LabVIEW实现•••••••••••••••••••••••••••••••••••••••••••••••••••••••15 3.4本章小结••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••20 第4章 具有记忆功能的虚拟仪器设备的实现••••••••••••••••••••••••••••••••••••••21 4.1 数据库介绍•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••21 4.2 SQL语句简介••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••22 4.3 ADO对象•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••24 4.4几种LabVIEW访问数据库接口方法的比较••••••••••••••••••••••••••••••••••••••26 4.5 LabVIEW中的ActiveX技术•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••27 4.6具有记忆功能的示波器的实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••28 4.6.1创建数据库•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••29 4.6.2注册ODBC数据源名称(DSN)••••••••••••••••••••••••••••••••••••••••••••29 4.6.3自动生成表的LabVIEW实现•••••••••••••••••••••••••••••••••••••••••••••••••••31 4.6.4ADO执行的LabVIEW实现•••••••••••••••••••••••••••••••••••••••••••••••••••••••34 4.6.5数据存储模块的LabVIEW实现•••••••••••••••••••••••••••••••••••••••••••••••34 4.6.6历史数据复现模块的LabVIEW实现•••••••••••••••••••••••••••••••••••••••36 4.6.7数据库中表删除模块的实现•••••••••••••••••••••••••••••••••••••••••••••••••••••38 4.7本章小结••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••42 第5章 信号分析仪的实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••43 5.1自相关分析模块的实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••43 5.1.1自相关函数•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••43 5.1.2自相关分析模块的LabVIEW实现•••••••••••••••••••••••••••••••••••••••••••44 5.2频谱分析模块的实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••45 5.2.1频谱分析原理•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••45 5.2.2频谱分析的LabVIEW实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••48 5.3功率谱分析模块的实现••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••49 5.4 FFT分析模块与加窗FFT分析模块的实现••••••••••••••••••••••••••••••••••••••••49 5.4.1原理介绍•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••49 5.4.2 FFT分析与加窗FFT分析的LabVIEW实现••••••••••••••••••••••••••••51 5.5综合设计••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••53 5.6仪器使用方法••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••54 5.7本章小结••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••56 结论••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••57 致谢••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••59 参考文献••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••60 附录A•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••62 附录B•••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••63 [1] [2] [3] [4] [5] [6] [7] [8] [9] 下一页 |