Module author: Galen Collins <bashwork@gmail.com>
Section author: Galen Collins <bashwork@gmail.com>
Example Run:
def clientTest():
requests = [ ReadCoilsRequest(0,99) ]
p = reactor.connectTCP("localhost", 502, ModbusClientFactory(requests))
if __name__ == "__main__":
reactor.callLater(1, clientTest)
reactor.run()
This is a simply pull producer that feeds requests to the modbus client
Starts the producer to send the next request to consumer.write(Frame(request))
Inteface for a modbus synchronous client. Defined here are all the methods for performing the related request methods. Derived classes simply need to implement the transport methods and set the correct framer.
Closes the underlying socket connection
Connect to the modbus remote host
Returns: | True if connection succeeded, False otherwise |
---|
Parameters: | request – The request to process |
---|---|
Returns: | The result of the request execution |
Implementation of a modbus tcp client
Closes the underlying socket connection
Connect to the modbus tcp server
Returns: | True if connection succeeded, False otherwise |
---|