Inspiration

When an industrial machine will not start, the reason may be hidden across multiple PLC programs and interlocks. Engineers often need to trace conditions manually. We wanted to make those connections easier to inspect without relying on an AI model to guess the control logic.

What it does

Interlock Tracer helps explain why a PLC output is blocked. It reads a supported subset of Structured Text and a snapshot of input values, then shows the contributing conditions and their paths through the logic.

The project can also search for tags in English or German, show which outputs may be affected by a tag, and compare dependencies between two project versions.

If missing values or unsupported logic prevent a conclusion, the tool reports that the result is incomplete instead of guessing.

How we built it

We built Interlock Tracer in Python using Relate as an embedded graph database. Tags, logic gates, PLC rungs, and snapshots are represented as connected graph elements. Relate's full-text search and bounded graph traversal help find tags and trace dependencies.

A deterministic evaluator handles Boolean logic and generates evidence paths. A self-contained Cytoscape.js viewer displays those paths. The project also offers read-only MCP tools and an optional Claude interface for explaining tool results.

The included demo runs offline without an API key after installation.

Challenges and what we learned

PLC logic can contain cycles and self-holding conditions. We needed a clear rule for evaluating those cases without infinite recursion. We also learned that listing every upstream tag is not enough: an explanation must show how the observed conditions contribute to the current result.

Testing and limitations

The repository includes automated tests and synthetic example scenarios. These demonstrate the prototype's behavior but are not validation in a real industrial environment.

The project supports a Boolean subset of Structured Text. It does not connect to a live PLC and is not a certified safety system.

AI and third-party tools

Claude Code and OpenAI Codex assisted with development and review. Claude is optional at runtime and is used to explain tool results; the verdict is computed by deterministic code.

Third-party tools include Relate, Cytoscape.js, the MCP SDK, and the Anthropic SDK.

Built With

  • cypher
  • cytoscape.js
  • python
  • relate
Share this project:

Updates

Submission history