Metadata-Version: 2.1
Name: modbus-tcp-server
Version: 0.1
Summary: A Python3 MODBUS TCP server for testing purposes
Home-page: https://github.com/smok-serwis/modbus-tcp-server
Author: Piotr Maślanka
Author-email: pmaslanka@smok.co
License: UNKNOWN
Project-URL: Code, https://github.com/smok-serwis/modbus-tcp-server
Project-URL: Issue tracker, https://github.com/smok-serwis/modbus-tcp-server/issues
Platform: UNKNOWN
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3.6
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
Classifier: Operating System :: POSIX
Classifier: Operating System :: OS Independent
Classifier: Development Status :: 5 - Production/Stable
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Software Development :: Libraries
Requires-Python: !=2.7.*,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,!=3.5.*
Description-Content-Type: text/markdown; charset=UTF-8
Requires-Dist: satella

# modbus-tcp-server

[![PyPI](https://img.shields.io/pypi/pyversions/smok.svg)](https://pypi.python.org/pypi/smok)
[![PyPI version](https://badge.fury.io/py/smok.svg)](https://badge.fury.io/py/smok)
[![PyPI](https://img.shields.io/pypi/implementation/smok.svg)](https://pypi.python.org/pypi/smok)
[![Wheel](https://img.shields.io/pypi/wheel/smok.svg)](https://pypi.org/project/smok/)


A thread-based MODBUS TCP server for testing purposes.

# Installation

Just type 

```bash
pip install modbus-tcp-server
```

And to run it

```bash
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](modbus_tcp_server/data_source/base.py) 
to provide data of your choosing and launch it that way: 

```python
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()
```


