摘 要:CAN總線基于自身的特點,特別適合工業(yè)過程監(jiān)控設(shè)備的互連。本文給出一種基于CAN總線的溫度與壓力控制系統(tǒng)的設(shè)計方案,說明了系統(tǒng)的總體設(shè)計思路和各部分的結(jié)構(gòu)原理,并結(jié)合控制軟件詳細(xì)闡述了實時數(shù)據(jù)庫的接口和應(yīng)用設(shè)計。還介紹了多線程技術(shù),用以保證實時數(shù)據(jù)庫的實時性。
關(guān)鍵詞:實時數(shù)據(jù)庫;CAN總線;數(shù)據(jù)處理;多線程
中圖分類號:TP31113 文獻(xiàn)標(biāo)識碼:B
文章編號:1004373X(2008)0117202
Application of the Real-time Database in Control System of Temperature and Pressure
GUO Lei1,LI Zirong1,WANG Daming2
(1.China Airborne Missile Academy,Luoyang,471009,China;2.Air Force in Luoyang Representative Office,Luoyang,471009,China)
Abstract:Based on the character of itself,CAN bus especially fits the interconnection of industrial process monitoring equipments.In this dissertation,a design project of temperature and pressure control system based on the CAN bus is proposed.Meanwhile,the overall design thought of the system and the configuration principle of every part is represented.Considering control soft,the interface of real time database and application design is described in detail.In order to ensure the real-time characteristic of the real time database,multithreading technique is also introduced in this dissertation.
Keywords:real-time database;CAN bus;data processing;multithreading
現(xiàn)場總線是用于過程自動化和制造自動化最底層的現(xiàn)場設(shè)備或現(xiàn)場儀表互連的通信網(wǎng)絡(luò),是現(xiàn)場通信網(wǎng)絡(luò)與計算機(jī)控制系統(tǒng)的集成。目前,常用的現(xiàn)場總線有:基金會現(xiàn)場總線(Foundation Fieldbus,F(xiàn)F)、LonWorks現(xiàn)場總線、PROFIBUS現(xiàn)場總線(Process Field Bus)、CAN(Controller Area NetWork)現(xiàn)場總線和HART(Highway Addressable Remote Transducer)現(xiàn)場總線等。其中,CAN總線因具有可靠性高、協(xié)議精煉、價格低、貨源廣泛等優(yōu)點而在工業(yè)測控領(lǐng)域獲得廣泛應(yīng)用。將CAN總線技術(shù)應(yīng)用于溫度與壓力控制系統(tǒng),并結(jié)合實時數(shù)據(jù)庫,可以對工業(yè)現(xiàn)場的溫度和壓力進(jìn)行精確控制。
1 系統(tǒng)的硬件設(shè)計
1.1 系統(tǒng)結(jié)構(gòu)原理
溫度與壓力控制系統(tǒng)由工業(yè)控制計算機(jī)(IPC)、CAN接口適配卡和被測的各節(jié)點模塊構(gòu)成。各節(jié)點模塊將數(shù)據(jù)信息通過CAN通信協(xié)議傳送至CAN接口適配卡,適配卡再與計算機(jī)進(jìn)行通訊,從而實現(xiàn)統(tǒng)一調(diào)度和管理的功能。圖1為系統(tǒng)的結(jié)構(gòu)原理圖。
1.2 CAN接口適配卡
CAN接口適配卡用來完成計算機(jī)與各節(jié)點模塊間的通信任務(wù)。他主要由微控制器AT89C52、CAN通信控制器SJA1000、PC總線接口電路、雙端口RAM、復(fù)位電路DS1232、CAN總線驅(qū)動82C250構(gòu)成。SJA1000具有2種工作模式:基本CAN(BasicCAN)模式和增強(qiáng)CAN(PeliCAN)模式。……