节点文献

新型DCS组态软件脚本系统的研究与开发

【作者】 岳萍

【导师】 李正军;

【作者基本信息】 山东大学 , 控制理论与控制工程, 2008, 硕士

【摘要】 组态软件是用于工业自动化和过程监控的应用软件,它为自动化项目提供人机接口,实现现场总线控制系统与管理网络的互连。它的出现,为自动化工程技术人员提供了一种采用搭积木的方式制作现场控制过程和控制界面的工具。它能根据用户对被控对象和控制目的的要求在模块间进行任意组合,不仅满足了被控对象的个性需求,也缩短了软件开发时间,节省了开发费用。然而,随着工业自动化水平的不断提高,人们对组态软件的开放性、可维护性和可重用性提出了更高的要求。为组态软件提供二次开发功能成为满足上述要求的一个重要途径,许多成功的组态系统都采用脚本技术来支持现有系统的二次开发。采用这种模式进行开发的组态系统一般情况下都将自身的一些重要、安全的功能留给脚本,让脚本解释装置来控制并使用,实现组态软件自身功能的重利用。从目前情况看,国内工业监控组态软件仍停留在以C或Basic语言作为脚本的水平上,而国外虽然有采用面向对象的脚本语言,但平台间的可移植性并不完善。本文根据工业监控组态软件的常见结构,在研究了组态软件脚本功能现状和发展趋势的基础上,采用面向对象的JavaScript作为脚本语言并创造性地采用目前在浏览器Mozilla FireFox上用的底层引擎——基于C语言的跨平台开源内核SpiderMonkey作为脚本引擎,研究开发了新型组态软件的脚本模块,更灵活、更安全地解决了组态软件的二次开发问题。本课题来源是山东省科技厅重大科研攻关项目:基于工业以太网与现场总线技术的新型控制系统,项目编号为31400004010437。课题从设计需求到开发完成并通过测试,历经一年多时间。本文详细阐述了基于JavaScript语言、SpiderMonkey引擎的新型组态软件脚本模块的设计,分为脚本配置模块和脚本引擎模块,均采用动态链接库形式实现,并提供了诸多接口与组态软件的其它模块衔接,完成整体系统的实时通讯。根据软件开发模型,每个模块都进行了详细的需求分析、风险分析、设计实现和软件测试。其中脚本配置模块是为方便脚本编写而实现的配置界面,根据脚本动作的驱动事件不同,分为六种动作脚本加以实现。脚本引擎模块的作用是一个JavaScript脚本解释器,在实现了能够解释JavaScript内建对象、函数等的基础上,还实现了对自定义对象和函数的支持与解释。除了能够解释正常脚本之外,引擎模块还实现了脚本预编译排错功能,保证了脚本组态的安全。在系统的各个模块中,脚本与数据库模块之间的数据交换采用COM技术实现,与图形界面运行环境之间实现多线程调用。通过研究设计,最终实现了组态软件运行平台可以执行用户根据自身需要所开发的脚本代码的功能。本文最后根据《软件测试规范》对设计完成的脚本模块进行了周密的测试,包括单元测试和功能测试,并对整个组态软件系统进行了系统测试,使功能得到了完善,性能得到了优化。

【Abstract】 Configuration software is one kind of application software used in industrial automation, process monitoring and control applications, which provides man-machine interface for the automation project and achieves interconnection between Fieldbus control system and management network. Its appearance provides a means for automation engineering personnel to implement field control process and interface by using a modular method. Arbitrary combination of the modules can be used according to the requirements of the control target and control purpose from customer, which can not only meet different needs of the control target, but also shorten the software development time, and save development costs.However, as industrial automation evolves, people are raising higher expectations of the open features, maintainability and reusability of the configuration software. Providing reusability for configuration software is an important way to address the problems mentioned above. Many successful configuration software supports reusability of existing systems by script technology. The important and security-related functionalities are implemented by script in the configuration software developed by this mode. The script interprets and controls the instrument and implements the reusability of the functionalities of the configuration software.Judging from the current situation, some domestic industrial monitoring and control configuration software still uses C or Basic language as script. Although object-oriented script language is available in foreign countries, the portability between different platforms still needs to be improved. Based on the common structure of the industrial monitoring, control configuration software, the study of script function and development trend of configuration software, this paper develops the script module of new generation configuration software and flexibly addresses the reusability of configuration software by using object-oriented JavaScript as script language and using C language based, cross-platform and open source SpiderMonkey which is the bottom of the engine used in the browser Mozilla FireFox currently as script engine.The topic is the major scientific research projects of Science and Technology Office in Shandong Province: New Control System based on Industrial Ethernet and Fieldbus. Item number is: 31400004010437.It took more than a year to design requirements, development and testing.This paper thoroughly describes script module design of new generation configuration software based on JavaScript language and SpiderMonkey engine, which is divided into script configuration module and script engine module. They are both implemented by dynamic link library, provide many interfaces to interface with other modules of the configuration software and achieve real time communication of the whole system. Each module has a detailed requirement analysis, design, implementation and testing. The script configuration module is designed to make the configuration easy, which is divided into six kinds of actions to implement according to the different driver incident of each action. The script engine module acts as a JavaScript interpreter, which can interprete not only the basis of JavaScript but also the self-defined functions.In order to guarantee the safety of script, the script engine module provides a function of precompiler. Of all the modules within the system, the script uses COM technology to implement the data exchange with library module and multithreading is also implemented between different running modules. Through research and design of the author, the functionality that the configuration software platform running the customized script from customer is eventually realized.Finally, in according with the software testing norms, this paper also conducts thorough tests, which includes unit test, functional test and performance test to improve the functionality and optimize the performance of the script modules.

【关键词】 组态软件脚本JavaScriptSpiderMonkeyCOM
【Key words】 Configuration SoftwareScriptJavaScriptSpiderMonkeyCOM
  • 【网络出版投稿人】 山东大学
  • 【网络出版年期】2009年 01期
节点文献中: 

本文链接的文献网络图示:

本文的引文网络