Modbus Data Formats
Modbus uses the concept of a data table to refer to data. A data table is an array or block of memory used to store data. Data is referenced using data table addresses.
Data Table Types
Modbus data table addresses come in four types:
Discrete Inputs
Represent a single bit (Boolean) which can only be read. In other words, the client can only perform a read action on the discrete inputs.
| Property | Value |
|---|---|
| Size | 1 bit |
| Access | Read-only |
| Typical Use | Physical input states |
Coils
Read-write Boolean values. They are typically used to represent outputs or internal bits which are both read by and written to by the user.
| Property | Value |
|---|---|
| Size | 1 bit |
| Access | Read-write |
| Typical Use | Digital outputs, internal flags |
Input Registers
Read-only 16-bit integers. They are typically used to represent analogue input values and other integer values which are read but not written to by the user.
| Property | Value |
|---|---|
| Size | 16 bits |
| Access | Read-only |
| Typical Use | Analog inputs, counter values |
Holding Registers
Read-write 16-bit integers. They are typically used to represent analogue outputs or internal numbers which are both read by and written to by the user.
| Property | Value |
|---|---|
| Size | 16 bits |
| Access | Read-write |
| Typical Use | Analog outputs, configuration values |
Summary Table
| Data Type | Size | Access | Typical Use |
|---|---|---|---|
| Discrete Input | 1 bit | Read-only | Physical input states |
| Coil | 1 bit | Read-write | Digital outputs, internal flags |
| Input Register | 16 bits | Read-only | Analog inputs, counter values |
| Holding Register | 16 bits | Read-write | Analog outputs, configuration values |