Skip to main content

A Python3 MODBUS TCP server for testing purposes

Project description

modbus-tcp-server

PyPI PyPI version PyPI Wheel

A thread-based MODBUS TCP server for testing purposes.

Installation

Just type

pip install modbus-tcp-server

And to run it

modbus-tcp-server 127.0.0.1

Just run it without any arguments to see the command line.

Limitations

So far commands 15 (Force Multiple Coils) and 16 (Preset Multiple Registers) are unsupported.

Custom usage

To implement a custom provider ModbusTCPServer, just extend BaseDataSource to provide data of your choosing and launch it that way:

from modbus_tcp_server.network import AcceptThread
from modbus_tcp_server.data_source import BaseDataSource

class CustomDB(BaseDataSource):
    ...

c_db = CustomDB()

at = AcceptThread('0.0.0.0', 502, c_db).start()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

modbus-tcp-server-0.1.tar.gz (7.5 kB view hashes)

Uploaded Source

Built Distributions

modbus_tcp_server-0.1-py3.8.egg (8.1 kB view hashes)

Uploaded Source

modbus_tcp_server-0.1-py2.py3-none-any.whl (9.8 kB view hashes)

Uploaded Python 2 Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page