【正文】
沈陽理工大學(xué)學(xué)士學(xué)位論文I摘 要隨著科學(xué)技術(shù)的發(fā)展,現(xiàn)場總線技術(shù)在各領(lǐng)域中得到越來越廣泛的應(yīng)用。現(xiàn)場總線技術(shù)以其實時、可靠、低成本、使用方便等特點,在控制現(xiàn)場層得到廣泛的應(yīng)用。其中 CAN 總線與其它幾種現(xiàn)場總線比較而言,是最容易實現(xiàn)、價格最為低廉的一種,但其性能并不比其它現(xiàn)場總線差。在實際應(yīng)用中,大多數(shù)控制器和設(shè)備通信所使用的仍是傳統(tǒng)的 RS485。因此,為了將這些設(shè)備納入現(xiàn)場總線的控制網(wǎng)絡(luò),研究現(xiàn)場總線與 RS485 之間的協(xié)議網(wǎng)關(guān)很有必要。本文主要設(shè)計了 CAN 總線與 RS485 之間的網(wǎng)關(guān)。通過對現(xiàn)場總線技術(shù)的應(yīng)用現(xiàn)狀的分析,建立了基于網(wǎng)關(guān)的工業(yè)網(wǎng)絡(luò)化控制系統(tǒng)結(jié)構(gòu)模型,主要采用 AT89S51 單片機和 SJA100 控制器開發(fā)設(shè)計了網(wǎng)關(guān)硬件,完成 CANRS485 協(xié)議轉(zhuǎn)換網(wǎng)關(guān)的軟件設(shè)計開發(fā),并調(diào)試實現(xiàn)了 CPU 與 RS485 之間的數(shù)據(jù)交互。關(guān)鍵詞:現(xiàn)場總線;CAN;RS485;網(wǎng)關(guān)沈陽理工大學(xué)學(xué)士學(xué)位論文IIAbstract With the development of science and technology, the fieldbus technology is playing more and more important role in all areas. With its realtime, reliable, low cost, easy to use, fieldbus technology is widely used on site in the control contrast to the other fieldbus, CAN bus is the easiest and most inexpensive price,but its performance was not worse than any other practical application,RS485 is widely used in most of the controllers and Industrial Communication ,in order to connect these devices to the fieldbus control work, it is necessary to design the gateway between field bus and the RS485.In this paper, we designed the gateway between CAN bus and RS485. By analysing the application of fieldbus technology,we put forward the control system model based on industrial work used AT89S51 and SJA100 to design the gateway hardware,and developed the gateway ,after software testing,the data exchange between the CPU and RS485 was achieved.Keywords: Fieldbus。CAN。RS485。Gateway 沈陽理工大學(xué)學(xué)士學(xué)位論文III目 錄1 緒論 .........................................................................................................................................1 課題研究的重要意義 ......................................................................................................1 網(wǎng)關(guān) ..................................................................................................................................2 網(wǎng)絡(luò)互連設(shè)備 ............................................................................................................2 工業(yè)控制中網(wǎng)關(guān)的應(yīng)用和研究 .................................................................................3 現(xiàn)場總線 ..........................................................................................................................4 現(xiàn)場總線的發(fā)展現(xiàn)狀和趨勢 ..................................................................................4 主流現(xiàn)場總線簡介 ..................................................................................................5 本論文的主要工作 ..........................................................................................................72 基于網(wǎng)關(guān)的網(wǎng)絡(luò)化控制系統(tǒng)模型 .........................................................................................8 現(xiàn)有控制系統(tǒng)存在的不足 ..............................................................................................8 基于網(wǎng)關(guān)的網(wǎng)絡(luò)化控制系統(tǒng)模型 ..................................................................................8 基于網(wǎng)關(guān)的網(wǎng)絡(luò)化控制系統(tǒng)結(jié)構(gòu) ............................................................................9 控制系統(tǒng)中網(wǎng)關(guān)的需求分析 ..................................................................................103 CANS485 協(xié)議轉(zhuǎn)換網(wǎng)關(guān) 的設(shè)計 .........................................................................................12 CAN 協(xié)議規(guī)范 ................................................................................................................12 CAN 報文規(guī)范 ................................................................................................................13 主要器件介紹 ................................................................................................................13 CAN 控制器 SJA1000 簡介 ....................................................................................13 CAN 收發(fā)器 PCA82C250 簡介 ...............................................................................16 單片機 AT89S51 簡介 ............................................................................................17 RS485 收發(fā)器 MAX485 簡介 .................................................................................19 CANRS485 協(xié)議轉(zhuǎn)換網(wǎng)關(guān)設(shè)計 ....................................................................................20 基本原理 ..................................................................................................................20 硬件設(shè)計 ..................................................................................................................20 軟件設(shè)計 ..................................................................................................................214 試驗調(diào)試 ...............................................................................................................................275 可靠性設(shè)計 ...........................................................................................................................32沈陽理工大學(xué)學(xué)士學(xué)位論文IV 硬件設(shè)計 ........................................................................................................................32 軟件設(shè)計 ........................................................................................................................32結(jié) 論 .........................................................................................................................................34致 謝 .........................................................................................................................................35參考文獻(xiàn) ...................................................................................................................................36附錄 A 英文 原文 .....................................................................................................................37附錄 B 中文翻譯 .....................................................................................................................41附錄 C.......................................................................................................................................44圖 C1 原理圖 ........................................................................................................