毕业论文外文翻译-使用组态王实现车库监控.doc_第1页
毕业论文外文翻译-使用组态王实现车库监控.doc_第2页
毕业论文外文翻译-使用组态王实现车库监控.doc_第3页
毕业论文外文翻译-使用组态王实现车库监控.doc_第4页
毕业论文外文翻译-使用组态王实现车库监控.doc_第5页
已阅读5页,还剩6页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

毕业设计(论文)中英文资料题目 使用组态王实现车库监控 专 业 名 称 自动化班 级 学 号 108202217学 生 姓 名 指 导 教 师 填 表 日 期 2014 年 3 月 9 日基于组态王的监控系统设计及数据处理李琳郭文成(天津工业大学,天津300160)在某污水处理系统监控系统设计中,笔者采用组态王65、单片机、ACCESS和ECEL的合设计了整个监控系统。上位机采用研华的工控PC机,系统监控采用组态王软件;底层数据采集和控制由PLC、单片机、智能仪表完成。由于组态王在数据库功能上比较薄弱,在设计中采用SQL技术将数据保存到MSACCESS2000中,并且通过VBA(VlsuaI Basic For App“cation)编程实现ECEL对ACCESS数据库的查询。1 系统概述系统中存在多种不同类型的监控变量,其中有一部分需要控制的变量(如压力等),这可以用PLC实现控制;有一部分变量只需要采集(如温度、电流等),这些量可以通过用组态王支持的智能仪表进行采集;还有一部分只需要采集的数据由于所用的采集仪表不能和组态王直接通讯,所以采用单片机AT89C52编写程序实现现场数据采集,并采用通用单片机ASC JI通信协议实现单片机和组态王的数据共享。整个系统结构上采用多级分布式结构,分为2个数据采集站和1个监控总站;按照功能划分本系统则分为设备现场控制、现场数据采集、远程设备监控三部分。底层由PLC、单片机、智能仪表组成其中,PLC主要完成现场控制设备的控制。单片机和智能仪表完成对现场数据的采集。数据采集站作用是与底层的PLC、单机和智能仪表通讯,获取生产过程的数据,显示工艺流程,历史曲线图,实时曲线图、报警画面、生成数据库等。监控总站与数据采集站通过以太网连接,以获取生产工艺参数,报警记录等数据信息。监控总站可以根据操作人员的选择切换监视各个数据采集系统的运行情况。监控总站计算机还完成网络服务器的功能,将这些生产参数上网传输,实现网络化远程监控。2软件设计整个监控软件以组态王65作为编辑平台。整个监控系统具有如下主要功能:1)总体监控:显示采集数据的实时值,组态王通过和底层PLC、智能仪表和单片机通讯,访问相关设备寄存器来获得各设备的运行情况,并通过动画连接、实时曲线等显示出来。2)历史曲线:显示系统运行的时候各个主要变量的历史记录,可以查询以前的历史记录时段,任意时间的记录。3)控制功能:在上位机端可对底层PLC、智能仪表进行控制,实现远程控制。4)数据存储:每隔一定时间将数据保存到ACCESS中,方便以后的查询,所保存的数据还可以通过ECEL进行查询,进行二次处理。5)报警功能:当有事故或故障发生时,微机通过外接音箱发出语音报警,并在微机屏幕上给出提示;报警画面上可以设置报警的上限、上上限、下限和下下限,当超过了设置的范围时就会有报警,保证了系统的安全运行。6)打印功能:打印各种报表、历史曲线、运行记录、报警数据等。PLC和组态王所支持的智能仪表与组态王之间的通讯不需要编写程序读取设备的内部寄存器的值,相关的驱动程序已经集成在组态王中,只需要在组态王中定义对应的设备,并定义相应的IO变量即可读取设备内部寄存器的值。而组态王所不支持的仪表则由单片机进行数据采集、转换,并且由单片机通过通用单片机ASCI|通信协议和组态王数据共享。当组态王要读取单片机的数据时,将会向单片机发送基于该协议的读命令包,单片机响应后,将数据发送给组态王,其数据发送格式也是基于通用单片机ASC|通信协议的。3数据处理31数据存储组态王虽然可定义数据文件在硬盘中的保存日期(超过该日期自动从硬盘中删除),但如果要保存的时间较长,保存的数据量将非常庞大,不仅造成硬盘的浪费,而且由于组态王的数据文件结构形式复杂,年终时报表处理也需要花费大量的处理时间。因此,在本系统中使用SQL技术,将数据隔一定的时间(如1小时)保存到ACCESS2000中。具体实现步骤如下:首先,建立一个ACCESS数据库,在此命名为“变量数据”,并且建立相应的数据表“温度数据”,然后在控制面板中的ODBC数据源中添加一个基于驱动程序ACCESS DrIver的数据源,在本系统中取名为“工作站”,并将该数据源连接到刚刚建立的ACCESS数据库“变量数据”。在组态王中用语句SQLConnect(DevicelD,“dsn=工作站;uid=;pwd=”)实现和数据库的连接。接着在组态王中建立对应的记录体,记录体名应和数据表名相同;记录体中的字段名称也需和数据表中的字段名称相同。建好记录体后,可以在组态王命令语言中的“运行时”,使用SQ LInsert(DeviceID,“温度数据”,“温度数据”)语句将组态王的数据保存到ACCESS数据库中,当系统退出运行时语句SQLDISCONNECT(DeviceID)断开和数据库的连接。32数据检索考虑到组态王提供的报表格式有限,不能满足工程的需要,而使用EXCEL可以方便地进行表格式数据综合管理和分析等二次处理的功能,系统添加了ECEL对ACCESS数据库进行查询的功能。EXCEL提供了“宏”的概念来进行功能扩展,宏是存储在VisuaI BasIc模块中的一系列命令和函数,当需要执行该项任务时可随时运行宏。其开发环境称之为VBA(VjsuaIBasic For Appcation),VBA提供了一套基于VB的面向对象的系统开发工具,很多语法继承于VB语言,可以像编写VB程序那样来编写VBA程序,实现特定的功能。支持VBA二次开发的应用程序都内建许多对象,这些对象都具有方法和属性。VBA通过改变这些对象的属性,调用相应的方法访问这些对象,实现编程目的。ExceI中的VBA,主要在VB中增加了关于ExceI工作簿、工作表、区域、数据透视表等对象的属性、事件和方法。要使用VBA进行数据库查询必须先添加“IodbcxIa”加载宏,该宏中封装了对数据库访问、搜索、查询的功能,该宏在0ffice安装盘中可以找到,添加方式为“ECEL一工具一宏一VisualBasic编辑器一工具一引用”。在使用VBA编程时,首先要注意在ECEL中工作簿定义为“Workbk”工作表为“worksheet”区域为“range”单元为“ce”。在编程时对单元格进行操作,必须指明单元格所在的工作表以及所在的区域。以下语句示例将Sheetl上A1单元格的值设置为31,Worksheets(“Sheetl”)Range(“A1”)VaIue=31下面介绍几个重要的数据库检索函数:chan=SQLOpen(“DSN=server,) 建立与数据源的连接,其中server为数据源名。SQLExecQuery(ConnectIon,TeXt)函数在该数据源上执行查询。Connection指定要查询的数据源的唯一连接标识;Text要在数据源上执行的查询内容。Set output=Worksheets(“电流”)Range(“A1”)将查询结果显示在表“电流”的A1单元格中。SQLRelrIeve chan,oulput,True,False,FaIse检索先前执行的查询的结果的全部或一部分。SQLCIose chan断开数据库连接。通过在VBA中编程,实现了在ECEL中对ACCESS数据库的查询,查询的结果可以利用ECEL强大的数据处理、统计分析功能进行数据的二次处理。4结束语系统采用SQL技术将数据定时保存到ACCESS数据库中,解决了历史数据库占用磁盘空间大的问题,而且保存的数据可以使用ECEL进行查询,生成ECEL形式的报表,解决了组态王提供的报表格式不能满足实际标准或实际工程的需要的问题。参考文献1 阳宪惠现场总线技术及其应用【M】北京:清华大学出版社,19992 刘明俊,等计算机控制原理与技术湖南:国防科技大学出版社。199963 邓和平.李中明.廖彦久KINGVIEW控制系统在选煤企业中的应用期刊论文-煤矿机械 2009(11)4 孟秀玉.曹巨江.田海滨组态王SQL数据库技术在滴丸罐装控制系统中的应用期刊论文-机械设计与制造2009(8)5 凌六一.黄友锐.移动变电站远程监控系统的设计与实现期刊论文-煤炭工程2008(8)6 王冰.王世明组态王相关数据库研究期刊论文-计算机工程与设计 2008(4)The monitoring system based on kingview design and data processingLilin Guo Wencheng (tianjin university of technology, tianjin 300160)In a sewage treatment system in the design of monitoring system, the author USES kingview 6.5, single-chip microcomputer, the ACCESS and E * CEL to satisfy the whole monitoring system is designed. PC using Chinas industrial control PC, using kingview software, system monitoring; The underlying dataAcquisition and control by PLC, SCM, smart meters. Because the kingview is weak in the database function, using SQL technology in the design to save the data to the MSACCESS2000, and through the VBA (VlsuaI Basic For App cation) programming E * CEL to ACCESS database queries.1 system overviewThere are many different types of monitoring in the system variables, which are part of the need to control variables (such as pressure, etc.), it can be implemented with PLC control; Only need to collect some variables (such as temperature, current, etc.), the quantity can be by using kingview support of intelligent instrument for acquisition; Part and only need to collect data due to the acquisition instrument cant direct communication with kingview, so by single chip microcomputer AT89C52 to write programs to achieve field data collection, and USES the general microcontroller ASC JI communication protocol implementation microcontroller and kingview data sharing. On the whole system structure adopts multilevel distributed structure, divided into two data collection station and a monitoring terminal; According to the function of this system is divided into equipment field control, field data collection, remote monitoring of three parts. The underlying consists of PLC and single-chip microcomputer, intelligent instrument. Among them, the control of PLC main field control equipment. Field data collection is completed by single chip microcomputer and intelligent instruments. Data acquisition station is used with single at the bottom of the PLC, and intelligent instrument communication, obtain the data production process, according to process flow, history curve, real time curve, alarm screen, generate database, etc. Monitoring terminal and data acquisition station through the Ethernet connection, in order to get production process parameters, alarm logging data and information, etc. Monitoring terminal can choose according to the operator to switch to monitor the operating condition of each data acquisition system. Monitoring terminal computer also completed the function of network server, the Internet transmission production parameters, the implementation network remote monitoring.2 the software designThe monitoring software with kingview 6.5 platform as editor. The whole monitoring system has the following main functions:Overall monitoring: 1) according to the real value of acquisition data, configuration wangused PLC, intelligent instrument and microcontroller and the underlying communication, access to relevant equipment register to obtain the operating condition of the equipment, and through the animation connection, real time curve display, etc.2) history curve: shows system runs when all of the recorded history of the main variables, the historical records before can query time, at any time.3) control function: in the PC side can be used to control the underlying PLC, intelligent instruments and to realize the remote control.4) data storage: at regular intervals to save data to the ACCESS, convenient query, after the saved data can also query through E * CEL, secondary processing.5) alarm function: when accident or fault occurs, the microcomputer through external speakers making voice call the police, and silently on the microcomputer screen; Alarm screen you can set the alarm limit, the upper limit and lower limit and lower limit, when more than the scope of setting there will be alarm, to ensure the safe operation of the system.6) print function: print various reports, history curve, running records, alarm, data, etc. PLC and kingview supports communication between kingview and intelligent instruments do not need to write programs to read equipment internal register values, the relevant driver has integrated the configuration Wang Zhong, only need to be defined in the configuration Wang Zhong corresponding devices, and define the corresponding I/O variables can be read inside the equipment register values. While kingview does not support the instrument by single-chip computer for data collection, conversion, and controlled by single chip microcomputer by general ASCI | share data communication protocols and kingview. When kingview to read MCU data, will send MCU based on the agreement of the read command package, microcontroller response, after the data sent to the king, sends its data format is based on general microcomputer ASC | | communication protocol.3 the data processing3.1 data storageAlthough kingview can be defined in data files on the hard disk, save the date (more than the date automatically deleted from the hard disk), but if you want to save for a long time, save a huge amount of data is, not only wastes the hard disk, and due to the data of kingviewWhen file structure is complex, the year-end report processing also need to spend a lot of processing time. Using SQL technology in this system, therefore, a certain amount of time between data (e.g., 1 hour) to save to the ACCESS2000. Concrete implementation steps are as follows: first, to establish an ACCESS database, here named variable data, and establish the corresponding data table temperature data, then the ODBC data source in the control panel to add a DrIver AC - CESS based DrIver data sources in this system, named station, and connect the data source to just build a ACCESS database variable data. In terms of the configuration Wang Zhong SQLConnect (DevicelD, DSN = workstation; uid = PWD =) of implementation and the database connection. Then the configuration Wang Zhong set up a corresponding records, records of body should be data table name is the same; Records of the field names in body also must be the same and the field names in the data table. Built to record the body, can be in kingview run time in the command language, use SQ LInsert (DeviceID temperature data, temperature data) statement will kingview to save data to the ACCESS database, when the system is run out statements SQLDISCONNECT (DeviceID) disconnect and database connection.3.2 data retrievalConsidering the kingview provide report format is limited, cant meet the needs of engineering, and using EXCEL to tabular data can be easily integrated management and analysis of the function of the secondary processing, such as system added E * CEL to ACCESS database query function. EXCEL provides the concept of macro for function extension, macro is a series of commands stored in the VisuaI BasIc module and function, may at any time when you need to perform the task to run the macro. Its development environment called VBA (VjsuaIBasic For App cation), VBA provides a set of object-oriented system based on VB development tools, a lot of grammar inheritance with VB language, can be like write VB program to write VBA program to achieve a specific function. Support the VBA second development applications are built in many objects, these objects have methods and properties. VBA by changing the properties of the object, call the corresponding method to access these objects, realize the programming purposes. ExceI in VBA, mainly in VB increased about ExceI workbook, work table, area and pivot table object properties, events, and methods. To use VBA to database query must add x both Iodbc. XIa add-ins, encapsulates the database access in the macro, search, query function, the macro can be found in 0 f - fice installation plate, add a way to E * CEL a tool a macro a visual basic editor is a tool for a reference. When using VBA programming, the first thing to note in E * CEL workbook is defined as Workb up k worksheet as worksheet area of the range unit for ce . In programming, to manipulate, the cell must specify the cell in the worksheet and area. The following statements example Sheetl A1 on the cells value is set to 3.1, Worksheets ( Sheetl ). The Range ( A1 ). VaIue = 3.1Here are a few important database retrieval functions:Chan = SQLOpen ( DSN = server,) established with the data source ConnectIon, the server for the data source name. SQLExecQuery (ConnectIon, TeXt) function to execute queries on the data source. The ConnectIon specified the only ConnectIon to query data sources identification; TeXt to execute queries the contents on the data source. Set the output = Worksheets ( current ). The Range ( A1 ) in the query result is shown in table A1 cell of current. SQLRelrIeve chan, oulput, True, False, FaIse retrieval previously executed the whole or any part of the results of the query. SQLCIose chan, disconnect from the data

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论