| 研究生: |
劉川榮 Liu, Chuan-Rong |
|---|---|
| 論文名稱: |
設計與實作支援Modbus指令優先排序功能的協定轉換物聯網閘道器 Design and Implementation of a Protocol Conversion IoT Gateway Supporting Modbus Command Priority |
| 指導教授: |
侯廷偉
Hou, Ting-Wei |
| 學位類別: |
碩士 Master |
| 系所名稱: |
工學院 - 工程科學系 Department of Engineering Science |
| 論文出版年: | 2021 |
| 畢業學年度: | 109 |
| 語文別: | 中文 |
| 論文頁數: | 60 |
| 中文關鍵詞: | 乙太網路 、Modbus 、RS485 、嵌入式 、閘道器 、優先級 、物聯網 |
| 外文關鍵詞: | Ethernet, Modbus, RS485, Embedded, Gateway, Priority, IoT |
| 相關次數: | 點閱:246 下載:8 |
| 分享至: |
| 查詢本校圖書館目錄 查詢臺灣博碩士論文知識加值系統 勘誤回報 |
隨著物聯網的普及,現今工業上有許多利用RS485介面並且使用Modbus協定進行通訊的裝置有連網需求,許多廠商會為這些設備加裝乙太網路與RS485通訊轉換的閘道器,讓使用者可以遠距離讀寫裝置資訊,或者對其進行控制。當有多個使用者對閘道器同一個RS485 port傳遞請求時,若其中有較為緊急的指令,閘道器要優先將該指令發送至RS485線路中,以減少反應時間。本論文的目的為利用現有的閘道器設計框架與軟體設計模式,在確保半雙工的RS485通訊不產生碰撞的前提下,研究各種閘道器在網路伺服器架構的使用場合中,適合用於嵌入式系統開發的應用程式設計方式。
本論文使用NuMaker-IIoT-NUC980開發板為開發平台,以Queue-based load leveling pattern與Half sync/half async pattern兩種軟體設計模式撰寫閘道器程式,並以實驗證實了此兩款閘道器程式的穩定性和避免RS485通訊碰撞、利用優先級降低反應時間等基礎功能。兩種閘道器軟體設計模式在不同情境下的表現測試中,當使用情形為單一使用者透過乙太網路對閘道器RS485 port傳遞Modbus指令時,使用Queue-based load leveling pattern新增執行緒專門處理使用者請求的方式可以帶來較低的反應時間;而在會有複數使用者透過乙太網路對同一個RS485 port傳遞Modbus指令的情形下,受速度慢的 RS485 通訊影響,無法達成高即時性的需求,因此使用Half sync/half async pattern單一非同步程式處理所有使用者請求的方式,在記憶體消耗方面會有明顯的優勢。
Due to the popularity of the Internet of Things, there are many industrial devices using RS485 interface and Modbus protocol for communication. They have the demand for connecting to the internet nowadays. Many manufacturers install the gateways that convert between Ethernet and RS485 communication for these devices, allowing users to read and write devices’ information, or control them remotely. When multiple users transfer requests to the same RS485 port of the gateway, the gateway should send the urgent command to RS485 network first if it exists. It will reduce the reaction time. This research uses the existing framework and software design patterns to develop gateway under the premise of preventing signal collision in the half-duplex RS485 communication. The purpose is to research which method of gateway application design for embedded systems is better under different network server utilization situations.
This research uses ARM9-based development board as the development platform. The design patterns of the gateway application are Queue-based load leveling pattern and Half sync/half async pattern. Experiments are tested on the basic functions of two gateway applications, including the stability, prevention of the RS485 signal collision, and reduction of reaction time via priority. Then the performance tests of two software design patterns in different scenarios are carried out. In case of just one user transfers Modbus command to the gateway RS485 port by Ethernet, Queue-based load leveling pattern, the method of adding thread to deal with the request, consume less time. If multiple users use Ethernet to send requests to the same gateway RS485 port, the gateway cannot arrive the real-time demand because of the low speed of RS485 communication. Half sync/half async pattern, which uses just one asynchronous program to handle all users’ requests, has the obvious advantage of system memory consumption.
[1] Eclipse IoT Working Group, IEEE IoT, AGILE IoT, IoT Council, IoT Developer Survey 2017. [Online]. Available: https://iot.eclipse.org/community/resources/iot-surveys/assets/iot-developer-survey-2017.pdf (accessed Jul. 14, 2021)
[2] Modbus Organization, Modbus Application Protocol Specification V1.1b3. [Online]. Available: https://modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf (accessed Jul. 14, 2021)
[3] NETEON, “Moxa產品購買網站.” https://shopmoxa.neteon.net (accessed Jul. 21, 2021)
[4] Advantech, “Advantech產品購買網站.” https://iotmart.advantech.com.tw (accessed Jul. 21, 2021)
[5] Santi Nuratch, “Microcontroller-based Modbus Master Design and Implementation for Multiple Networks and Platforms Using Object-based Design Technique,” in 2017 14th International Conference on Electrical Engineering/Electronics, Computer, Telecommunications and Information Technology (ECTI-CON), Jun. 2017, pp. 616-619
[6] 林裕文, 基於Modbus協定之多重設備與單一網路協定轉換之嵌入式系統研製 國立臺北科技大學碩士論文, 中華民國一零四年一月
[7] Shuangye Chen, Dongyue Zheng, Rujun Yang, “Design of Preverifying Serial-Ethernet Communication Gateway Based on LM3S8962” in 2013 IEEE International Conference on Mechatronics and Automation, Aug. 2013, pp. 1620-1624
[8] Liang Zhao, Wenyan Wu, Shengming Li, “Design and Implementation of an IoT-Based Indoor Air Quality Detector with Multiple Communication Interfaces,” IEEE Internet of Things Journal, vol. 6, no. 6, pp. 9621-9632, Dec. 2019
[9] Jiangmiao Xie, Qiang Gao, “Design and Implementation of Embedded Protocol Conversion Gateway for Intelligent Buildings,” in 2019 IEEE 10th International Conference on Software Engineering and Service Science (ICSESS), Oct. 2019, pp. 1-5
[10] 吳承樺, 採用Modbus 通訊協定之工業物聯網閘道器設計與實作, 國立聯合大學碩士論文, 中華民國一零八年一月
[11] Dumitru-Cristian Trancă, Alexandru Viorel Pălăcean, Andrei Cristian Mihu, Daniel Rosner, “ZigBee based wireless Modbus Aggregator for Intelligent Industrial Facilities,” in 2017 25th Telecommunication Forum (TELFOR), Nov. 2017, pp. 1-4
[12] Qi Xiong, Qiusheng Rong, “The Design of Serial Server Based on Semaphore Under Linux,” in 2010 2nd IEEE International Conference on Information Management and Engineering, Apr. 2010, pp. 398-400.
[13] MicrosoftDocs, “Queue-based load leveling pattern.” github.com. https://github.com/MicrosoftDocs/architecture-center/blob/master/docs/patterns/queue-based-load-leveling.md (accessed Jun. 26, 2021)
[14] Ronald Strebelow, Christian Prehofer, “Analysis of Event Processing Design Patterns and Their Performance Dependency on I/O Notification Mechanisms,” in International Conference on Multicore Software Engineering, Performance, and Tools, Aug. 2013, pp. 54-65.
[15] Steffen Späthe, Christoph Prater, “Realization of IPv6 Connectivity via RS485 Fieldbus by Adaption of 6LoWPAN,” in 2018 IEEE International Conference on Internet of Things and Intelligence System (IOTAIS), Nov. 2018, pp. 35-39.
[16] Nuvoton, NuMaker NUC980 IIoT User Manual. [Online]. Available: https://www.nuvoton.com/export/resource-files/NuMaker_NUC980_IIoT_User_Manual.pdf (accessed Jul. 17, 2021)
[17] Chris Simmonds, Gustavo Zacarias, “procrank_linux.” github.com. https://github.com/csimmonds/procrank_linux (accessed Jul. 19, 2021)