Font Size: a A A

Design And Application Of Modbus Protocol Stack For Internet Of Things

Posted on:2019-11-29Degree:MasterType:Thesis
Country:ChinaCandidate:P WangFull Text:PDF
GTID:2428330548982619Subject:Circuits and Systems
Abstract/Summary:PDF Full Text Request
With the development of Internet and communication technology,the integration of traditional electronic devices into the Internet has become another expansion direction of the Internet,namely the Internet of things.The development of the Internet of things can not be separated from the high reliability,simple semantic and expansible Internet of things protocols,which are specifically faced with the protocol specification in the three main problems of the object recognition,the connection of objects and the data exchange of the objects.Object recognition and object link depend on the underlying hardware support,such as RFID,NFC object recognition technology and LPWAN and 3GPP connection technology.In the case of the Internet of things,sensors,embedded devices,intelligent control systems and remote servers need to be closely linked together to form an intelligent network of objects,objects,objects and people.In this network,the diversity of the data sources is very large and the network structure of various devices is varied.Therefore,the design of a communication protocol suitable for the Internet of things needs to take into account the following problems: first,we need to choose a standard protocol with high openness and wide application as the protocol stack to realize the reference.Secondly,for complex application scenarios of IOT,protocols need to be compatible with all kinds of physical links and physical devices.Again,in order to improve the efficiency of the developer,the API can be flexible to provide remote,incoming communication and transparent transmission,especially in the Internet of things,the remote and near field data conversion should have the ability of transparent transmission.In view of the problem of standard protocol selection,this paper analyzes the advantages and disadvantages of several popular Internet of things protocols,and finally chooses the ModBus protocol based on public to implement the protocol stack.The ModBus protocol is widely used in the field of industrial automation and the protocol itself has the ability to connect remote and field networks.And because of the great similarity between the industrial Ethernet and the Internet of things,it can also be well expanded in the universal application of the Internet of things.Therefore,referring to the ModBus protocol standard,we design a Modbus protocol stack which is applied to the application layer of the Internet of things to adapt to the layered architecture of the Internet of things.The protocol stack can also provide remote TCP connection,local serial link connection,data transmission between TCP and device.Aiming at the problem of compatibility and extensibility,the article proposes a three tier protocol stack architecture based on the idea of low coupling.The application layer and the device related layer each maintain the operation structure and its operating function,and use the middle core layer to carry out the coupling,which makes the application layer shield the difference of the equipment related layer,so that the device related layer can expand or delete the support to some kind of equipment according to the requirement.It has good compatibility and extensibility.Sex.Aiming at the problem of remote,near field and transparent transmission capability support,the paper abstracts the interface functions of each layer based on the proposed three tier protocol stack architecture.For different physical devices,the device related layer implements the ModBus-RTU communication interface on the serial link and the ModBus-TCP communication interface under the TCP/IP protocol.The former provides the incoming communication capability,and the latter provides the remote communication capability.In the API design of the application layer,the application layer implements 12 function codes based on four basic communication functions,which embodies the function oriented service architecture of the protocol stack.In the aspect of transmission capability,it also implements the API interface between ModBus-RTU protocol and ModBus-TCP protocol based on the four basic communication functions of application layer.In the application of protocol stack,the article designs a simple intelligent home system to apply the protocol stack implemented to this topic,so as to verify the performance of the protocol stack.The smart home system is composed of two parts: home gateway and sensor control sub node.The home gateway is based on the AM335 X processor +Linux operation system to realize ModBus-TCP remote connection and ModBus-RTU local control and two protocol data conversion function.The sensor control sub node acts as the ModBus-RTU protocol sub device.It realizes the indoor environment monitoring and the home appliance control function based on the STM32 MCU.Through the system test,we can see that this article designs a protocol stack of ModBus protocol which is independent of the underlying link for the application of Internet of things.The experimental results show that the protocol stack is in function with the standard of ModBus standard protocol.The communication delay of each instruction is less than 540 us,and the frame error is almost 0,which ensures the reliability of the protocol stack.In addition,the design of the protocol stack is based on the layered and abstract idea,and the interface oriented to the application layer is unified.It can well shield the diversity of the physical layer and have some advantages in extensibility and portability.In addition,the protocol stack can be used in the embedded gateway for the conversion of RTU and TCP protocols.It can also be used as a master station or slave station alone.The interface designed based on this protocol stack can be well oriented to all kinds of Internet of things application scene and interconnect with some open platform of Internet of things.
Keywords/Search Tags:Internet of Things, ModBus-TCP, ModBus-RTU, Smart home, Home Gateway
PDF Full Text Request
Related items