【正文】
中 國(guó) 礦 業(yè) 大 學(xué) 本 科 生 畢 業(yè) 設(shè) 計(jì) 姓 名: 學(xué) 號(hào) : 學(xué) 院: 應(yīng)用技術(shù)學(xué)院 專(zhuān) 業(yè): 電氣工程及其自動(dòng)化 論文題目: 基于 Visual Basic 的 OPC 客戶(hù)端程序設(shè)計(jì) 指導(dǎo)教師: 職 稱(chēng): 講師 2021 年 6 月 徐州 中國(guó)礦業(yè)大 學(xué)畢業(yè)設(shè)計(jì)任務(wù)書(shū) 學(xué)院 應(yīng)用技術(shù)學(xué)院 專(zhuān)業(yè)年級(jí) 電 4 學(xué)生姓名 任 務(wù) 下 達(dá) 日 期 : 2021 年 3 月 8 日 畢業(yè)設(shè)計(jì)日期: 2021年 3 月 8 日 至 2021 年 6 月 15 日 畢業(yè)設(shè)計(jì)題目: 基于 VB 的 OPC客戶(hù)端程序設(shè)計(jì)與開(kāi)發(fā) 畢業(yè)設(shè)計(jì)主要內(nèi)容和要求: 學(xué)習(xí)有關(guān) OPC 技術(shù)的相關(guān)知識(shí); 熟悉 高級(jí)編程語(yǔ)言; 熟悉 Microsoft 的 COM/DCOM 相關(guān)技術(shù); 設(shè)計(jì)出實(shí)現(xiàn) OPC 通信的客戶(hù)端軟件,并能夠完成 OPC 客戶(hù)端程序的通 信 功能 。 院長(zhǎng)簽字: 指導(dǎo)教師簽字 : 中國(guó)礦業(yè)大學(xué)畢業(yè)設(shè)計(jì)指導(dǎo)教師評(píng)閱書(shū) 指導(dǎo)教師評(píng)語(yǔ) (①基礎(chǔ)理論及基本技能的掌握; ② 獨(dú)立解決實(shí)際問(wèn)題的能力;③ 研究?jī)?nèi)容的 理論依據(jù)和技術(shù)方法;④取得的主要成果及創(chuàng)新點(diǎn);⑤ 工作態(tài)度 及工作量;⑥總體評(píng)價(jià)及建議成績(jī);⑦存在問(wèn)題; ⑧ 是否同意答辯等): 成 績(jī): 指導(dǎo)教師簽字: 年 月 日 中國(guó)礦業(yè)大學(xué)畢業(yè)設(shè)計(jì)評(píng)閱教師評(píng)閱書(shū) 評(píng)閱教師評(píng)語(yǔ) ( ①選題的意義; ② 基礎(chǔ)理論及基本技能的掌握;③綜合運(yùn)用所學(xué)知識(shí)解決實(shí)際問(wèn)題的能力;③工作量的大?。虎苋〉玫闹饕晒皠?chuàng)新點(diǎn);⑤寫(xiě)作的規(guī)范程度;⑥總體評(píng)價(jià)及建議成績(jī);⑦存在問(wèn)題; ⑧ 是否同意答辯等 ): 成 績(jī): 評(píng)閱教師簽字: 年 月 日 中國(guó)礦業(yè)大 學(xué)畢業(yè)設(shè)計(jì)評(píng)閱教師評(píng)閱書(shū) 評(píng)閱教師評(píng)語(yǔ) ( ①選題的意義; ② 基礎(chǔ)理論及基本技能的掌握;③綜合運(yùn)用所學(xué)知識(shí)解決實(shí)際問(wèn)題的能力;③工作量的大??;④取得的主要成果及創(chuàng)新點(diǎn);⑤寫(xiě)作的規(guī)范程度;⑥總體評(píng)價(jià)及建議成績(jī);⑦存在問(wèn)題; ⑧ 是否同意答辯等 ): 成 績(jī): 評(píng)閱教師簽字: 年 月 日 中國(guó)礦業(yè)大學(xué)畢業(yè)設(shè)計(jì)答辯及綜合成績(jī) 答 辯 情 況 提 出 問(wèn) 題 回 答 問(wèn) 題 正 確 基本 正確 有一般性錯(cuò)誤 有原則性錯(cuò)誤 沒(méi)有 回答 答辯委員會(huì)評(píng)語(yǔ)及建議成績(jī): 答辯委員會(huì)主任簽字: 年 月 日 學(xué)院領(lǐng)導(dǎo)小組綜合評(píng)定成績(jī): 學(xué)院領(lǐng)導(dǎo)小組負(fù)責(zé)人: 年 月 日 摘 要 OPC 是基于 COM/DCOM 技術(shù)的一個(gè)開(kāi)放的工控行業(yè)的軟件接口標(biāo)準(zhǔn),廣泛應(yīng)用于過(guò)程控制領(lǐng)域的數(shù)據(jù)交換技術(shù),是實(shí)現(xiàn)控制系統(tǒng)現(xiàn)場(chǎng)設(shè)備級(jí)與過(guò)程管理級(jí)信息交互、實(shí)現(xiàn)控制系統(tǒng)開(kāi)放性的中間件技術(shù)。 論文簡(jiǎn)單分析了 OPC(OLE for process control) 通信技術(shù)規(guī)范,并基于 OPC 數(shù)據(jù)訪問(wèn)規(guī)范,采用 OPC 客戶(hù)端 /服務(wù)器數(shù)據(jù)訪問(wèn)的層次模型結(jié)構(gòu),使用 高級(jí)編程語(yǔ)言設(shè)計(jì)開(kāi)發(fā)了 Windows 平臺(tái)下的 OPC 客戶(hù)端程序,實(shí)現(xiàn)了 OPC 客戶(hù)端與服務(wù)器之間的數(shù)據(jù)交換 。程序?qū)崿F(xiàn)了 OPC 服務(wù)器連接、組建立、項(xiàng)添加、項(xiàng)值讀寫(xiě)等功能。在程序設(shè)計(jì)過(guò)程中運(yùn)用面向?qū)ο蟮脑O(shè)計(jì)模式,使客戶(hù)端程序具有較強(qiáng)的靈活性、擴(kuò)展性和通用性。 論文最后使用 測(cè)試服務(wù)器對(duì) OPC 客戶(hù)端程序進(jìn)行了測(cè)試。測(cè)試表明該 OPC 客戶(hù)端程序具有良好的可靠性和靈活性,方便連接 OPC 服務(wù)器,可實(shí)現(xiàn)數(shù)據(jù)的實(shí)時(shí)、快速交換。 關(guān)鍵詞: OPC; ;客戶(hù)端;層次結(jié)構(gòu);面向?qū)ο? ABSTRACT OPC is an open industry standard software interface, which based on COM / DCOM technology , widely used in the field of process control technology as data exchange technology, piaying a very important role between devicelevel control system and sitelevel process management in information exchange and achieving open control system as a part of middleware technology. First ,Paper simple analyses the OPC(OLE for process control) munications technical specification norms, And based on OPC Data Access specification,using OPC client / server data access of hierarchical model structure. As the same time, I employed highlevel programming languagesVisual Basic designed and developed OPC Client program under the Windows platform to realize the data exchange between OPC client and server. The OPC Client program can realize the OPC server connectting, groupbuilding, add items, items of value to read and write functions. In the process of program design ,I used objectoriented designning patterns, so that the client program has a strong flexibility, scalability and versatility. At the end of the paper, I maded use of the OPC server test client program。 Test indicated that the OPC client program has a good reliability and flexibility in connecting OPC servers,also, realtime data can be quickly exchanged. Keywords: OPC; ; OPC Client ; Hierarchical structure; ObjectOriented 目 錄 1 緒論 ...............................................................................................................................1 課題的背景及意義 ...............................................................................................1 OPC 技術(shù)的優(yōu)點(diǎn) ...................................................................................................5 課題的主要研究?jī)?nèi)容及意義 ...............................................................................7 本章小結(jié) ...............................................................................................................8 2 OPC 簡(jiǎn)介 .....................................................................................................................8 OPC 規(guī)范 (OPC Data Access Specification) ..........................................................8 OPC 數(shù)據(jù)訪問(wèn)規(guī)范簡(jiǎn)介 ....................................................................................8 OPC 對(duì)象與數(shù)據(jù)訪問(wèn)接口 ..............................................................................11 OPC 數(shù)據(jù)訪問(wèn)機(jī)制 ..........................................................................................13 OPC 中的兩個(gè)層次問(wèn)題 .....................................................................................15 OPC 對(duì)象的分層結(jié)構(gòu) ......................................................................................15 OPC 服務(wù)器的層次結(jié)構(gòu) ..................................................................................16 OPC 客戶(hù)端關(guān)鍵技術(shù)的實(shí)現(xiàn) .............................................................................17 OPC 客戶(hù)端端口的實(shí)現(xiàn) ..................................................................................17 OPC 客戶(hù)端實(shí)時(shí)數(shù)據(jù)的獲得 ..........................................................................18 本章小結(jié) .............................................................................................................18 3 OPC 客戶(hù)端程序設(shè)計(jì) ..................................................................................