English | 日本語
A Rust-based Python package for inspecting KV STUDIO projects, parsing mnemonic files, viewing ladder logic, and simulating basic Boolean logic.
kvstlib reads .mnm files exported by KV STUDIO and preserves instructions, comments,
and source locations. You can inspect device reads and writes and save ladder diagrams
as SVG or standalone HTML. KV STUDIO and Wine are not required at runtime.
| Feature | Scope |
|---|---|
| Project inventory | File names, sizes, and hashes in .kpzx / ZIP, .kpz / LZH, and extracted folders |
| Mnemonic parsing | UTF-16LE .mnm files, instructions, operands, comments, and diagnostics |
| Ladder inspection | Basic contact and output logic, device references, SVG and HTML output |
| Simulation | Basic Boolean logic, SET/RES, state across scans, and instruction traces under an explicit KV-8000 profile |
Decoding instructions from native .kpr, .mod, and .kfb files is not supported.
Use MNM files for ladder analysis and execution. Simulation tests the logic of selected
modules; it does not reproduce timers, function blocks, physical I/O, or execution timing.
See support and limitations for details.
Run this from the root of a source checkout. You need CPython 3.11 or later and Rust to build from source.
python -m pip install .The getting started guide covers virtual environments, build requirements, and creating sample input.
Inspect a Demo.mnm file exported by KV STUDIO:
import kvstlib
program = kvstlib.read_mnemonic("Demo.mnm")
report = kvstlib.analyze(program)
print(report.coverage.analysis)
for device in report.devices:
print(device.key, device.reads, device.writes)
kvstlib.render_ladder(program, output="ladder.html")The same features are available from the CLI:
kvstlib inspect project.kpzx --json
kvstlib mnemonic Demo.mnm --json
kvstlib analyze Demo.mnm --json
kvstlib render Demo.mnm -o ladder.svg
kvstlib simulate Demo.mnm --scenario scenario.jsonsimulate requires initial state, input declarations, and an execution profile.
The simulation example creates an MNM
file and a scenario you can run directly. Modules with unsupported instructions or
unresolved devices are rejected before execution.
kvstlib is MIT licensed. KEYENCE software, manuals, and samples are not included.