文档介绍:基于VB的分布式监控系统Modbus通信设计与实现
2008-11-17 8:45:00 史非,陈星供稿
摘  要:在工业自动化监控系统中,为了通过上位机与智能仪表的通信达到实时控制管理的目的,在详细分析了Modbus RTU规约及其通信原理的基础上,结合一个应用实例,给出了VB ,建立了低成本的分布式监控系统。该系统简单、实用,具有良好的兼容性和可移植性,对类似的由其它类型智能仪表与上位机组成的控制系统的通信实现具有一定的参考价值,并在石化企业中得到了成功应用,有效地提高了智能化控制水平和企业的生产效率。
关键字:智能仪表;Modbus协议;VB ;分布式监控系统;串口通信
Design and realization of munication in the Distributed 
Monitoring System Based on VB
SHI Fei, CHEN Xing
Abstract: In the field of industry automation control system, in order to realize real-time control and management munication puter and intelligent instrument, on the basis of the analysis of Modbus-RTU protocol and munication principle, this paper gives a method which uses ponent m and Timer provided by VB. This method establishes a low cost distributed monitoring system by integrating an application. This system is easy to use and good patibility and portability, also have some value on munication realization in the systems which are control by intelligent instrument and puter. Moreover, it has been used in petrochemical enterprise essfully and improved the level of intelligent control and the production efficiency of the enterprise effectively.
Key Words: intelligent instrument; Modbus protocol; VB ; distributed monitoring system; munication
1 引言
分布式监控系统(DMS)已在工业领域得到广泛应用,许多企业对于中小规模的设备,出于硬件软件投资利润率和性能价格比的考虑,常常是自行开发或参与开发本企业的监控系统。分布式监控系统以微机为基础,用数据通信将微机连在一起实现数据共享,从而对工业过程进行集中监视管理和分散控制[1]。
本文的实例为低压配电监控系统,随着自动化大规模生产时代的到来,生产现场往往同时运转着上十台甚至数十台电动机,往往需要对这些电动机的运行参数进行集中监控,以便操作人员及时发现故障并进行处理。现采用计算机+智能仪表的方案,由上位机定时对下位机采用轮巡的方式进行数据采集。上位机和下位机之间采用RS485总线进行通信,现场智能Modbus仪表挂在RS485总线上,上位机通过RS232/485转换器与RS485总线相连,采用VB编程语言,通过Modbus协议用串口与智能仪表进行通信,在控制成本的情况下,组成一个小型分布式监控系统。
2 监控系统概述
系统采用主从式点对点的通讯方式,由现场智能仪表和1台PC机组成,其中现场智能仪表采用天津东泰科技发展有限公司生产的DYZB-101A型低压智能综合保护器。由于本系统的智能电子设备通讯是通过RS485总线的,因此采用特征阻抗为120Ω的屏蔽双绞线连接。PC机一般没有RS485接口,但都有RS232串行接口,因此采用一个RS232/485转换器,可将RS232串行接口直接转换成RS485接口,再通过RS485总线与智能仪表相连。在串行通讯中,m、Timer控件来设计。其中智能仪表对所检测的电力系统进行在线检测,检测电网的