|
| 1 | +# plcviz |
| 2 | + |
| 3 | +PLC code visualization tool - generate SVG diagrams from L5X (Rockwell) and PLCopen XML (IEC 61131-3) files. |
| 4 | + |
| 5 | +## Example Output |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | +## Features |
| 10 | + |
| 11 | +- **Structure graphs**: Program/POU containment hierarchy |
| 12 | +- **Call graphs**: Function/FB call relationships |
| 13 | +- **DataType dependency graphs**: UDT nesting relationships (PLCopen) |
| 14 | +- **Multiple formats**: L5X (Rockwell) and PLCopen XML (Siemens, CODESYS, Beckhoff, B&R) |
| 15 | +- **Multiple export types**: Controller, Program, and AOI exports (L5X) |
| 16 | + |
| 17 | +## Supported Formats |
| 18 | + |
| 19 | +### L5X (Rockwell Automation) |
| 20 | +- Logix5000 / Studio 5000 exports (.L5X) |
| 21 | +- ControlLogix, CompactLogix, SoftLogix platforms |
| 22 | + |
| 23 | +### PLCopen XML (IEC 61131-3 TC6) |
| 24 | +- Siemens TIA Portal |
| 25 | +- CODESYS |
| 26 | +- Beckhoff TwinCAT |
| 27 | +- B&R Automation Studio |
| 28 | +- Beremiz |
| 29 | +- Any IEC 61131-3 compliant tool |
| 30 | + |
| 31 | +## Installation |
| 32 | + |
| 33 | +```bash |
| 34 | +cargo install --path . |
| 35 | +``` |
| 36 | + |
| 37 | +## Usage |
| 38 | + |
| 39 | +```bash |
| 40 | +# Generate structure graph (default) |
| 41 | +plcviz project.L5X > structure.svg |
| 42 | +plcviz project.xml > structure.svg # PLCopen |
| 43 | + |
| 44 | +# Generate call graph |
| 45 | +plcviz -t call project.L5X > calls.svg |
| 46 | + |
| 47 | +# Generate combined graph (structure + calls) |
| 48 | +plcviz -t combined project.L5X > combined.svg |
| 49 | + |
| 50 | +# DataType dependency graph (PLCopen only) |
| 51 | +plcviz -t dataflow project.xml > datatypes.svg |
| 52 | + |
| 53 | +# Include AOIs in the graph (L5X only) |
| 54 | +plcviz -a project.L5X > with_aois.svg |
| 55 | + |
| 56 | +# Generate example graph (no file needed) |
| 57 | +plcviz example > example.svg |
| 58 | +``` |
| 59 | + |
| 60 | +## Graph Types |
| 61 | + |
| 62 | +| Type | L5X Support | PLCopen Support | Description | |
| 63 | +|------|------------|-----------------|-------------| |
| 64 | +| `structure` | ✅ | ✅ | Containment hierarchy (Programs/POUs) | |
| 65 | +| `call` | ✅ | ✅ | Function/FB call relationships | |
| 66 | +| `dataflow` | ⚠️ (example) | ✅ | Tag relationships / DataType dependencies | |
| 67 | +| `combined` | ✅ | ✅ | Structure + call edges | |
| 68 | + |
| 69 | +## Supported Export Types |
| 70 | + |
| 71 | +### L5X |
| 72 | +- **Controller**: Full project exports (multiple programs) |
| 73 | +- **Program**: Single program exports |
| 74 | +- **AddOnInstructionDefinition**: AOI exports with internal routines |
| 75 | + |
| 76 | +### PLCopen |
| 77 | +- **Project**: Full project with POUs (programs, functions, function blocks) |
| 78 | +- **DataTypes**: User-defined types and structures |
| 79 | + |
| 80 | +## Format Detection |
| 81 | + |
| 82 | +plcviz automatically detects the file format: |
| 83 | +- PLCopen: Detected by `<project xmlns="http://www.plcopen.org/xml/tc6...">` |
| 84 | +- L5X: All other XML files |
| 85 | + |
| 86 | +## License |
| 87 | + |
| 88 | +MIT |
0 commit comments