# robidev/iec61850_open_server architecture

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

- Interactive diagram: https://gitdiagram.com/robidev/iec61850_open_server
- Repository: https://github.com/robidev/iec61850_open_server

## Overview

This repository implements an IEC 61850 IED server and substation simulation showcase. The principal workflow is SCL configuration into generated/runtime models, server instantiation with logical-node behaviors, then sampled-value/GOOSE exchange and simulated process feedback; a client can observe and control the showcase. The README documents additional SPICE, Python-client, and model-generation capabilities. Some runtime wiring is only partially sampled, so uncertain integration links are omitted or marked dashed.

Main entry points: [`open_server.c`](https://github.com/robidev/iec61850_open_server/blob/master/open_server.c) (IED Server), [`LNs/PTOC.c`](https://github.com/robidev/iec61850_open_server/blob/master/LNs/PTOC.c) (Protection Logic), [`LNs/XCBR.c`](https://github.com/robidev/iec61850_open_server/blob/master/LNs/XCBR.c) (Breaker & Interlock), [`model_input_generator/src/com/libiec61850/scl/SclParser.java`](https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/scl/SclParser.java) (SCL Parser)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_configuration["SCL Configuration"]
  node_sclparser["SCL Parser<br/>[SclParser.java]"]
  node_staticgen["Static Model Generator"]
  node_dynamicgen["Dynamic Model Generator"]
end

subgraph group_ied["IED Runtime"]
  node_runtimeconfig["Config Model Parser"]
  node_server["IED Server<br/>[open_server.c]"]
  node_inputflow["Input Subscriptions<br/>[inputs.c]"]
  node_lnattach["Logical Node Attachment<br/>[LNParse.c]"]
  node_protection["Protection Logic<br/>[PTOC.c]"]
  node_breaker["Breaker &amp; Interlock<br/>[XCBR.c]"]
  node_measurements["Signal Processing<br/>[dsp.c]"]
  node_smv["Sampled Value Publisher<br/>[SMVPublisher.c]"]
end

subgraph group_simulation["Process Simulation"]
  node_localprocess["Local Sample Simulation"]
  node_simulationprocess["Simulation Process<br/>[simulation.c]"]
  node_spice["Circuit Simulator"]
  node_simapi["Simulator Web API<br/>[webAPI.py]"]
  node_cbrsim["CBR Simulation Plugin<br/>[cbr_simulation.c]"]
end

subgraph group_integration["Connectors &amp; Client"]
  node_hwconnector["Hardware Connector<br/>[hw_connector.c]"]
  node_uiconnector["UI Connector<br/>[ui_connector.c]"]
  node_pythonplugin["Python Plugin<br/>[python.c]"]
  node_pythonapp["Python Client App<br/>[app.py]"]
end

node_engineer(("Substation Engineer"))
node_scl["SCL Configuration"]
node_client(("IEC 61850 Client"))

node_engineer -->|"defines model"| node_scl
node_scl -->|"parses SCL"| node_sclparser
node_sclparser -.->|"feeds model"| node_staticgen
node_sclparser -.->|"feeds model"| node_dynamicgen
node_staticgen -->|"generates config"| node_runtimeconfig
node_dynamicgen -->|"generates config"| node_runtimeconfig
node_runtimeconfig -->|"creates model"| node_server
node_server -->|"subscribes inputs"| node_inputflow
node_server -->|"attaches nodes"| node_lnattach
node_lnattach -.->|"attaches behavior"| node_protection
node_lnattach -.->|"attaches behavior"| node_breaker
node_protection -->|"trips via GOOSE"| node_breaker
node_smv -->|"publishes samples"| node_protection
node_inputflow -.->|"delivers values"| node_protection
node_measurements -.->|"provides measurements"| node_protection
node_localprocess -->|"publishes samples"| node_smv
node_spice -->|"exchanges values"| node_simulationprocess
node_simulationprocess -->|"reads switch state"| node_breaker
node_breaker -->|"influences circuit"| node_spice
node_spice -.->|"exposes controls"| node_simapi
node_cbrsim -->|"uses server API"| node_server
node_hwconnector -.->|"uses server API"| node_server
node_uiconnector -.->|"uses server API"| node_server
node_pythonplugin -->|"uses server API"| node_server
node_pythonapp -->|"loads plugin"| node_pythonplugin
node_client -->|"browses and controls"| node_server
node_client -.->|"controls simulation"| node_simapi

click node_sclparser "https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/scl/SclParser.java"
click node_staticgen "https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/tools/StaticModelGenerator_input.java"
click node_dynamicgen "https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/tools/DynamicModelGenerator_input.java"
click node_runtimeconfig "https://github.com/robidev/iec61850_open_server/blob/master/model/config_file_parser_extensions.c"
click node_server "https://github.com/robidev/iec61850_open_server/blob/master/open_server.c"
click node_inputflow "https://github.com/robidev/iec61850_open_server/blob/master/input/inputs.c"
click node_lnattach "https://github.com/robidev/iec61850_open_server/blob/master/LNs/LNParse.c"
click node_protection "https://github.com/robidev/iec61850_open_server/blob/master/LNs/PTOC.c"
click node_breaker "https://github.com/robidev/iec61850_open_server/blob/master/LNs/XCBR.c"
click node_measurements "https://github.com/robidev/iec61850_open_server/blob/master/functions/dsp.c"
click node_smv "https://github.com/robidev/iec61850_open_server/blob/master/LNs/SMVPublisher.c"
click node_localprocess "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/local_sample_simulation/local_sample_simulation.c"
click node_simulationprocess "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/simulation_process/simulation.c"
click node_spice "https://github.com/robidev/iec61850_open_server/blob/master/circuit_simulator/circuit_simulator.py"
click node_simapi "https://github.com/robidev/iec61850_open_server/blob/master/circuit_simulator/webAPI.py"
click node_cbrsim "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/cbr_simulation/cbr_simulation.c"
click node_hwconnector "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/hw_connector/hw_connector.c"
click node_uiconnector "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/ui_connector/ui_connector.c"
click node_pythonplugin "https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/python/python.c"
click node_pythonapp "https://github.com/robidev/iec61850_open_server/blob/master/plugin/python_app/app.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_sclparser,node_staticgen,node_dynamicgen,node_client toneBlue
class node_runtimeconfig,node_server,node_inputflow,node_lnattach,node_protection,node_breaker,node_measurements,node_smv toneAmber
class node_localprocess,node_simulationprocess,node_spice,node_simapi,node_cbrsim toneMint
class node_hwconnector,node_uiconnector,node_pythonplugin,node_pythonapp toneRose
class node_engineer,node_scl toneIndigo
```

## Components

### SCL Configuration

- [SCL Parser](https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/scl/SclParser.java): `model_input_generator/src/com/libiec61850/scl/SclParser.java`
- [Static Model Generator](https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/tools/StaticModelGenerator_input.java): `model_input_generator/src/com/libiec61850/tools/StaticModelGenerator_input.java`
- [Dynamic Model Generator](https://github.com/robidev/iec61850_open_server/blob/master/model_input_generator/src/com/libiec61850/tools/DynamicModelGenerator_input.java): `model_input_generator/src/com/libiec61850/tools/DynamicModelGenerator_input.java`

### IED Runtime

- [Config Model Parser](https://github.com/robidev/iec61850_open_server/blob/master/model/config_file_parser_extensions.c): `model/config_file_parser_extensions.c`
- [IED Server](https://github.com/robidev/iec61850_open_server/blob/master/open_server.c): `open_server.c`
- [Input Subscriptions](https://github.com/robidev/iec61850_open_server/blob/master/input/inputs.c): `input/inputs.c`
- [Logical Node Attachment](https://github.com/robidev/iec61850_open_server/blob/master/LNs/LNParse.c): `LNs/LNParse.c`
- [Protection Logic](https://github.com/robidev/iec61850_open_server/blob/master/LNs/PTOC.c): `LNs/PTOC.c`
- [Breaker & Interlock](https://github.com/robidev/iec61850_open_server/blob/master/LNs/XCBR.c): `LNs/XCBR.c`
- [Signal Processing](https://github.com/robidev/iec61850_open_server/blob/master/functions/dsp.c): `functions/dsp.c`
- [Sampled Value Publisher](https://github.com/robidev/iec61850_open_server/blob/master/LNs/SMVPublisher.c): `LNs/SMVPublisher.c`

### Process Simulation

- [Local Sample Simulation](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/local_sample_simulation/local_sample_simulation.c): `plugin_src/local_sample_simulation/local_sample_simulation.c`
- [Simulation Process](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/simulation_process/simulation.c): `plugin_src/simulation_process/simulation.c`
- [Circuit Simulator](https://github.com/robidev/iec61850_open_server/blob/master/circuit_simulator/circuit_simulator.py): `circuit_simulator/circuit_simulator.py`
- [Simulator Web API](https://github.com/robidev/iec61850_open_server/blob/master/circuit_simulator/webAPI.py): `circuit_simulator/webAPI.py`
- [CBR Simulation Plugin](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/cbr_simulation/cbr_simulation.c): `plugin_src/cbr_simulation/cbr_simulation.c`

### Connectors & Client

- [Hardware Connector](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/hw_connector/hw_connector.c): `plugin_src/hw_connector/hw_connector.c`
- [UI Connector](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/ui_connector/ui_connector.c): `plugin_src/ui_connector/ui_connector.c`
- [Python Plugin](https://github.com/robidev/iec61850_open_server/blob/master/plugin_src/python/python.c): `plugin_src/python/python.c`
- [Python Client App](https://github.com/robidev/iec61850_open_server/blob/master/plugin/python_app/app.py): `plugin/python_app/app.py`

### Other components

- **Substation Engineer**
- **SCL Configuration**
- **IEC 61850 Client**

## Connections

- Substation Engineer → SCL Configuration: defines model
- SCL Configuration → SCL Parser: parses SCL
- SCL Parser → Static Model Generator: feeds model
- SCL Parser → Dynamic Model Generator: feeds model
- Static Model Generator → Config Model Parser: generates config
- Dynamic Model Generator → Config Model Parser: generates config
- Config Model Parser → IED Server: creates model (evidence: `open_server.c`)
- IED Server → Input Subscriptions: subscribes inputs (evidence: `open_server.c`)
- IED Server → Logical Node Attachment: attaches nodes
- Logical Node Attachment → Protection Logic: attaches behavior
- Logical Node Attachment → Breaker & Interlock: attaches behavior
- Protection Logic → Breaker & Interlock: trips via GOOSE
- Sampled Value Publisher → Protection Logic: publishes samples
- Input Subscriptions → Protection Logic: delivers values
- Signal Processing → Protection Logic: provides measurements
- Local Sample Simulation → Sampled Value Publisher: publishes samples (evidence: `plugin_src/local_sample_simulation/local_sample_simulation.c`)
- Circuit Simulator → Simulation Process: exchanges values
- Simulation Process → Breaker & Interlock: reads switch state
- Breaker & Interlock → Circuit Simulator: influences circuit
- Circuit Simulator → Simulator Web API: exposes controls
- CBR Simulation Plugin → IED Server: uses server API (evidence: `plugin_src/cbr_simulation/cbr_simulation.c`)
- Hardware Connector → IED Server: uses server API
- UI Connector → IED Server: uses server API
- Python Plugin → IED Server: uses server API (evidence: `plugin_src/python/python.c`)
- Python Client App → Python Plugin: loads plugin (evidence: `plugin/python_app/app.py`)
- IEC 61850 Client → IED Server: browses and controls
- IEC 61850 Client → Simulator Web API: controls simulation
