Skip to content

Commit 6bbf697

Browse files
committed
Update README.md to enhance feature descriptions and usage examples
1 parent 0b92c08 commit 6bbf697

1 file changed

Lines changed: 41 additions & 13 deletions

File tree

‎plcviz/README.md‎

Lines changed: 41 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,54 @@
11
# plcviz
22

3-
PLC code visualization library for Rust.
3+
PLC code visualization tool - generate SVG diagrams from L5X files.
44

5-
Generate SVG diagrams from L5X files:
6-
- Call graphs (routine → routine)
7-
- Tag dataflow
8-
- AOI dependencies
9-
- Program structure
5+
## Features
6+
7+
- **Structure graphs**: Program → Routine containment hierarchy
8+
- **Call graphs**: JSR (Jump to Subroutine) relationships between routines
9+
- **Combined graphs**: Structure + call edges together
10+
- **Multiple export types**: Controller, Program, and AOI exports
11+
12+
## Installation
13+
14+
```bash
15+
cargo install --path .
16+
```
1017

1118
## Usage
1219

13-
```rust
14-
use l5x::L5xFile;
15-
use plcviz::{CallGraph, SvgRenderer};
20+
```bash
21+
# Generate structure graph (default)
22+
plcviz project.L5X > structure.svg
23+
24+
# Generate call graph
25+
plcviz -t call project.L5X > calls.svg
1626

17-
let project = L5xFile::parse_file("project.l5x")?;
18-
let graph = CallGraph::from_project(&project);
19-
let svg = SvgRenderer::new().render(&graph);
27+
# Generate combined graph (structure + calls)
28+
plcviz -t combined project.L5X > combined.svg
2029

21-
std::fs::write("call_graph.svg", svg)?;
30+
# Include AOIs in the graph
31+
plcviz -a project.L5X > with_aois.svg
32+
33+
# Generate example graph (no L5X file needed)
34+
plcviz example > example.svg
2235
```
2336

37+
## Graph Types
38+
39+
| Type | Description |
40+
|------|-------------|
41+
| `structure` | Containment hierarchy (Programs → Routines) |
42+
| `call` | JSR calls between routines |
43+
| `dataflow` | Tag read/write relationships (example only) |
44+
| `combined` | Structure + call edges |
45+
46+
## Supported L5X Export Types
47+
48+
- **Controller**: Full project exports (multiple programs)
49+
- **Program**: Single program exports
50+
- **AddOnInstructionDefinition**: AOI exports with internal routines
51+
2452
## License
2553

2654
MIT

0 commit comments

Comments
 (0)