Skip to content
monozukuri-aiPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

gxwlib

Read, analyze and display GX Works2 .gxw projects with a Rust core and a typed Python API.

  • Inspect project metadata and streams, with original source bytes and diagnostics.
  • Decode a subset of simple-ladder instructions and GX Works2 list CSV exports.
  • Find device references, compare instructions and display ladders as SVG or HTML.
  • Inspect Structured Ladder/FBD blocks, connections, FB identities and declarations.
  • Simulate one supported program using an explicit FX3G virtual scan model, including a limited timer/counter subset.

The package is read-only. Unsupported data remains inspectable with diagnostics. Whole-project execution, structured POU execution and GX Simulator2 compatibility are not supported. See the documentation for API-specific limits.

Install from source

Requires CPython 3.13 or later and Rust 1.93. From a source checkout:

python -m pip install .

Building from source requires Rust; using an installed wheel does not. The Python package has no runtime package dependencies. Free-threaded Python and PyPy are not supported.

Inspect a project

import gxwlib

project = gxwlib.load_project("project.gxw")
for index, program in enumerate(project.programs):
    print(index, program.logical_name, program.framing_status)

instructions = gxwlib.decode_program(project, 0, device_profile="fx")
report = gxwlib.analyze(instructions)
print(report.complete)
for finding in report.diagnostics:
    print(finding.code, finding.message)

For structured POUs, use decode_structured(project, index) and render_structured(program). Program indices refer to project.programs.

gxw inspect project.gxw --json
gxw analyze project.gxw --device-profile fx --json
gxw render project.gxw --device-profile fx
gxw render project.gxw --device-profile fx --format html --output ladder.html

Without --output or --format, render starts a local viewer and opens a browser. Use --no-browser to open the printed URL yourself, --port 8000 to choose a port, and Ctrl+C to stop. render-structured uses the same options.

See inspection, instruction decoding, analysis and display, structured POUs, and simulation. Rust entry points are documented alongside the Python APIs; gxw-core is available in the Cargo workspace.

gxwlib is licensed under the MIT License. Third-party components and fixtures retain their own licenses; see LICENSES and the fixture notices.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages