【正文】
克服傳統(tǒng)的設(shè)計方法的缺點,逐漸創(chuàng)造出了新的軟件開發(fā)技術(shù),即面向?qū)ο蠹夹g(shù)。 另外,結(jié)構(gòu)化方法從本質(zhì)上仍是把數(shù)據(jù)和操作分離,以至在實現(xiàn)階段,一些具有潛在可重用價值的軟件部分和具體應用環(huán)境密不可分。 其次,結(jié)構(gòu)分析與結(jié)構(gòu)設(shè)計技術(shù)清楚地定義了目標系統(tǒng)的接口。結(jié)構(gòu)化方法強調(diào)過程抽象,將現(xiàn)實世界映射為數(shù)據(jù)流和加工,加工之間通過數(shù)據(jù)流進行通信,數(shù)據(jù)作為被動的實體被主動的操作所加工,這是以過程為中心來構(gòu)造系統(tǒng)和設(shè)計程序的。面向過程程序設(shè)計涉及到結(jié)構(gòu)分析與結(jié)構(gòu)設(shè)計技術(shù),它們在現(xiàn)在的應用中表現(xiàn)出了許多明顯的缺點,用這些技術(shù)開發(fā)出的軟件,其穩(wěn)定性、可修改性和重用性都比較差。它是一種自頂向下逐步求精的設(shè)計方法和單入口單出口的程序結(jié)構(gòu)。它把一個復雜的程序分解成若干個較小的過程,每個過程都可以單獨地設(shè)計、修改、調(diào)試。 (4)對軟件進行現(xiàn)場測試,以驗證設(shè)計的可行性、準確性和優(yōu)越性。 (2)分析整個 溫濕度測量 系統(tǒng)的總體框架及其功能特點。此軟件具有 溫濕度 的實時監(jiān)測、歷史 記錄 查看及其數(shù)據(jù)庫管理等功能,高度可視化、全中文界面、具有可擴展性,減少了人為的差錯,它與通信模塊和下位機等共同構(gòu)成了 溫濕度測量 系統(tǒng) 。 課題 主要研究的內(nèi)容 木課題以 Windows XP 為開發(fā)平臺,以 C++為開發(fā)語言,以 VisualC++ 作為前臺開發(fā)環(huán)境, Microsoft Access 作為后臺開發(fā)數(shù)據(jù)庫。因此,在這些領(lǐng)域中,對于這兩個參數(shù)的測量與控制就顯得尤為重要,特別是在紡織工業(yè)、冶金、化工、食品、溫室種植,汽車制造以及氣象預報和科研實驗室等許多地方,都具有舉足輕重的作用。 關(guān)鍵詞 : 溫濕度,數(shù)據(jù)采集, 串口通信, MFC,上位機 , MSComm 溫濕度測量系統(tǒng)設(shè)計(上位機軟件設(shè)計) II Temperature and humidity measurement system design ( PC software design) ABSTRACT Approach is PC through RS_485 bus and provisions of the munication protocol under orders to send out a machine, lower level puter according to this mand to explain again into corresponding timing signal directly control sensor. From lower level puter equipment state data, converted into digital signal feedback to the PC. PC docking receive data processed, in upper machine display and storage and database medium. Meanwhile PC user management, the convenient user for the collected data in view of historical data and the query etc. Introduced the temperature and humidity measurement system of software constitutes upper machine. Use Visual C + + as a development platform, using MFC libraries, using dialogbased templates, Microsoft Access as a background, and by using the development of database MSComm control design for a plete serial munication realtime monitoring PC software system. This paper, starting from the PC software by using objectoriented, database, serial munication technology plete system information and data storage, data and curve realtime display, lasted inquiry, and other functions, realized the PC system monitoring task. Given the general design of the software solutions and the function module design, shows the software39。 本文從上位機軟件出發(fā),利用面向?qū)ο?、?shù)據(jù)庫、串口通信 等技術(shù) 完成 系統(tǒng) 信息和 數(shù)據(jù)存儲、數(shù)據(jù)和曲線實時顯示、 歷時查詢、等功能,實現(xiàn)了上位機系統(tǒng)的 監(jiān)測任務(wù)。 介紹了溫濕度測量系統(tǒng)上位機的軟 件構(gòu)成。 上位機對接收到的數(shù)據(jù)經(jīng)過處理,在上位機上顯示和存儲與數(shù)據(jù)庫中等。陜西科技大學畢業(yè)論文(設(shè)計說明書) I 溫濕度測量系統(tǒng)設(shè)計(上位機軟件設(shè)計) 摘 要 本課題實現(xiàn)方法是 上位機 通過 RS_485總線及規(guī)定的通信協(xié)議 發(fā)出的命令 發(fā)送 給下位機,下位機再根據(jù)此命令解釋成相應時序信號直接控制 傳感器 。下位機不時讀取設(shè)備狀態(tài)數(shù)據(jù) ,轉(zhuǎn)換成數(shù)字信號反饋給上位機 。同時上位機對用戶進行管理,方便用戶對采集到的數(shù)據(jù)進行查看及對歷史數(shù)據(jù)的查詢等。用 Visual C++作為開發(fā)平臺,采用 MFC類庫,利用 基 于對話框的模板 , Microsoft Access 作為后臺開發(fā)數(shù)據(jù)庫 ,并利用MSComm 控件完成串口通信 設(shè)計了一個 實時監(jiān)測上位機軟件系統(tǒng)。給出了軟件的總體設(shè)計方案和各功能模塊的設(shè)計 , 說明 了該軟件的主要功能 ,并給出了系統(tǒng)的運行界面和應用模式。s main function is presented, and the operation of the system interface and application mode. KEY WORDS: Temperature and humidity, Serial munication, Data acquisition, MFC, PC, MSComm 陜西科技大學畢業(yè)論文(設(shè)計說明書) III 目 錄 摘 要 .................................................................... I ABSTRACT ................................................................ II 1 緒論 .................................................................... 1 課題意義及目的 ................................................... 1 課題主要研究的內(nèi)容 ............................................... 1 2 面向過程與面向?qū)ο? ..................................................... 2 面向過程與面向?qū)ο蠹夹g(shù) ........................................... 2 面向?qū)ο蟮某绦蛟O(shè)計 ............................................... 4 本章小結(jié) .......................................................... 5 3 系統(tǒng)相關(guān)技術(shù)介紹 ........................................................ 6 Visual C++開發(fā)平臺 ............................................... 6 Windows 編程模型 ............................................ 6 VC++應用程序創(chuàng)建過程 ....................................... 7 VC++集成開發(fā)環(huán)境介紹 ....................................... 8 數(shù)據(jù)庫技術(shù) ........................................................ 9 VC++ 開發(fā)數(shù)據(jù)庫技術(shù)的特點 ................................ 9 SQL 語言概述 ............................................... 10 ADO 數(shù)據(jù)庫訪問技術(shù) ......................................... 12 單片機與 PC 串口通信技術(shù) ......................................... 17 數(shù)據(jù)通信的概念 ............................................ 17 串行通信的通信方式 ........................................ 18 串行通信的過程及通信協(xié)議 .................................. 19 實時數(shù)據(jù)顯示技術(shù) ................................................ 20 VC++串口通信技術(shù) ................................................ 20 事件驅(qū)動方式 .............................................. 21 查詢方式 .................................................. 21 MSComm 控件串口編程基本流程 ..................................... 23 在當前 Project 中插入 MSComm 控件 ........................... 24 初始化并打開串口 .......................................... 24 捕捉串口事項 .............................................. 25 串口讀寫 .................................................. 25 關(guān)閉串口 .................................................. 26 溫濕度測量系統(tǒng)設(shè)計(上位機軟件設(shè)計) IV 本章小結(jié) ......................................................... 26 4 系統(tǒng)總體設(shè)計 ........................................................... 27 系統(tǒng)功能描 述 ..................................................... 27 系統(tǒng)總體設(shè)計 ..................................................... 27 系統(tǒng)的通信協(xié)議 ................................................... 28 模塊接口協(xié)議格式 ........................................... 28 上位機命令幀數(shù)據(jù)格式 ....................................... 29 下位機上傳數(shù)據(jù)幀格式 ....................................... 29 本章小結(jié) ..................................................... 30 5 上位機軟件設(shè)計與各模塊的實現(xiàn) ........................................... 31 系統(tǒng)功能模塊劃分 ................................................ 31 用戶登錄的設(shè)計 ............................................ 31 系統(tǒng)軟件程序設(shè)計 ........................................... 34 相關(guān)數(shù)據(jù)庫的設(shè)計 ..................................