本文主要闡述了利用C8051F系列單片機和計算機組成RS-485通信系統,實現對遠程供電設備電流、電壓、頻率、溫度進行采樣,將結果通過RS485總線發送到計算機并在界面上顯示的設計與實現。在介紹分布式供電設備的基本概念和RS485等遠程通訊協議的基礎上,結合硬件電路,設計和編寫下位機軟件,實現分布式供電設備的信號采集、數據遠程傳送和控制命令的接收等功能。同時采用Visual C++ 6.0開發出基于WINDOWS的上位機監控界面,對下位機發送的數據進行處理,完成與下位機的通訊功能并對數據庫進行管理。該界面具有良好的人機交互功能,數據越限時能夠自動報警。本文還詳細給出了利用Visual C++ 6.0讀寫串口的函數實現、制作界面的具體步驟以及數據存入數據庫的具體過程。
關鍵詞: 單片機 串口通信 RS485總線
Remote Monitoring System of Distributed Power Supply
Equipment (Part of Software)
ABSTRACT
This article describes the use of C8051F MCU and computer components RS-485 communication systems mainly, and has achieved current, voltage, frequency, temperature sampling in the long-range power supply equipment, then the results are sent to the computer interface displayed on the Design and implementation through the RS485 bus. On the basis of the basic concept of distributed power supply equipment and the long-distance communications of RS485 and so on, combining hardware, has designed and compile the next-bit software, and has achieved functions of long-distance data transmission,the distributed power supply equipment’s signal acquisition, reception of control orders and so on. At the same time using Visual C + + 6.0 WINDOWS developed based on the PC monitor interface, the data that the crew sent to is took order with, and completes communication with the next crew and database management. The interface has a good interactive features, and the data can be time-limited automatic alarm. This paper also gives Concrete steps of the use of Visual C + + 6.0 to read and write serial port to achieve a function and the production interface, along with the specific process of data in the database.