Skip to content

Releases: AcaysiaChem/aslmp

aslmp 0.2.0

Choose a tag to compare

@aiast1 aiast1 released this 27 Sep 07:51

A stability and quality-of-life release. Still alpha, still exercised against exactly one CPU: MELSEC iQ-F FX5U-32MT/DS, firmware 1.065.

Read this first

This library writes to industrial control equipment. It is not a safety system, carries no SIL or PL rating, and has not been certified or assessed by anyone. Interlocks and anything a person's safety depends on belong in the PLC program and in hardware. Warranty and liability are governed by Apache-2.0 §7–8. SLMP has no authentication, encryption or integrity protection — see SECURITY.md.

New

  • aslmp status and Plc.read_diagnostics() — the CPU's state, its error flag, the latest error code and when it was stamped, and its clock, in one request, so every line describes the same instant. aslmp probe tells you a connection is served; status tells you whether the CPU behind it is reporting a fault. When the error code is also an SLMP end code, it says so — on this CPU a client's bad request lights the same flag a hardware fault does. iQ-F only for the error half; other families get RUN/STOP.
  • Python 3.14, tested in CI on Linux, macOS and Windows beside 3.11–3.13, and CI now also runs weekly with nothing pushed.

Fixed

  • Closing a client while a read is waiting now ends that read at once with SlmpConnectionClosedError. On Linux it used to wait out the whole timeout and then blame the PLC for not answering (measured; macOS uses the same kind of event loop and is expected to have done the same). A write in flight is still reported as outcome unknown, never as not sent.
  • A deliberate close is no longer counted as a failure — it is transactions_abandoned — and no longer emits ConnectionFailed, so a Supervisor doesn't try to reconnect a client you shut down on purpose.
  • aclose() during connect() now stays closed instead of the client coming back to READY.
  • Pipelined UDP no longer leaks its read lock on a badly timed cancel, which used to make every read after a reconnect time out.
  • LatencyRecorder was documented as "allocates nothing"; what it guarantees, and what is now tested on every interpreter, is that it retains nothing.

Everything here was reviewed before release by two reviewers told to prove findings rather than assert them. They found nine; all nine are fixed, each with a test confirmed to fail against the code before the fix. Full detail in CHANGELOG.md.

Install

pip install --upgrade aslmp

One package, no dependencies. Python 3.11–3.14 on Linux, macOS or Windows.

aslmp 0.1.0

Choose a tag to compare

@aiast1 aiast1 released this 25 Sep 12:46

An async SLMP / MC Protocol client for Mitsubishi MELSEC PLCs. Pure Python, zero runtime dependencies, typed throughout.

Read this first

This library writes to industrial control equipment. It is not a safety system, carries no SIL or PL rating, and has not been certified or assessed by anyone. Interlocks and anything a person's safety depends on belong in the PLC program and in hardware — never in a Python process on the other end of a network. Warranty and liability are governed by Apache-2.0 §7–8.

SLMP itself has no authentication, no encryption and no integrity protection. Reaching the port is the authorization, outputs included. See SECURITY.md.

What "alpha" means here

It has been exercised against exactly one CPU: MELSEC iQ-F FX5U-32MT/DS, firmware 1.065. Every device table, limit and end code in it is a statement about that CPU on the date recorded beside it. iQ-R, Q and L profiles are built from the manuals and are not silicon-verified.

If your CPU disagrees with a table, that is the report this project most wants — there is an issue template for it.

Install

pip install aslmp

Python 3.11, 3.12 or 3.13, on Linux, macOS or Windows. CI runs all nine.

Highlights

  • TCP and UDP, binary and ASCII coding, 3E and 4E frames.
  • A failed transaction raises. Nothing retries, clamps, substitutes a default or hands back a stale value. If it cannot do the thing, it says so.
  • Per-transaction latency as data — queue, encode, round trip, transfer and decode, each attributable.
  • The one-transaction-per-connection rule of this hardware is made inexpressible, not merely documented: two TCP requests in flight return one response for the wrong request with end code 0x0000.
  • X and Y are octal on iQ-F and hexadecimal on iQ-R, and both CPUs answer 0x0000 either way — so host and profile are both required and there is no generic fallback.
  • A conformance simulator ships in the package, so tests run without a PLC.
  • No CLI path reaches remote RUN, STOP, PAUSE, RESET or Latch Clear, and an AST test enforces it.

Full detail in CHANGELOG.md.