Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions doc/source/client.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ is done in a few simple steps, like the following synchronous example::

and a asynchronous example::

from pymodbus.client import ModbusAsyncTcpClient
from pymodbus.client import AsyncModbusTcpClient

client = ModbusAsyncTcpClient('MyDevice.lan') # Create client object
client = AsyncModbusTcpClient('MyDevice.lan') # Create client object
await client.connect() # connect to device, reconnect automatically
await client.write_coil(1, True, slave=1) # set information in device
result = await client.read_coils(2, 3, slave=1) # get information from device
print(result.bits[0]) # use information
client.close() # Disconnect device

The line :mod:`client = ModbusAsyncTcpClient('MyDevice.lan')` only creates the object it does not activate
The line :mod:`client = AsyncModbusTcpClient('MyDevice.lan')` only creates the object it does not activate
anything.

The line :mod:`await client.connect()` connects to the device (or comm port), if this cannot connect successfully within
Expand Down