Skip to main content

SLMP Connect Python: client library for Mitsubishi SLMP binary communication

Project description

CI Documentation PyPI Python 3.10+ License: MIT Static Analysis: Ruff

SLMP Protocol for Python

Illustration

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:

  • SlmpConnectionOptions
  • open_and_connect / open_and_connect_sync
  • AsyncSlmpClient
  • QueuedAsyncSlmpClient
  • SlmpClient
  • normalize_address
  • read_typed / write_typed
  • read_words_single_request / read_dwords_single_request
  • read_words_chunked / read_dwords_chunked
  • write_bit_in_word
  • read_named / write_named
  • poll

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 targets
  • plc_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

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

slmp_connect_python-0.1.6.tar.gz (109.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

slmp_connect_python-0.1.6-py3-none-any.whl (86.8 kB view details)

Uploaded Python 3

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

Hashes for slmp_connect_python-0.1.6.tar.gz
Algorithm Hash digest
SHA256 1bd1d71ffe52254580320d04109287bf2d63435fd1d01e32c60aaa72d09d898d
MD5 9a7b0031c97a6c997fef5aa49c3c9000
BLAKE2b-256 9bd934d2a8e68e40f7f55fb8a0fda270ed16be662ee0cb46bfec10bafdca6bf3

See more details on using hashes here.

File details

Details for the file slmp_connect_python-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for slmp_connect_python-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9a9dee436fd815984e01c27fe4c5e304bbffa3dc664d4f65c7ab3dd1e77378ff
MD5 adfda9e1296fb176a68e6f5313c57a1c
BLAKE2b-256 343d73a4eed7dd7aa2f2a03ca03ded4906546e2a51d76d37e7929776540fa948

See more details on using hashes here.

Supported by

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