3 Product Overview
SMA Solar Technology AG
Technical Information 9SMAModbus-ennexOS-TI-en-10
3.4.4 Reading and Writing of Data
The Modbus interface can be used via the protocol Modbus TCP. Using Modbus TCP enables read and write access
to the Modbus register. SMA products with Modbus interface use the Modbus TCP as standard.
Access type Explanation
RO (Read-Only) Read only
RW (Read-Write) Read and write
The following Modbus commands are supported by the implemented Modbus interface:
Modbus command Hexadecimal value Data volume (number of
registers)
1)
Read Holding Registers 0x03 1 to 125
Read Input Registers 0x04 1 to 125
Write Single Register 0x06 1
Write Multiple Registers 0x10 1 to 123
Read Write Multiple Registers 0x17 Read: 1 to 125, Write: 1 to 121
Error messages on reading or writing individual Modbus registers
If a Modbus register is accessed, which is not contained in a Modbus profile, or if a Modbus command is incorrect, a
Modbus exception is generated. Modbus exceptions are also generated when write access occurs on a read-only
Modbus register or read access occurs on a write-only Modbus register.
Reading or writing of data blocks
To prevent inconsistencies, data blocks of associated Modbus registers or Modbus register ranges must be read or
written consecutively. The 4 bytes of a 64-bit Modbus register must be read, for example, with an operation in a 64-bit
SMA data type (Read Multiple Registers).
Reading multiple Modbus registers as a data block
If a data block is read and if at least one register defined in the Modbus profile can be determined in its data range,
an answer is returned. If this data block also contains Modbus registers that are not defined in the Modbus profile,
NaN is used for the query values in each case. If none of the Modbus registers are defined in the data range of a
data block in the Modbus profile, the query is invalid, and a Modbus exception is generated.
Error message on writing multiple Modbus registers as a data block
If multiple registers are written in the data block (Modbus command 0x10 and 0x17) and an error occurs when
writing, the process continues with the next register in the data block. If some data is dependent on other data, or if
some data is mutually exclusive, the data is only processed if the entire data block is valid. Otherwise the entire data
block is discarded. In the event of an error, a Modbus exception will be generated.
Modbus exceptions
For Modbus exceptions, see "Modbus Application Protocol Specification" at http://www.modbus.org/specs.php.
1)
Number of Modbus registers transferable as a data block per command (16 bit)