Modbus Primer

"Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Modbus has become a de facto standard communication protocol and is now a commonly available means of connecting industrial electronic devices." – Wikipedia article on Modbus (https://en.wikipedia.org/wiki/Modbus).

Messages

All Modbus communications are achieved by sending messages (packets).

Modbus RTU, ASCII, and TCP

Modbus RTU, Modbus ASCII, and Modbus TCP are three most common types of Modbus communication protocols. All three are supported by Tibbo Modbus Gateways.

Modbus RTU and Modbus ASCII use serial (RS232 or RS485) communications. Modbus RTU messages comprise binary data blocks separated (framed) by idle periods. Modbus ASCII transmissions rely on the leading colon (":") and trailing newline (CR/LF) for message framing. Tibbo Modbus Gateways come equipped with up to four serial ports. Available port types include RS232, RS485, and universal RS232/422/485 ports.

Modbus TCP devices use TCP/IP protocol for Modbus message transmission. Just like with Modbus RTU, Modbus TCP messages are binary blocks separated (framed) by idle periods. All Tibbo Modbus Gateways feature an Ethernet port for TCP communications with Modbus TCP devices. Our Gateways may optionally be equipped with Wi-Fi ports as well.

Masters and Slaves

A Modbus device can be either a Master or a Slave. Modbus Masters initiate all communications with Slaves and do not communicate with other Masters. Modbus Slaves are completely passive and communicate only by sending responses to requests from Masters. Master requests contain commands for Slaves to process.

Each time a Master sends a request to a specific Slave, it must wait for a reply. All Slaves are expected to reply within a certain time period. A Master is not supposed to send the next request until the previously addressed Slave replies or the waiting period ends. A Slave may send either a "normal" reply or an "exception" reply. A "normal" reply is sent when the command from the Master is successfully received. An "exception" reply is sent when the command received from the Master is not supported or some error has occurred.

Masters can also send so-called broadcast requests to all Slaves. Broadcast requests are processed by all Slaves they reach. Slaves never reply to broadcast requests.

Slave IDs

Each Modbus Slave in a Modbus system is assigned a unique ID. Allowed ID numbers are from 1 to 247. ID number 0 is used for broadcasting the same request to all available Slaves. ID numbers 248 through 255 are reserved and should not be used. Whenever a Master sends a request, this request includes the ID of the intended recipient (or 0 if the Master is sending a broadcast message). Modbus Masters do not have IDs.

Bridging Together Modbus RTU, Modbus ASCII, and Modbus TCP Devices

Tibbo Modbus Gateways allow Modbus RTU, Modbus ASCII, and Modbus TCP devices to talk to each other.

Achieving this goal requires our Modbus Gateways to seamlessly route Modbus messages between these three types of Modbus devices. Tibbo Modbus Gateways provide several routing methods and configuration parameters (settings) defining the handling of Modbus messages as they pass through the Gateways.