register_write_message
— Register Write Messages¶
API Documentation¶
Register Writing Request/Response Messages¶
-
class
pymodbus.register_write_message.
WriteSingleRegisterRequest
(address=None, value=None, **kwargs)[source]¶ This function code is used to write a single holding register in a remote device.
The Request PDU specifies the address of the register to be written. Registers are addressed starting at zero. Therefore register numbered 1 is addressed as 0.
-
__init__
(address=None, value=None, **kwargs)[source]¶ Initializes a new instance
Parameters: - address – The address to start writing add
- value – The values to write
-
decode
(data)[source]¶ Decode a write single register packet packet request
Parameters: data – The request to decode
-
execute
(context)[source]¶ Run a write single register request against a datastore
Parameters: context – The datastore to request from Returns: An initialized response, exception message otherwise
-
-
class
pymodbus.register_write_message.
WriteSingleRegisterResponse
(address=None, value=None, **kwargs)[source]¶ The normal response is an echo of the request, returned after the register contents have been written.
-
__init__
(address=None, value=None, **kwargs)[source]¶ Initializes a new instance
Parameters: - address – The address to start writing add
- value – The values to write
-
-
class
pymodbus.register_write_message.
WriteMultipleRegistersRequest
(address=None, values=None, **kwargs)[source]¶ This function code is used to write a block of contiguous registers (1 to approx. 120 registers) in a remote device.
The requested written values are specified in the request data field. Data is packed as two bytes per register.
-
__init__
(address=None, values=None, **kwargs)[source]¶ Initializes a new instance
Parameters: - address – The address to start writing to
- values – The values to write
-
decode
(data)[source]¶ Decode a write single register packet packet request
Parameters: data – The request to decode
-
-
class
pymodbus.register_write_message.
WriteMultipleRegistersResponse
(address=None, count=None, **kwargs)[source]¶ “The normal response returns the function code, starting address, and quantity of registers written.
-
__init__
(address=None, count=None, **kwargs)[source]¶ Initializes a new instance
Parameters: - address – The address to start writing to
- count – The number of registers to write to
-