Electronic devices communicate with each other by using a language that is termed as Modbus. Truly speaking, it is a communication protocol or messaging structure, which is not the language itself but the method of communication. Devices that are connected to the same network can communicate with its help. This is widely perceived in SCADA systems where the communication between the remote computer and the RTUs are performed by it. Since the computer, which can be a PC touch screen, is seeking information from the RTUs, the computer is the Master and the RTUs that supply the information are considered Slaves. Indeed, this is what has been laid down in the protocol. There can be only a single master that has the ability to look after 247 slaves. Being the Master, it can command the Slaves through written information to the salves that have to act accordingly.
RS-485 – Modbus RTU
Things are likely to get a bit technical but don’t worry, it will be simplified as much as possible. RTU is the most popularly used network that has a Master and a single or many slaves but not more than 247. Each slave is designated by a unit number that corresponds to a unique device address of 8 bit. The Master sends information packets that bear the Slave’s address for whom it is meant. As soon as the packet reaches the slave, after verifying the address, it is its turn to respond but within a specified time. If no response is received by the master within that time it considers the activity as a no-response error.
What are registers?
The information exchange that comprises of writing and reading data is compiled in 16 bit data pieces which are known as registers. The register is usually a 16 bit integer that may or may not be signed. If a floating point of 32 bit integer is required it is obtained by combining two registers. The values are read in the form of a pair of registers. The Holding Register is most commonly used or writing as well as reading. There is another read-only register named Input Register.
What are coils?
Coils and discrete input are registers but with exceptions to the standard 16 bit registers because these are of a single bit only. Discrete inputs are read-only type while coils can both be read and written. Coils are normally related to relay outputs. The types of registers to be included in a system depend on the manufacturer.
The function code is responsible in determining which type of register is being addressed by a specific Modbus request. “Read holding registers” is denoted by the numerical code 3 and 1 denotes “may read”. To write a “single holding register” you have to use 6 as the function code. For writing one or more holding registers function code 16 has to be used.
A Modbus RTU (RS 485) can have one Master only and if the gateway is the Master, you can have one gateway only.