remote — Remote Slave Context

API Documentation

class pymodbus.datastore.remote.RemoteSlaveContext(client)[source]

TODO This creates a modbus data model that connects to a remote device (depending on the client used)

__init__(client)[source]

Initializes the datastores

Parameters:client – The client to retrieve values with
reset()[source]

Resets all the datastores to their default values

validate(fx, address, count=1)[source]

Validates the request to make sure it is in range

Parameters:
  • fx – The function we are working with
  • address – The starting address
  • count – The number of values to test
Returns:

True if the request in within range, False otherwise

getValues(fx, address, count=1)[source]

Validates the request to make sure it is in range

Parameters:
  • fx – The function we are working with
  • address – The starting address
  • count – The number of values to retrieve
Returns:

The requested values from a:a+c

setValues(fx, address, values)[source]

Sets the datastore with the supplied values

Parameters:
  • fx – The function we are working with
  • address – The starting address
  • values – The new values to be set
__str__()[source]

Returns a string representation of the context

Returns:A string representation of the context
_RemoteSlaveContext__build_mapping()

A quick helper method to build the function code mapper.

_RemoteSlaveContext__extract_result(fx, result)

A helper method to extract the values out of a response. TODO make this consistent (values?)