For example, a slave device may be defined such that holding registers and input registers actually share the same memory if that behavior makes sense for the slave. Modbus exposes these values in a completely conceptual way, meaning they may not actually exist in memory. For example, a pressure sensor may split a 32-bit floating point value across two 16-bit registers. It is common for slave devices to convert these larger data types into registers. In many cases, sensors and other devices generate data in types other than simply Booleans and unsigned integers. A slave can define as many as 65,536 elements in each range. To meet this need, Modbus data values are divided into four ranges (see Table 1). In SCADA systems, it is common for embedded devices to have certain values defined as inputs, such as gains or proportional integral derivative (PID) settings, while other values are outputs, like the current temperature or valve position. Natively, Modbus supports two data types: a Boolean value and an unsigned, 16-bit integer. Modbus manages the access of data simply and flexibly. Most drivers convert this to a form that makes sense for the language or application in use. Modbus defines a specific PDU for exceptions, which lets the master know what happened. Each function code has a well-defined response, and you can think of this function code as the command being sent to the slave. Each PDU contains a function code and associated data. Within each ADU, there is a protocol data unit (PDU) that is the core of the Modbus protocol. From the point of view of the application using Modbus, data should simply be exposed as if the ADU did not exist. RTU and ASCII are older serial ADU formats with the primary difference between the two being that RTU uses a compact binary representation while ASCII sends all requests as streams of ASCII characters.įor most applications, the preferred ADU depends on the desired physical network (Ethernet, serial, or something else), the number of devices on the network, and the ADUs supported by the master and slave devices on the network. TCP is a modern format that allows for efficient handling of Modbus requests and responses in software, as well as more efficient networking through the use of dedicated connections and identifiers for each request. There are three ADUs: ASCII, remote terminal unit (RTU), and TCP/IP. The first layer is the application data unit (ADU), which is what most people consider to be the “type” of Modbus used. In Modbus, this request is a layered set of data. The Master-Slave, Request-Response Relationship of Modbus Devices Even on modern TCP/IP networks, it gives the master a high degree of control over slave behavior, which is helpful in some designs.įigure 1. This architecture gives the master full control over the flow of information, which has benefits on older multidrop serial networks. The Modbus protocol follows a master and slave architecture where a master transmits a request to a slave and waits for the response.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |