Forge Studio

The Workbench

Forge Studio is the integrated development environment of the ForgeIEC platform. This is where the PLC program is created — from the first draft to the finished project. Like the workbench in a forge, Forge Studio keeps all tools within reach: editor, compiler, debugger, and bus system configuration in a single application.


IEC 61131-3: ST today, one language per release

Structured Text is in productive use (pilot operation, release 0.2). Each release adds one language: 0.3 LD, 0.4 FBD, 0.5 SFC. Programs in these languages are not compiled yet. IL (instruction list) was deprecated in IEC 61131-3 edition 3 (2013) and is no longer part of the current edition, IEC 61131-3:2025 (published May 2025). ForgeIEC does not develop it; it would also need its own translation path to assembler.

See the roadmap.

  • Structured Text (ST) — in use High-level language with syntax highlighting, auto-completion, and Tree-sitter-based parsing; own compiler core that also handles the object-oriented extensions (METHOD, INTERFACE, EXTENDS)
  • Ladder Diagram (LD) — planned: 0.3 Familiar representation for switching logic, wired directly on screen
  • Function Block Diagram (FBD) — planned: 0.4 Graphical editor with block library and drag-and-drop
  • Sequential Function Chart (SFC) — planned: 0.5 Step sequence diagrams for sequential control with transitions and actions
  • Instruction List (IL) — deprecated not developed further and not compiled

Documentation in the project

Documentation lives inside the project. Every POU, variable and data type carries its own description in Markdown, stored in the same PLCopen XML file as the program. It is versioned, copied and shipped together with the code, with no separate document that drifts out of date. When you import Structured Text, ForgeIEC turns your existing (* … *) comments into documentation.

Storage follows IEC 61131-10 / PLCopen TC6: <documentation><xhtml> on each node, the project description in <contentHeader><Comment>. Besides its documentation, a variable carries an HMI label and an IEC 81346 reference designation, down to a single array element. All texts are readable through the MCP interface, so an AI assistant, including a locally hosted model, can read the documentation too.

From Structured Text, ForgeIEC generates a flow diagram in Mermaid format on request, which the AI assistant can read and show you.

The AI assistant (persona “Doc”) reads the project and proposes Markdown documentation; it also runs with a local model (LM Studio or any OpenAI-compatible endpoint).

stateDiagram-v2
    [*] --> ValveClosed
    ValveClosed --> ValveOpen: moisture < 30.0 AND NOT rain
    ValveOpen --> ValveClosed: runtime.Q OR rain
Example: what a flow diagram in the stateDiagram-v2 format looks like, here for the irrigation program from the home page. Written by hand as an illustration, not output of the Studio; rendered by this website's own copy of Mermaid.
Variables: documentation, HMI label and reference designation per variable.
Data types: the documentation in the data type dialog.
Project → Properties: the project description as rendered Markdown.
AI assistant, persona “Doc”: summarising a POU (read only).

Syntax Highlighting with Tree-sitter

Forge Studio uses Tree-sitter for incremental parsing of source code. This means:

  • Precise syntax highlighting even with incomplete code
  • Structural understanding of the program while typing
  • Fast navigation between declarations and references
  • No regular expressions — real grammar

Bus System Integration

Bus system management following established IEC-61131-3 IDE conventions is integrated directly into the development environment:

  • Segment hierarchy with devices and variables in the project tree
  • Automatic IEC address assignment without collisions
  • Network scanner for device discovery
  • Diff view for changes between editor and runtime system
  • Automatic generation of the VAR_ANVIL transport layer

Connection to the Runtime Environment

Forge Studio communicates via gRPC with the Anvil server (anvild):

  • Two-stage translation — the Studio translates IEC code into C++ source and sends it encrypted to the controller; there the runtime builds it with g++ — so the controller needs make and g++, but no IEC compiler
  • Encrypted upload — AES-256-GCM encrypted transfer to the target system
  • Live debugging — watch and force variables in real time while the PLC is running
  • User management — multi-user operation with permission system and industry-standard first-login workflow

Standard Library

Complete IEC standard library in a SQLite database:

  • Counters (CTU, CTD, CTUD)
  • Timers (TON, TOF, TP)
  • Edge detection blocks (R_TRIG, F_TRIG)
  • Bistable elements (SR, RS)
  • Type conversions and mathematical functions
  • Extensible with user-defined blocks

Technical Specifications

PropertyValue
LanguageC++17
GUI FrameworkQt 6 Widgets
Syntax EngineTree-sitter
CommunicationgRPC (protobuf)
PlatformsLinux x86_64/ARM64, Windows x64 (installer on request)
LicenceAGPL-3.0-or-later (generated code: Apache-2.0)

Screens

The ST editor in the Studio’s main window.
Variables: filter by text, type, range and tag.
Library: blocks by category, search includes the documentation.
Oscilloscope: timing, analog and normalized view.
The FDD editor: device descriptions as a tree, edited in a form.
Sequential Function Chart (SFC): planned for version 0.5, programs are not compiled yet. planned

Forge Studio — The workbench for industrial automation.

blacksmith@forgeiec.io