SLMP Connect Python: client library for Mitsubishi SLMP binary communication
Project description
SLMP Protocol for Python
High-level SLMP helpers for Mitsubishi PLC communication over Binary 3E and 4E frames.
This repository treats the high-level helper layer as the recommended user surface:
SlmpConnectionOptionsopen_and_connect/open_and_connect_syncAsyncSlmpClientQueuedAsyncSlmpClientSlmpClientnormalize_addressread_typed/write_typedread_words_single_request/read_dwords_single_requestread_words_chunked/read_dwords_chunkedwrite_bit_in_wordread_named/write_namedpoll
Installation
pip install slmp-connect-python
The latest release lives at https://pypi.org/project/slmp-connect-python/, where wheel and tarball downloads and metadata are available.
Quick Start
Recommended async path:
import asyncio
from slmp import SlmpConnectionOptions, open_and_connect, read_named, write_typed
async def main() -> None:
options = SlmpConnectionOptions(
host="192.168.250.100",
port=1025,
plc_series="iqr",
frame_type="4e",
)
async with await open_and_connect(options) as client:
before = await read_named(client, ["D100", "D200:F", "D50.3"])
print("before:", before)
await write_typed(client, "D100", "U", 42)
after = await read_named(client, ["D100", "D200:F", "D50.3"])
print("after:", after)
asyncio.run(main())
Choose the connection profile explicitly:
plc_series="iqr", frame_type="4e"for iQ-R / iQ-F targetsplc_series="ql", frame_type="3e"for Q / L targets
Supported PLC Registers
Start with these public high-level families first:
- word devices:
D,SD,R,ZR,TN,CN - bit devices:
M,X,Y,SM,B - typed forms:
D200:F,D300:L,D100:S - mixed snapshot forms:
D50.3,D100,D200:F - current-value long families:
LTN,LSTN,LCN
See the full public table in Supported PLC Registers.
Public Documentation
- Getting Started
- Supported PLC Registers
- Latest Communication Verification
- User Guide
- Samples
- Error Codes
Maintainer-only notes and retained evidence live under internal_docs/.
High-Level API Guide
Address Normalization
from slmp import normalize_address
print(normalize_address("x20")) # X20
print(normalize_address("d200")) # D200
Single Typed Values
from slmp import read_typed, write_typed
temperature = await read_typed(client, "D200", "F")
counter = await read_typed(client, "D300", "L")
await write_typed(client, "D100", "U", 1234)
Use .bit notation only with word devices such as D50.3.
Address bit devices directly as M1000, M1001, X20, or Y20.
Development
run_ci.bat
build_docs.bat
release_check.bat
License
Distributed under the MIT License.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file slmp_connect_python-0.1.6.tar.gz.
File metadata
- Download URL: slmp_connect_python-0.1.6.tar.gz
- Upload date:
- Size: 109.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1bd1d71ffe52254580320d04109287bf2d63435fd1d01e32c60aaa72d09d898d
|
|
| MD5 |
9a7b0031c97a6c997fef5aa49c3c9000
|
|
| BLAKE2b-256 |
9bd934d2a8e68e40f7f55fb8a0fda270ed16be662ee0cb46bfec10bafdca6bf3
|
File details
Details for the file slmp_connect_python-0.1.6-py3-none-any.whl.
File metadata
- Download URL: slmp_connect_python-0.1.6-py3-none-any.whl
- Upload date:
- Size: 86.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a9dee436fd815984e01c27fe4c5e304bbffa3dc664d4f65c7ab3dd1e77378ff
|
|
| MD5 |
adfda9e1296fb176a68e6f5313c57a1c
|
|
| BLAKE2b-256 |
343d73a4eed7dd7aa2f2a03ca03ded4906546e2a51d76d37e7929776540fa948
|