# dmroeder/pylogix architecture

> Architecture diagram of the GitHub repository dmroeder/pylogix, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/dmroeder/pylogix
- Repository: https://github.com/dmroeder/pylogix

## Overview

Pylogix is a Python and MicroPython Ethernet/IP communication driver for supported Rockwell Logix PLCs. A user configures a PLC connection, requests tag reads or writes, and receives a Response with tag, value, and status. The README also identifies discovery, tag browsing, clock, routing, and other capabilities; these share the main EIP implementation, but their internal call paths were not sampled. The map focuses on evidenced API, transport, and supporting data layers; it does not infer links among unsampled features.

Main entry points: [`pylogix/eip.py`](https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py) (PLC operations), [`pylogix/utils.py`](https://github.com/dmroeder/pylogix/blob/master/pylogix/utils.py) (Protocol utilities), [`pylogix/lgx_comm.py`](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_comm.py) (Connection), [`pylogix/lgx_device.py`](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_device.py) (Device parsing)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["PLC API"]
  node_public_api["Public PLC API<br/>[__init__.py]"]
  node_operations["PLC operations<br/>[eip.py]"]
  node_discovery["Device discovery<br/>[eip.py]"]
  node_tag_browsing["Tag browsing<br/>[eip.py]"]
  node_other_services["Other PLC services<br/>[eip.py]"]
end

subgraph group_protocol["Ethernet/IP transport"]
  node_connection["Connection<br/>[lgx_comm.py]"]
end

subgraph group_models["Protocol models"]
  node_device["Device parsing<br/>[lgx_device.py]"]
  node_tag["Tag models<br/>[lgx_tag.py]"]
  node_response["Response models<br/>[lgx_response.py]"]
  node_vendors["Vendor names<br/>[lgx_vendors.py]"]
  node_uvendors["Compact vendor lookup<br/>[lgx_uvendors.py]"]
end

subgraph group_compat["Runtime support"]
  node_helpers["Protocol utilities<br/>[utils.py]"]
end

node_user(("Python user"))
node_plc(("Rockwell PLC"))

node_user -->|"uses"| node_public_api
node_public_api -->|"exports"| node_operations
node_operations -->|"sends requests"| node_connection
node_operations -->|"returns responses"| node_response
node_connection -->|"communicates"| node_plc
node_operations -->|"provides"| node_discovery
node_operations -->|"provides"| node_tag_browsing
node_operations -->|"provides"| node_other_services
node_operations -.->|"references"| node_device
node_operations -.->|"references"| node_tag
node_operations -.->|"uses"| node_helpers
node_connection -.->|"uses"| node_helpers
node_device -.->|"looks up"| node_vendors
node_device -.->|"references"| node_uvendors
node_response -->|"uses"| node_helpers
node_uvendors -->|"uses"| node_helpers

click node_public_api "https://github.com/dmroeder/pylogix/blob/master/pylogix/__init__.py"
click node_operations "https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py"
click node_discovery "https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py"
click node_tag_browsing "https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py"
click node_other_services "https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py"
click node_connection "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_comm.py"
click node_device "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_device.py"
click node_tag "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_tag.py"
click node_response "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_response.py"
click node_vendors "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_vendors.py"
click node_uvendors "https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_uvendors.py"
click node_helpers "https://github.com/dmroeder/pylogix/blob/master/pylogix/utils.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_public_api,node_operations,node_discovery,node_tag_browsing,node_other_services,node_user toneBlue
class node_connection toneAmber
class node_device,node_tag,node_response,node_vendors,node_uvendors toneMint
class node_helpers toneRose
class node_plc toneIndigo
```

## Components

### PLC API

- [Public PLC API](https://github.com/dmroeder/pylogix/blob/master/pylogix/__init__.py): `pylogix/__init__.py`
- [PLC operations](https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py): `pylogix/eip.py`
- [Device discovery](https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py): `pylogix/eip.py`
- [Tag browsing](https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py): `pylogix/eip.py`
- [Other PLC services](https://github.com/dmroeder/pylogix/blob/master/pylogix/eip.py): `pylogix/eip.py`

### Ethernet/IP transport

- [Connection](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_comm.py): `pylogix/lgx_comm.py`

### Protocol models

- [Device parsing](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_device.py): `pylogix/lgx_device.py`
- [Tag models](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_tag.py): `pylogix/lgx_tag.py`
- [Response models](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_response.py): `pylogix/lgx_response.py`
- [Vendor names](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_vendors.py): `pylogix/lgx_vendors.py`
- [Compact vendor lookup](https://github.com/dmroeder/pylogix/blob/master/pylogix/lgx_uvendors.py): `pylogix/lgx_uvendors.py`

### Runtime support

- [Protocol utilities](https://github.com/dmroeder/pylogix/blob/master/pylogix/utils.py): `pylogix/utils.py`

### Other components

- **Python user**
- **Rockwell PLC**

## Connections

- Python user → Public PLC API: uses (evidence: `README.md`)
- Public PLC API → PLC operations: exports (evidence: `pylogix/__init__.py`)
- PLC operations → Connection: sends requests (evidence: `pylogix/eip.py`)
- PLC operations → Response models: returns responses (evidence: `pylogix/eip.py`)
- Connection → Rockwell PLC: communicates (evidence: `README.md`)
- PLC operations → Device discovery: provides (evidence: `README.md`)
- PLC operations → Tag browsing: provides (evidence: `README.md`)
- PLC operations → Other PLC services: provides (evidence: `README.md`)
- PLC operations → Device parsing: references (evidence: `pylogix/eip.py`)
- PLC operations → Tag models: references (evidence: `pylogix/eip.py`)
- PLC operations → Protocol utilities: uses (evidence: `pylogix/eip.py`)
- Connection → Protocol utilities: uses (evidence: `pylogix/lgx_comm.py`)
- Device parsing → Vendor names: looks up (evidence: `pylogix/lgx_device.py`)
- Device parsing → Compact vendor lookup: references (evidence: `pylogix/lgx_device.py`)
- Response models → Protocol utilities: uses (evidence: `pylogix/lgx_response.py`)
- Compact vendor lookup → Protocol utilities: uses (evidence: `pylogix/lgx_uvendors.py`)
