Skip to content
Merged
Show file tree
Hide file tree
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
26 changes: 13 additions & 13 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ PyModbus - A Python Modbus Stack
.. image:: https://github.com/riptideio/pymodbus/actions/workflows/ci.yml/badge.svg?branch=dev
:target: https://github.com/riptideio/pymodbus/actions/workflows/ci.yml
.. image:: https://badges.gitter.im/Join%20Chat.svg
:target: https://gitter.im/pymodbus_dev/Lobby
:target: https://gitter.im/pymodbus_dev/Lobby
.. image:: https://readthedocs.org/projects/pymodbus/badge/?version=latest
:target: https://pymodbus.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pepy.tech/badge/pymodbus
:target: https://pepy.tech/project/pymodbus
:target: https://pepy.tech/project/pymodbus
:alt: Downloads

------------------------------------------------------------
Supported versions
------------------------------------------------------------
Expand Down Expand Up @@ -87,7 +87,7 @@ base operating system will allow (*allow* in this case means how many Virtual IP

For more information please browse the project documentation:

https://riptideio.github.io/pymodbus/
https://riptideio.github.io/pymodbus/
or
https://readthedocs.org/docs/pymodbus/en/latest/index.html

Expand All @@ -97,8 +97,8 @@ Example Code

For those of you that just want to get started fast, here you go::

from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient

client = ModbusTcpClient('127.0.0.1')
client.write_coil(1, True)
result = client.read_coils(1,1)
Expand Down Expand Up @@ -134,7 +134,7 @@ If you think, that something in the code is broken/not running well, please `ope
------------------------------------------------------------
Pymodbus REPL (Read Evaluate Print Loop)
------------------------------------------------------------
Pymodbus REPL comes with many handy features such as payload decoder
Pymodbus REPL comes with many handy features such as payload decoder
to directly retrieve the values in desired format and supports all
the diagnostic function codes directly .

Expand All @@ -158,7 +158,7 @@ This will install a base version of pymodbus.
To install pymodbus with options run:

pip install -U pymodbus[<option>,...]

Available options are:

- **repl**, installs pymodbus REPL.
Expand All @@ -181,8 +181,8 @@ Otherwise you can pull the trunk source and install from there::
git clone git://github.com/riptideio/pymodbus.git
cd pymodbus
pip install -r requirements.txt


To get latest release (for now v2.5.3 with Python 2.7 support)::

git checkout master
Expand All @@ -193,12 +193,12 @@ To get bleeding edge::

To get a specific version:

git checkout tags/vX.Y.Z -b vX.Y.Z
git checkout tags/vX.Y.Z -b vX.Y.Z

Then::
pip install -r requirements.txt
pip install -e .

This installs pymodbus in your virtual environment with pointers directly to the pymodbus directory, so any change you make is immediately available as if installed.

Either method will install all the required dependencies
Expand All @@ -212,7 +212,7 @@ The repository contains a number of important branches and tags.
* **master** is where are releases are kept.
* All releases are tagged with **vX.Y.Z** (e.g. v2.5.3)
* All prereleases are tagged with **vX.Y.ZrcQ** (e.g. v3.0.0.0rc1)

If a maintenance release of an old version is needed (e.g. v2.5.4),
the release tag is used to create a branch with the same name,
and maintenance development is merged here.
Expand Down
34 changes: 0 additions & 34 deletions doc/source/library/pymodbus.client.asynchronous.rst

This file was deleted.

78 changes: 64 additions & 14 deletions doc/source/library/pymodbus.client.rst
Original file line number Diff line number Diff line change
@@ -1,32 +1,82 @@
pymodbus\.client package
========================

Pymodbus offers a :mod:`synchronous client <pymodbus.client.sync>`, and async clients based on :mod:`asyncio <pymodbus.client.asynchronous>`.
Pymodbus offers a :mod:`synchronous client <pymodbus.client>`, and async clients based on :mod:`asyncio <pymodbus.client.asynchronous>`.

Each client shares a :mod:`common client mixin <pymodbus.client.common>` which offers simple methods for reading and writing.
Each client shares a :mod:`client mixin <pymodbus.client.helper_sync>` which offers simple methods for reading and writing.

Subpackages
-----------
Submodules
----------

.. toctree::
pymodbus\.client\.helper_sync module
------------------------------------

pymodbus.client.asynchronous
.. automodule:: pymodbus.client.helper_sync
:members:
:undoc-members:
:show-inheritance:

Submodules
----------
pymodbus\.client\.ModbusSerialClient module
-------------------------------------------

pymodbus\.client\.common module
-------------------------------
.. automodule:: pymodbus.client.sync_serial
:members:
:undoc-members:
:show-inheritance:

.. automodule:: pymodbus.client.common
pymodbus\.client\.ModbusTCPClient module
----------------------------------------

.. automodule:: pymodbus.client.sync_tcp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.sync module
-----------------------------
pymodbus\.client\.ModbusTLSClient module
----------------------------------------

.. automodule:: pymodbus.client.sync_tls
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.ModbusUDPClient module
----------------------------------------

.. automodule:: pymodbus.client.sync_udp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.AsyncModbusUDPClient module
---------------------------------------------

.. automodule:: pymodbus.client.async_udp
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.AsyncModbusTLSClient module
---------------------------------------------

.. automodule:: pymodbus.client.async_tls
:members:
:undoc-members:
:show-inheritance:

pymodbus\.client\.AsyncModbusSerialClient module
------------------------------------------------

.. automodule:: pymodbus.client.async_serial
:members:
:undoc-members:
:show-inheritance:


pymodbus\.client\.AsyncModbusTCPClient module
---------------------------------------------

.. automodule:: pymodbus.client.sync
.. automodule:: pymodbus.client.async_tcp
:members:
:undoc-members:
:show-inheritance:
10 changes: 6 additions & 4 deletions examples/client_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
# --------------------------------------------------------------------------- #
# import the various client implementations
# --------------------------------------------------------------------------- #
from pymodbus.client.asynchronous.serial import AsyncModbusSerialClient
from pymodbus.client.asynchronous.tcp import AsyncModbusTCPClient
from pymodbus.client.asynchronous.tls import AsyncModbusTLSClient
from pymodbus.client.asynchronous.udp import AsyncModbusUDPClient
from pymodbus.client import (
AsyncModbusUDPClient,
AsyncModbusTLSClient,
AsyncModbusSerialClient,
AsyncModbusTCPClient,
)
from pymodbus.transaction import (
ModbusAsciiFramer,
ModbusBinaryFramer,
Expand Down
2 changes: 1 addition & 1 deletion examples/client_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# --------------------------------------------------------------------------- #
# import the various client implementations
# --------------------------------------------------------------------------- #
from pymodbus.client.sync import (
from pymodbus.client import (
ModbusSerialClient,
ModbusTcpClient,
ModbusTlsClient,
Expand Down
2 changes: 1 addition & 1 deletion examples/common/changing_framers.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# --------------------------------------------------------------------------- #
# import the modbus client and the framers
# --------------------------------------------------------------------------- #
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.client import ModbusTcpClient as ModbusClient
from pymodbus.transaction import ModbusSocketFramer as ModbusFramer

# from pymodbus.transaction import ModbusRtuFramer as ModbusFramer
Expand Down
2 changes: 1 addition & 1 deletion examples/common/custom_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import struct

from pymodbus.bit_read_message import ReadCoilsRequest
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.client import ModbusTcpClient as ModbusClient

# --------------------------------------------------------------------------- #
# import the various server implementations
Expand Down
2 changes: 1 addition & 1 deletion examples/common/payload_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from collections import OrderedDict
import logging

from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.client import ModbusTcpClient as ModbusClient
from pymodbus.constants import Endian
from pymodbus.payload import BinaryPayloadBuilder, BinaryPayloadDecoder

Expand Down
2 changes: 1 addition & 1 deletion examples/common/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from threading import Lock, Thread as tWorker
from time import time

from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient

try:
from multiprocessing import Process as mWorker, log_to_stderr
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/asynchronous_asyncio_modbus_tls_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
import ssl
import asyncio

from pymodbus.client.asynchronous.tls import AsyncModbusTLSClient
from pymodbus.client import AsyncModbusTLSClient

# -------------------------------------------------------------------------- #
# the TLS detail security can be set in SSLContext which is the context here
Expand Down
4 changes: 2 additions & 2 deletions examples/contrib/concurrent_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
# -------------------------------------------------------------------------- #
# import necessary modbus libraries
# -------------------------------------------------------------------------- #
from pymodbus.client.common import ModbusClientMixin
from pymodbus.client.helper_sync import ModbusClientMixin

# -------------------------------------------------------------------------- #
# configure the client logging
Expand Down Expand Up @@ -234,7 +234,7 @@ def execute_silently(self, request):


if __name__ == "__main__":
from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient

def client_factory():
"""Client factory."""
Expand Down
6 changes: 3 additions & 3 deletions examples/contrib/deviceinfo_showcase_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,16 @@
# --------------------------------------------------------------------------- #
# import the various server implementations
# --------------------------------------------------------------------------- #
from pymodbus.client.sync import ModbusTcpClient as ModbusClient
from pymodbus.client import ModbusTcpClient as ModbusClient
from pymodbus.device import ModbusDeviceIdentification

# --------------------------------------------------------------------------- #
# import the request
# --------------------------------------------------------------------------- #
from pymodbus.mei_message import ReadDeviceInformationRequest

# from pymodbus.client.sync import ModbusUdpClient as ModbusClient
# from pymodbus.client.sync import ModbusSerialClient as ModbusClient
# from pymodbus.client import ModbusUdpClient as ModbusClient
# from pymodbus.client import ModbusSerialClient as ModbusClient


# --------------------------------------------------------------------------- #
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/libmodbus_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
WriteMultipleCoilsResponse,
WriteSingleCoilResponse,
)
from pymodbus.client.common import ModbusClientMixin
from pymodbus.client.helper_sync import ModbusClientMixin
from pymodbus.constants import Defaults
from pymodbus.exceptions import ModbusException
from pymodbus.register_read_message import (
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/modbus_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from modbus_mapper import csv_mapping_parser
from modbus_mapper import mapping_decoder
from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient
from pymodbus.payload import BinaryModbusDecoder

template = ["address", "size", "function", "name", "description"]
Expand Down
2 changes: 1 addition & 1 deletion examples/contrib/modbus_tls_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# -------------------------------------------------------------------------- #
import ssl

from pymodbus.client.sync import ModbusTlsClient
from pymodbus.client import ModbusTlsClient

# -------------------------------------------------------------------------- #
# the TLS detail security can be set in SSLContext which is the context here
Expand Down
2 changes: 1 addition & 1 deletion examples/modbus_forwarder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import argparse
import logging

from pymodbus.client.sync import ModbusTcpClient
from pymodbus.client import ModbusTcpClient
from pymodbus.server.sync import StartTcpServer
from pymodbus.datastore import ModbusServerContext
from pymodbus.datastore.remote import RemoteSlaveContext
Expand Down
27 changes: 26 additions & 1 deletion pymodbus/client/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,26 @@
"""Initialize client."""
"""Initialize client.

import external classes, to make them easier to use:
"""
from pymodbus.client.async_udp import AsyncModbusUDPClient
from pymodbus.client.async_tls import AsyncModbusTLSClient
from pymodbus.client.async_serial import AsyncModbusSerialClient
from pymodbus.client.async_tcp import AsyncModbusTCPClient
from pymodbus.client.sync_serial import ModbusSerialClient
from pymodbus.client.sync_tcp import ModbusTcpClient
from pymodbus.client.sync_tls import ModbusTlsClient
from pymodbus.client.sync_udp import ModbusUdpClient

# ---------------------------------------------------------------------------#
# Exported symbols
# ---------------------------------------------------------------------------#
__all__ = [
"AsyncModbusUDPClient",
"AsyncModbusTLSClient",
"AsyncModbusSerialClient",
"AsyncModbusTCPClient",
"ModbusSerialClient",
"ModbusTcpClient",
"ModbusTlsClient",
"ModbusUdpClient",
]
Loading