Data types
Modbus supports four "objects";
- Coils
- Discrete inputs
- Input registers
- Holding registers
In the old Modicon specification, each object was bound to a particular address range. With the newer address standard, the full range is available to each object and the object type is determined by the specific commands to read and write.
| Object type | Access | Size | Modicon Address Space | New Address Space |
|---|---|---|---|---|
| Coil | Read/Write | 1 bit | 00001 to 09999 | 0 to 65535 |
| Discrete input | Read | 1 bit | 10001 to 19999 | 0 to 65535 |
| Input register | Read | 16 bits | 30001 to 39999 | 0 to 65535 |
| Holding register | Read/Write | 16 bits | 40001 to 49999 | 0 to 65535 |
Table of Content
Scaling of values
A scale (factor) is used to transform a decimal value into an integer value by multiplying it with that value. This is often required as simple computers are often bad at handling decimal values. As a result, we lose the decimal part when converting a decimal value to an integer value.
For example, if the value 3.1415 is to be managed in such a way, it can be scaled using 10, 100, 1000 or even 10000. Giving us the integer values; 31, 314, 3141 or 31415.
These integer values can then be transmitted to a more intelligent computer, where they are divided by the same factor to produce a decimal value once more.
Remember that the scale factor decides how many decimals are retained once converted back to a decimal value.