client.async — Twisted Async Modbus Client

Module author: Galen Collins <>

Section author: Galen Collins <>

API Documentation

Implementation of a Modbus Client Using Twisted

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)
class pymodbus.client.async.ModbusClientProtocol(framer=None)

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

class pymodbus.client.async.ModbusClientFactory

Simple client protocol factory


alias of ModbusClientProtocol