(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf_第1页
(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf_第2页
(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf_第3页
(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf_第4页
(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf_第5页
已阅读5页,还剩82页未读 继续免费阅读

(控制理论与控制工程专业论文)新型dcs组态软件opc客户端和服务器的研究与开发.pdf.pdf 免费下载

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

文档简介

原创性声明 本人郑重声明:所呈交的学位论文,是本人在导师的指导下,独 立进行研究所取得的成果。除文中已经注明引用的内容外,本论文不 包含任何其他个人或集体已经发表或撰写过的科研成果。对本文的研 究作出重要贡献的个人和集体,均己在文中以明确方式标明。本声明 的法律责任由本人承担。 论文作者签名: 弛咄 e t 期:兰! ! :竺:! z 关于学位论文使用授权的声明 本人完全了解山东大学有关保留、使用学位论文的规定,同意学 校保留或向国家有关部门或机构送交论文的复印件和电子版,允许论 文被查阅和借阅;本人授权山东大学可以将本学位论文的全部或部分 内容编入有关数据库进行检索,可以采用影印、缩印或其他复制手段 保存论文和汇编本学位论文。 ( 保密论文在解密后应遵守此规定) 论文作者签名:至墨! 毡导师签名: l,一 山东大学硕士学位论文 目录 摘要i l 】i i ;7 l ? 】 i a :t i i i 第1 章绪论1 1 1 课题的研究背景和意义1 1 2o p c 技术3 1 2 1o p c 技术产生的背景。3 1 2 2o p c 技术国内外研究现状5 1 3 课题的研究内容和创新点6 1 4 本章小结7 第2 章o p c 规范。8 2 1c o m 技术8 2 1 1c o m 技术简介8 2 1 2c o m 接口9 2 2o p c 数据访问规范l o 2 2 1o p c d a 客户端和服务器1 0 2 2 2o p c d a 服务器对象的组成一1 0 2 2 3o p c 体系结构1 1 2 2 4o p c d a 对象接口一1 2 2 3o p c 历史数据访问规范1 4 2 3 1o p c h d a 客户端和服务器1 4 2 3 2o p c h d a 服务器对象接口1 5 2 3 3o p c h d a 客户端对象接口1 6 2 4 本章小结16 第3 章o p c 客户端的软件设计与实现1 7 3 1o p c 客户端开发的几种方法1 7 3 1 1 使用a c t i v e x 控件开发o p c 客户端1 7 3 1 2 使用o p c 快速开发工具包开发o p c 客户端1 7 3 1 3 使用c o m 技术直接开发o p c 客户端1 7 3 2o p c 系统的功能分析1 8 3 2 1 组态软件的整体结构1 8 3 2 2o p c 系统的功能分析1 8 3 3o p c 客户端的设计2 0 3 3 1 客户端的接口设计2 0 3 3 2 客户端程序的流程2 1 3 4o p c 客户端具体实现2 2 3 4 1o p c 客户端界面实现2 2 3 4 2o p c 客户端接口实现2 2 3 4 3o p c 客户端与服务器的连接2 4 3 5 本章小结2 7 山东大学硕士学位论文 l 1 毫曼詈量暑皇皇詈詈暑曼曼詈詈葛曼! 皇詈詈! 皇皇詈詈! 墨皇詈! ! ! ! 苎! ! 曼曼兰皇皇! 曼詈皇詈量詈量皇鼍詈! 曼! ! ! ! 曼! ! ! 苎! ! ! 皇詈 第4 章o p c d a 服务器的软件设计与实现2 8 4 1o p c 服务器开发的几种方法2 8 4 1 1 使用m f c 提供的c o m 支持开发o p c 服务器2 8 4 1 2 通过a t l 开发o p c 服务器2 9 4 2o p c d a 服务器的设计3 0 4 2 1o p c d a 服务器的整体设计。3 0 4 2 2o p c d a 服务器的功能设计31 4 3 实时数据的读取。3 2 4 3 1 实时数据的采集3 2 4 - 3 2 实时数据的量程变换3 2 4 4o p c d a 服务器的软件实现3 3 4 4 1o p c d a 服务器的工作流程3 3 4 4 2o p c d a 服务器的接口设计3 3 4 4 3 数据存储区的设计3 6 4 4 4 服务器对象的注册3 8 4 5 本章小结3 9 第5 章o p c h d a 服务器的设计与实现4 0 5 1o p c h d a 服务器的整体设计。4 0 5 2 历史数据获取。4 0 5 2 - 1 数据库访问方式4 l 5 2 2 历史数据的读取4 2 5 3o p c h d a 服务器的接口。4 4 5 4 多线程技术4 4 5 5 本章小结。4 5 第6 章o p c 驱动程序软件设计与实现4 6 6 1m o d b u s 通信协议4 6 6 1 1m o d b u s 简介4 6 6 1 2m o d b u st c p 协议4 6 6 2o p c 驱动程序的设计4 8 6 2 1 驱动程序的整体结构4 8 6 2 2 驱动程序相关类的设计4 8 6 3o p c 驱动程序的软件实现4 9 6 3 1 消息接口类4 9 6 3 2 套接字5 l 6 3 3 标签定义5 1 6 4 驱动程序的测试。5 4 6 5 驱动程序的可扩展性实现。5 4 6 5 1 动态链接库技术5 5 6 5 2 二次开发5 5 6 6 本章小结5 6 第7 章o p c 客户端和服务器在i ) c s 系统中的应用5 7 7 1 应用方案设计。5 7 山东大学硕士学位论文 _ii i 7 2d c o m 配置5 8 7 2 1d c o m 概述5 8 7 2 2 服务器和客户端的配置5 9 7 3 客户端实现远程访问6 0 7 3 1 水位监控系统6 0 7 3 2 客户端远程访问6 l 7 4 本章小结6 2 第8 章结论与展望6 3 参考文献。6 5 j $ c 谢6 9 攻读硕士学位期间的研究成果。7 0 山东大学硕士学位论文 c o n t e n t s c h i n e s ea b s t r a c t 。i a 】 1 s 】r 1 认:t i i i c h a p t e r1i n t r o d u c t i o n 1 1 1b a c k g r o u n da n ds i g n i f i c a n c eo f t h er e s e a r c h 1 1 2o p c t e c h n o l o g y 3 1 2 1b a c k g r o u n do fo p ct e c h n o l o g y 3 1 2 2r e s e a r c hs t a t u so fo p ca th o m ea n da b r o a d 5 1 3k e yp o i n t sa n dm a i ni n n o v a t i o no f t h ew b r k 6 1 4s u m m a r y 7 c h a p t e r2o p c s t a n d a r d 8 2 1c o m 1 e c h n o l o g y 8 2 1 1i n t r d u c t i o no fc o m 8 2 1 2c o mi n t e r f a c e 9 2 2o p cd a t aa c c e s ss t a n d a r d 1 0 2 2 10 p c d ac l i e n ta n ds e r v e r 。1 0 2 2 2c o m p o n e n t so f o p c d as e r v e ro b j e c t 1 0 2 2 30 p ca r c h i t e c t u r e 1 l 2 2 4o p c d as e r v e ri n t e r f a c e s 1 2 2 3o p c h i s t o r yd a t aa e c e s s l “j 1 4 2 4 1o p c h d ac l i e n ta n ds e r v e r 1 4 2 4 2o p c h d as e r v e ri n t e r f a c e s 1 5 2 4 3o p c h d ac l i e n ti n t e r f a c e s 1 6 2 4s u m m a r y 1 6 c h a p t e r3d e s i g na n di m p l e m e n t a t i o no fo p c c l i e n t 1 7 :;1m e t h o do f d e v e l o p i n go p cc l i e n t 1 7 3 1 1d e v e l o po p cc l i e n tw i t ha c t i v e x 17 3 1 2d e v e l o po p cc l i e n t 、析t ho p ct o o l k i t 1 7 3 1 3d e v e l o po p cc l i e n t 谢t hc o m 1 7 3 2o p cf u c t i o n a n a l y s i si nd c s 1 8 3 2 1a r c h i t e c t u r eo f t h ec o n f i g u r a t i o ns o f t w a r e 1 8 3 2 2o p cf u n c t i o na n a l y s i s 1 8 :;3d e s i g no f o p cc l i e n t 2 0 3 3 1i n t e r f a c ed e s i g no fo p cc l i e n t 2 0 :;:;2f l o w c h a r td e s i g no f o p cc l i e n t 2 1 3 4i m p l e m e n to fo p cc l i e n t 2 2 3 4 1u s e ri n t e r f a c ei m p l e m e n to f o p cc l i e n t 2 2 3 4 2i n t e r f a c ei m p l e m e n t a t i o no f o p cc l i e n t 2 3 3 4 3c o n n e c t i o no f 0 p cc l i e n ta n ds e r c v e r 2 5 3 5s u m m a r y 2 7 v 山东大学硕士学位论文 c h a p t e r 4d e s i g na n di m p l e m e n t a t i o no fo p c d as e r v e r 2 8 4 1m e t h o do f d e v e l o p i n go p c d as e r v e r 2 8 4 1 1d e v e l o po p cs e r v e r 嘶mc o mp r o v i d e db ym f c 2 8 4 1 2d e v e l o po p cs e r v e rw i t ha t l 2 9 4 2d e s i g no fo p c d as e r v e r 3 0 4 2 1g e n e r a ld e s i g no fo p c d as e r v e r 3 0 4 2 2f u n c t i o nd e s i g no f o p c d as e r v e r 3 1 4 3a c q u i s i t i o no fr e a l t i m ed a t a 3 2 4 3 1a c q u i s i t i o no f r e a l t i m ed a t a 3 2 4 3 2m e a s u r i n gr a n g ec o n v e r s i o no f r e a l t i m ed a t a 3 2 4 4s o f t w a r ed e s i g no fo p c d as e r v e r 3 3 4 4 1f l o w c h a r to fo p c d as e r v e r 3 3 4 4 2i n t e r f a c ed e s i g no f o p c d as e r v e r 3 3 4 4 3d a t am e m o r yd e s i g n 3 6 4 4 4s e r v e rr e g i s t r a t i o n 3 8 4 5s u m m a r y 3 9 c h a p t e r5d e s i g na n di m p l e m e n t a t i o no fo p c h d a s e r v e r 4 0 5 1g e n e r a ld e s i g no f o p c h d as e r v e r 4 0 5 2a c q u i s i t i o no fh i s t o r yd a t a 4 0 5 2 1d a t a b a s ea c c e s sm e t h o d 4 1 5 2 2a c q u i s i t i o no fh i s t o r yd a t a 4 2 5 3o p c h d as e r v e ri n t e r f a c e 4 4 5 4m u l t i t h r e a dt e c h n o l o g y 4 4 5 5s u m m a r y 4 5 c h a p t e r 6s o f t w a r ed e s i g na n di m p l e m e n t a t i o no fo p cd r i v ep r o g r a m 一4 6 6 1m o d b u sp r o t o c o l 4 6 6 1 1m o d b u si n t r o d u c t i o n 4 6 6 1 2m o d b u st c pp r o t o c o l 4 6 6 2d e s i g no f o p cd r i v ep r o g r a m 4 8 6 2 1g e n e r a ls t r u c t u r eo f0 p cd r i v e 4 8 6 2 2c l a s sd e s i g no fo p cd r i v e 4 8 6 3s o f e w a r ed e s i g no fo p cd r i v ep r o g r a m 4 9 6 3 1m e s s a g ei n t e f a c ec l a s s 4 9 6 3 2s o c k e t 5l 6 3 31 a gd e f i n i t i o n 51 6 4t e s t i n go fd r i v ep r o g r a m :5 4 6 5i m p l i m e n t a t i o no fd r i v ep r o g r a me x p a n s i b i l i t y 5 4 6 5 1t e c h n o l o g yo fd y n a m i cl i n kl i b r a r y 5 5 6 5 2s e c o n d a r yd e v e l o p m e n t 5 5 6 6s u m m a r y 5 6 c h a p t e r7a p p l i c a t i o no fo p c c l i e n ta n ds e r v e ri nd c s 5 7 7 1a p p l i c a t i o nd e s i g n 5 7 山东大学硕士学位论文 7 2d c o mc o n f i g u r a t i o n 5 8 7 2 1d c o mi n t r o d u c t i o n 5 8 7 2 2c o n f i g u r a t i o no f0 p cs e r v e ra n dc l i e n t 5 9 7 3i m p l e m e n t a t i o no fr e m o t ea c c e s s 6 0 7 3 1w a t e rl e v e lm o n i t o r i n gs y s t e m 。6 0 7 3 2c l i e n tr e m o t ea c c e s s 6 1 7 4s u m m a r y 6 2 c h a p t e r8c o n c l u s i o n sa n dr e c o m m e n d a t i o n s 6 3 r e f e r e n c e s 6 5 a c k n o w l e d g m e n t s 6 9 r e s e a r c h 7 0 山东大学硕士学位论文 摘要 集散控制系统( d c s ) 主要用于实现对生产过程的计算机控制和管理,它在 工业过程控制的各个领域中得到广泛应用。传统d c s 系统中,由于上层组态软 件与现场智能设备之间没有统一的接口标准,现场智能设备之间以及智能设备 与上位监控软件之间的信息共享是通过驱动程序来实现的。针对每一个硬件设 备,每个应用软件都要根据自己的需求开发一套相应的硬件驱动程序,这导致 了驱动程序重复开发,设备不可互换,改造升级困难,访问冲突等一系列问 题。 o p c 技术的提出彻底改变了使用驱动程序实现数据共享的开发模式。上层 应用软件作为o p c 的客户端,可以不包含任何硬件通讯接口程序,不关心底层 硬件的类型。只要遵循o p c 数据接口协议,就能够从不同的硬件厂商提供的 o p c 数据服务器中读取数据,从而实现了组态软件对各种硬件设备数据的灵活 配置和多种系统的真正集成。本文针对新型d c s 组态软件的具体需求,对o p c 技术进行了深入研究。 本课题的来源是山东省科技厅的重大科研攻关项目,项目名称是基于工业 以太网与现场总线技术的新型控制系统,项目编号为3 1 4 0 0 0 0 4 0 1 0 4 3 7 。根据组 态软件开发的实际需求,在w i n d o w s2 0 0 0 平台下,采用m i c r o s o f tv i s u a lc + + 6 0 作为开发环境,完成了针对此新型d c s 组态软件的o p c 客户端和服务器的 软件设计与开发。 本文首先介绍了课题的研究背景和意义,o p c 技术的产生、发展及其研究现 状。接着,简要叙述了o p c 技术的本质一o m 技术,o p c 数据访问规范和 o p c 历史数据访问规范。然后,在研究国内外先进组态软件的基础上,依据 o p c d a 规范,提出了o p c 客户端和服务器的整体架构。分析了o p c 的体系结 构和通讯方式,设计了o p c 客户端,使其能够读取本地或者远程的o p c 服务 器;同时,分析了新型d c s 系统的实时数据库,历史数据库,并设计了具体的 软件解决方案,采用a t l 和m f c 进行软件编程,开发了o p c d a 和o p c h d a 服务器。在o p c h d a 服务器的设计中,需要对大量历史数据进行读取,速度 慢,效率低。本设计采用了多线程技术,提高了数据读取的效率。而且,本文 山东大学硕士学位论文 还初步探索了o p c 驱动程序的软件设计与实现方法,设计开发了基于t c p i p 协 议的驱动程序,并通过m o d b u s 从站软件进行了验证。最后,对客户端和服务器 分别进行d c o m 配置,结合d c s 具体运行系统,实现了实时数据的远程读取和 实时监控。通过对o p c 服务器和客户端进行测试,证实了本论文提出的新型 d c s 组态软件o p c 客户端和服务器设计方案和实现方法的正确性和可行性,具 有很好的实际应用价值。 关键字:o p c ;服务器;客户端;驱动程序;d c s ;组态软件 i i 山东大学硕士学位论文 a b s t r a c t d i s t r i b u t e dc o n t r o l s y s t e m ( d c s ) ,m a i n l y f o r c o m p u t e r c o n t r o la n d m a n a g e m e n ti nt h ep r o c e s so fp r o d u c t i o n ,i sw i d e l yu s e di nv a r i o u sf i e l d so f i n d u s t r i a l p r o c e s sc o n t r 0 1 d r i v ep r o g r a mi sa p p l i e dt os h a r i n gi n f o r m a t i o nn o to n l yb e t w e e n s m a r td e v i c e s ,b u ta l s os m a r td e v i c ea n du p p e rm o n i t o r i n gs o f t w a r eb e c a u s et h e r ei s n ou n i f o r mi n t e r f a c es t a n d a r db e t w e e nt h eu p p e rc o n f i g u r a t i o ns o f t w a r ea n do n s i t e i n t e l l i g e n td e v i c e si nt r a d i t i o n a ld c ss y s t e m s d r i v ep r o g r a mo fe a c hd e v i c er e q u i r e s d e v e l o p i n ga c c o r d i n gt ot h en e e d so fa p p l i c a t i o ns o f t w a r e a sar e s u l t ,p r o b l e m so c c u r , s u c ha sd r i v ep r o g r a mr e d u n d a n t l yd e v e l o p e d ,e q u i p m e n ti m p o s s i b l yi n t e r c h a n g e a b l e , r e f o r ma n du p g r a d ed i f f i c u l t y , a c c e s sv i o l a t i o na n ds oo n c h a n g e si nd e v e l o p m e n tm o d eh a v et a k e np l a c ea so p ci su s e d t h eu p p e r a p p l i c a t i o ns o f t w a r ea so p cc l i e n tc o u l dr e a d d a t af r o mo p cs e r v e rw h i c hi s p r o v i d e db yd i f f e r e n td e v i c ec o m p a n i e si nt h ec o n d i t i o no ff o l l o w i n gt h eo p cd a t a i n t e r f a c ep r o t o c 0 1 a tt h em e a n w h i l e ,o p cc l i e n td o e sn o tn e e dt oc o n t a i na n y h a r d w a r ec o m m u n i c a t i o np r o g r a mo rc a r ew h a tt h eu n d e r l y i n gh a r d w a r ei s f l e x i b l e c o n f i g u r a t i o no fd a t aa n di n t e g r a t i o no fm u l t i p l es y s t e m sa r ei m p l e m e n t e d i nt h i s p a p e r , t h eo p ct e c h n o l o g yi ss t u d i e di nd e p t hb a s e do nt h es p e c i f i cn e e d so ft h en e w d c sc o n f i g u r a t i o ns o f t w a r e t h et o p i ci st h em a j o rs c i e n t i f i cr e s e a r c hp r o j e c to fs c i e n c ea n dt e c h n o l o g y o f f i c ei ns h a n d o n gp r o v i n c e ,w h o s en a m ei sn e wc o n t r o ls y s t e mb a s e do ni n d u s t r i a l e t h e m e ta n df i e l d b u sa n di t e mn u m b e ri s314 0 0 0 0 4 010 4 3 7 c o n s i d e r i n g t h e i d i o g r a p h i cr e q u i r e m e n to fd e v e l o p m e n t ,t h es o f t w a r ed e s i g no fo p cc l i e n ta n ds e r v e r b a s e do nt h en e wd c sc o m et r u eo nt h ep l a t f o r mo fw i n d o w s2 0 0 0 ,c h o o s i n g m i c r o s o f tv i s u a lc + + 6 0a sp r o g r a md e v e l o p m e n tt 0 0 1 i nt h i st h e s i s ,r e s e a r c hb a c k g r o u n d ,s i g n i f i c a n c eo ft h es u b j e c ta n dt h eg e n e r a t i o n , d e v e l o p m e n ta n dc u r r e n tr e s e a r c hs t a t u so fo p ct e c h n o l o g ya th o m ea n da b r o a di s i n t r o d u c e da tf i r s t t h e n ,c o m ,w h i c hi ss h o r tf o rc o m p o n e n to b j e c tm o d e la n dt h e k e yo fo p ct e c h n o l o g y , i ss t u d i e d ,嬲w e l la so p cd a t aa c c e s sa n do p ch i s t o r y i i i 山东大学硕士学位论文 d a t aa c c e s s b e s i d e s ,a c c o r d i n gt oo p c d a s t a n d a r d ,t h eo v e r a l lf r a m e w o r ko fo p c c l i e n ta n ds e r v e ri s g i v e n ,w h i c hi s b a s e do nr e s e a c ho fa d v a n c e dc o n f i g u r a t i o n s o f t w a r e w h a ti sm o r e ,a r c h i t e c t u r ea n dc o m m u n i c a t i o ni sa n a l y z e da n do p cc l i e n t i sd e s i g n e dt or e a dd a t af r o mo p cs e r v e rl o c a lo rr e m o t e i na d d i t i o n ,a n a l y s i so f r e a l t i m ed a t a b a s ea n dh i s t o r i c a ld a t a b a s eo ft h en e wd c ss y s t e ma n dd e s i g no f s p e c i f i cs o f t w a r es o l u t i o n s ,o p cd a t aa c c e s ss e r v e ra n do p ch i s t o r yd a t aa c c e s s s e r v e rw i t l la t la n dm f ca r eg i v e n al a r g en u m b e ro fh i s t o r i c a ld a t at ob er e a d w h i c hm a k et h eo p c h i s t o r yd a t aa c c e s ss e r v c rs l o wa n di n e f f i c i e n t ,m u l t i t h r e a d i n gi s u s e dt oi m p r o v et h ee f f i c i e n c yo fd a t aa c q u i s i t i o n m o r e o v e r , o p cd r i v e rs o f t w a r e d e s i g na n di m p l e m e n t a t i o na n dd r i v e rp r o g r a mb a s e do nt c p i pp r o t o c o li sp r e s e n t e d , w h i c hh a sb e e nv e r i f i e dt h r o u g ht h em o d b u ss l a v es o f t w a r e a tl a s t ,t h en e wd c s c o n f i g u r a t i o ns o f t w a r er e a l i z e sd a t ar e m o t ea c c e s sa n dr e a l t i m em o n i t o rw i t hd c o m c o n f i g u r a t i o no ft h eo p cc l i e n ta n ds e r v e r t h et e s tr e s u l tp r o v e st h a tt h ed e s i g na n d i m p l e m e n t a t i o no ft h eo p cc l i e n ta n do p c s e r v e rb a s e do nt h en e wd c si n t r o d u c e d i nt h i sp a p e ri sv a l i da n df e a s i b l e t h i ss o f t w a r eh a sg o o da p p l i c a t i o nv a l u ea sw e l l k e yw o r d s :o p c ;s e r v e r ;c l i e n t ;d e v i c ed r i v e r ;d c s ;c o n f i g u r a t i o ns o f t w a r e 山东大学硕士学位论文 第1 章绪论 1 1 课题的研究背景和意义 集散控制系统( d i s t r i b u t e dc o n t r o ls y s t e m ,d c s ) ,又称分布式控制系统, 它是以微处理器为核心,并综合了计算机、通讯、显示和控制技术

温馨提示

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

评论

0/150

提交评论