摘要I摘要随着现代信息技术的飞速发展以及计算机网络的广泛应用,计算机通信技术已经日趋成熟。通过上位机来控制下位机的运行、维护与优化得到了广泛的应用。串行通信是一种广泛使用且实用的通信方式,由于具有线路简单、应用灵活、可靠性高等一系列优点长期以来获得了广泛的应用。计算机串行通信在数据通信、故障检测、计算机远程监控等方面有广泛的应用与利用价值,特别是在Windows下的串口通信可以充分利用Windows下的软件资源优势,实现多任务条件下对外部的数据传输、信息收集和处理。本系统使用VisualStudio2010的编程环境来编程。结合.NETFramework类库中提供的SerialPort类来编写接收来自人耳听力测试仪下位机发送的数据。实现了对下位机数据的采集、存储,进而对存储数据的分析来了解不同年龄、性别、地区人群的可以听到的频率范围,并为人们提供一些实用的建议与保护听力的方法。关键词:VisualStudio2010;串口通信;监测界面;波特率AbstractIIAbstractWiththerapiddevelopmentofmoderninformationtechnologyandthewideapplicationofcomputernetwork,computercommunicationtechnologyhasbecomemoremature.Byusingcomputertocontrolamachineoperation,maintenanceandoptimizationofawiderangeofapplications.Serialcommunicationisawidelyusedandpracticalwayofcommunications,becauseofthelineissimple,flexibleapplication,highreliability,aseriesofadvantagesforalongtimewidely.Computerserialcommunicationindatafinance,datacommunication,faultdetection,remotecomputermonitoringandwithextensivepracticalvalue,especiallyunderWindowsofserialcommunicationcanmakefulluseoftheresourceadvantagesoftheWindowssoftware,realizingmulti-dutiesconditionsofexternaldatatransmission,informationcollectionandprocessing.ThissystemusingVisualStudio2010programmingenvironmenttoprogramming.Combinedwiththe.netFrameworkclasslibraryprovideSerialPortclasstowritethecuesfromthehumanearhearingtesterwhothedatasentthemachine.Torealizethenextplacemachinedataacquisition,storage,andthentostoredataanalysistounderstandthedifferentage,gender,regionalpeoplecanheartherangeoffrequencies,andprovidepeoplewithsomepracticalSuggestionsandprotectthehearingthemethod.Keywords:Informationtechnology;Serialcommunication;PC;Frequency目录I目录摘要·····························································································IAbstract······················································································II1绪论··························································································71.1课题研究背景··········································································11.2人耳听力测试仪国内外研究现状··················································61.3课题研究的目的和意义······························································22系统总体设计··········································································412.1系统总体设计描述··································································342.2系统设计原则与要求·······························································342.3系统总体方案的确定·······························································343系统硬件电路设计···································································413.1.1功放电路设计································································423.1.2信号发生器电路设计·······················································433.1.3显示电路设计································································444人耳听力测试仪上位机软件的实现········································334.1开发语言与开发环境简介·························································344.1.1C#语言和.NETFramework·················································354.1.2VisualStudio2010简介····················································364.2人耳听力测试仪上位机软件的实现·············································374.2.1上位机软件的编程实现过程··············································384.2.2上位机软件的界面设计····················································394.3上位机软件与数据库的连接·······················································324.3.1SQLSERVER2005数据库简介·········································384.3.2上位机软件与SQL数据库连接的实现·································394.4上位机软件的调试···································································395串行通信··················································································75.1串口通信接口定义···································································85.2RS232串行通信接口·····························································115.3串行通信协议········································································11目录II5.3.1同、异步串行通信协议描述··············································395.3.2传输制式······································································395.3.3串行通信的基本参数·······················································395.4实现串行通信多种方法概述······················································265.4.1串行通信WindowsAPI函数·············································275.4.2串行通信组件································································285.5SerialPort类·········································································295.5.1SerialPort常用属性和方法·················································315.5.2SerialPort的使用·····························································32总结····························································································45致谢····························································································46参考文献·····················································································47附录····························································································48河北工程大学毕业设计论文31绪论1.1课题研究背景随着现代电子技术的不断进步和信息技术的飞速发展,以及计算机的迅速普及和计算