Module author: Galen Collins <bashwork@gmail.com>
Section author: Galen Collins <bashwork@gmail.com>
Example Run:
from pymodbus.client.async import ModbusClientFactory
from pymodbus.bit_read_message import ReadCoilsRequest
def clientTest():
requests = [ ReadCoilsRequest(0,99) ]
p = reactor.connectTCP("localhost", 502, ModbusClientFactory(requests))
if __name__ == "__main__":
reactor.callLater(1, clientTest)
reactor.run()
This represents the base modbus client protocol. All the application layer code is deferred to a higher level wrapper.
Called upon a client disconnect
Called upon a successful client connection.
Get response, check for valid message, decode result
Parameters: | data – The data returned from the server |
---|
Starts the producer to send the next request to consumer.write(Frame(request))
Simple client protocol factory
alias of ModbusClientProtocol