APP下载

Excel VBA技术在船舶交流电力短路计算中的应用

2016-01-13陶冶,杨文莲,吴俊峰

大连海洋大学学报 2015年1期

Excel VBA技术在船舶交流电力短路计算中的应用

陶冶1,杨文莲1,吴俊峰1,杨松1,包琳2,王化群1,

(1.大连海洋大学 信息工程学院,辽宁 大连 116023; 2.大连海洋大学 教学质量监控与保障处,辽宁 大连 116023)

摘要:针对船舶交流电力短路计算中电机、配电板类型多,短路点计算公式复杂、数据量大,打印输出要求高的问题,提出利用Excel VBA技术编写短路计算模块加以解决,主要包括等效设备参数、阻抗、短路电流和功率因数的计算等。结果表明:用本方法可将计算程序与显示输出进行分离,使用Excel的Range对象访问工作表单元格;数据计算由VBA程序单独进行处理,可自动生成短路计算各类表格,允许用户对输出结果进行后期交互式处理,并满足国家船舶交流电力短路计算标准规范要求。实例验证表明,该方法可有效地提高船舶配电电器短路计算的效率。

关键词:船舶交流电力;短路计算;Excel VBA;Range对象

DOI:10.3969/J.ISSN.2095-1388.2015.01.020

文章编号:2095-1388(2015)01-0107-06

中图分类号:U662.6;TP273

文献标志码:A

收稿日期:2014-05-06

基金项目:国家自然科学基金资助项目(61272522);大连海洋大学博士启动基金资助项目(HDBS201402);辽宁省优秀青年骨干教师资助计划项目(2006)

作者简介:陶冶(1974—), 男, 博士, 副教授。E-mail:taoye@dlou.edu.cn

Abstract:A module using Excel VBA technology for short circuit calculation is established to deal with problems including many types of motor and distribution board, the complexity of short-circuit point formula calculation, large amount of data, and the print output problem. The module is mainly composed of equivalent equipment parameter calculation, impedance calculation, short circuit current and power factor, etc. This method separates the calculation program from the output data display,and uses Excel Range Object to refer specifically to worksheet-cells. VBA program independently processes the data computing, and various kinds of worksheets for short circuit calculation are generated automatically, which allows the user to deal with the output results interactively. It also meets the electric short circuit calculation standard specification requirements of the ship. An example showed that the proposed method effectively improved the efficiency of electrical short circuit calculation for ship power distribution.

Visual Basic for Applications(VBA)是一种使用Visual Basic的宏语言,主要用于扩展Windows的应用程序功能。近年来,随着微软Office办公软件的广泛应用,利用VBA宏语言来实现Excel自动化技术已得到了人们的重视[1-2]。考虑到国内Excel系统应用具有极其庞大的客户群,而大部分用户均为业余程序员,他们仅需要解决面临的专业问题,而不一定去开发单纯的应用软件,因此,选择VBA非常适合,因它兼具了易用性和高效性。……

登录APP查看全文