remote — Remote Slave Context

API Documentation

class pymodbus.datastore.remote.RemoteSlaveContext(client)

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

_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?)

__init__(client)

Initializes the datastores

Parameters:client – The client to retrieve values with
__str__()

Returns a string representation of the context

Returns:A string representation of the context
getValues(fx, address, count=1)

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

reset()

Resets all the datastores to their default values

setValues(fx, address, values)

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
validate(fx, address, count=1)

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