DOI QR코드

DOI QR Code

Independent I/O Relay Class Design Using Modbus Protocol for Embedded Systems

  • Kim, Ki-Su (School of Computer Information Engineering, Kunsan University) ;
  • Lee, Jong-Chan (Dept. of Computer Information Engineering, Kunsan University)
  • Received : 2020.03.26
  • Accepted : 2020.06.02
  • Published : 2020.06.30

Abstract

Communication between system modules is applied using the Modbus protocol in industrial sites including smart factories, industrial drones, building energy management systems, PLCs, ships, trains, and airplanes. The existing Modbus was used for serial communication, but the recent Modbus protocol is used for TCP/IP communication.The Modbus protocol supports RTU, TCP and ASCII, and implements and uses protocols in embedded systems. However, the transmission I/O devices for RTU, TCP, and ASCII-based protocols may differ. For example, RTU and ASCII communications transmit on a serial-based communication protocol, but in some cases, Ethernet TCP/IP transmission is required. In particular, since the C language (object-oriented) is used in embedded systems, the complexity of source code related to I/O registers increases. In this study, we designed software that can logically separate I/O functions from embedded devices, and designed the execution logic of each instance requiring I/O processing through a delegate class instance with Modbus RTU, TCP, and ASCII protocol generation. We designed and experimented with software that can separate communication I/O processing and logical execution logic for each instance.

스마트팩토리, 산업용 드론, 빌딩 에너지 관리 시스템, PLC, 선박, 기차 및 비행기를 포함한 산업현장에서 Modbus프로토콜을 사용하여 시스템 모듈 간 통신을 적용한다. 기존의 Modbus는 시리얼 직렬통신으로 사용되었지만, 최근 Modbus프로토콜은 TCP/IP 통신으로 사용된다. Modbus프로토콜은 3가지 유형의 RTU, TCP 및 ASCII를 지원하고 임베디스 시스템에 프로토콜을 구현 하여 사용 한다. 하지만 RTU, TCP, ASCII기반의 프로토콜은 각 송신 I/O장치가 다를 수 있다. 예를 들어 RTU, ASCII 통신은 시리얼기반으로 통신 프로토콜을 송신하지만 이더넷 TCP/IP 송신을 요구하는 경우도 있다. 이와 같은 문제는 특히 임베디드 시스템에서 C언어(절차 지향)를 사용하기 때문에 I/O레지스터 관련 소스코드의 복잡성 증가 문제가 발생된다. 본 연구는 임베디드 장치에서 I/O함수를 논리적으로 분리가능한 소프트웨어 설계를 진행하고, 더불어 대리자 클래스 인스턴스를 통하여 I/O처리가 필요한 각 인스턴스의 수행 로직을 Modbus RTU, TCP, ASCII프로토콜 생성으로 설계 하였고 인스턴스별 통신 I/O처리와 논리적 수행 로직을 분리 가능한 소프트웨어 설계와 실험을 하였다.

Keywords

References

  1. Wikipedia, Fourth Industrial Revolution, https://ko.wikipedia.org/wiki/Fourth Industrial Revolution
  2. Wikipedia, Internet of Things, https://ko.wikipedia.org/wiki/Internet of Things
  3. Sangjin Jeong, Yoon-Young An, Hyunjoo Kang, Taehyoung Shim, Sung-Hei Kim, “An IoT Standards-Based Electrical Equipment Status Monitoring System Supporting Modbus/OCF Bridging,” Journal of Electrical Engineering & Technology, Vol. 69, No. 1, pp. 217-224, Jan 2020.
  4. Dong-Hwan Kim, Bo-Heon Kim, Jeong-Ho Song, Hwang-Rae Kim, "A Design of Modbus Communication Class for Multiple SCU Connections, "Journal of Korean Institute of Information Technology, Vol. 16, No. 2, pp. 67-73, Feb 2018, DOI 10.14801/jkiit.2018.16.2.67
  5. Sang-hee Eum, "A Programmable Protocol Data Conversion Algorithm for Industrial Machine Monitoring, "Journal of the Korea Institute of Information and Communication Engineering, Vol. 21, No. 11, pp. 2139-2144, Nov.2017 https://doi.org/10.6109/jkiice.2017.21.11.2139
  6. Modicon Modbus Protocol Reference Guide, http://modbus.org/docs/PI_MBUS_300.pdf
  7. Microchip, http://ww1.microchip.com/downloads/en/DeviceDoc/doc2467.pdf
  8. Erich Gamma, Design Patterns , ADDISONWESLEY , 395, 2003
  9. Jeong-Ho Song, Bo-Hun Kim, Hwang-Rae Kim, "A Design of A Modbus Application Protocol for Multiple SCU Connections," Journal of the Korea Academia-Industrial cooperation Society, Vol. 19, No. 4, pp. 642-649, 2018 DOI 10.5762/KAIS.2018.19.4.642
  10. Modbus Application Protocol Manual V1_1b3: Available From: http://www.Modbus.org (accessed Aug, 15, 2017)
  11. Bo-Heon Kim, Jeong-Ho Song, Hwang-Rae Kim, "A Study on Enhancement of the MOD-BUS RTU Protocol for Multi-Device Connection", Journal of KIIT. Vol. 16, No. 2, pp. 67-73, Feb. 28, 2018