explaingit

zaidmukaddam/robocpp

17RustAudience · developerComplexity · 4/5LicenseSetup · moderate

TLDR

An open-source compiler and runtime for IEC 61131-3 industrial control programs that lets engineers validate, simulate, and convert PLC code written in all five standard language formats into portable C for real hardware targets.

Mindmap

mindmap
  root((robocpp))
    What it does
      Compiles PLC programs
      Simulates control logic
      Generates portable C
    Input formats
      Structured Text
      Ladder Diagram
      Function Block Diagram
    Hardware targets
      Modbus and EtherCAT
      ROS 2 robotics
      GPIO pins
    Audience
      Robotics engineers
      Control system teams
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Compile and test IEC 61131-3 PLC programs without needing vendor-specific hardware or proprietary software.

USE CASE 2

Generate portable C code from control logic and embed it in a robot or custom hardware target connected via Modbus or ROS 2.

USE CASE 3

Validate that existing PLC programs meet IEC 61131-3 compliance requirements using the built-in coverage report.

USE CASE 4

Import and export PLC projects from graphical tools using the PLCopen XML exchange format.

Tech stack

RustC

Getting it running

Difficulty · moderate Time to first run · 30min

Requires a Rust toolchain to build from source.

Dual-licensed under MIT and Apache 2.0, use freely for any purpose including commercial projects, just keep the copyright notice.

In plain English

RoboC++ is an open-source compiler and runtime toolkit for a programming standard called IEC 61131-3, which is the international standard for how industrial controllers (PLCs) are programmed. PLCs are the computers that run factory machines, assembly lines, and robotic systems. The standard defines several programming languages for writing that control logic, and RoboC++ can read and compile programs written in all of them. The tool is aimed at engineers, robotics teams, and companies who want to build or validate control system software without being tied to a specific vendor's development environment. You give it a source file written in one of the supported formats, and it can check the code for errors, run a simulation to trace what the program would do, or convert it into portable C code that can be embedded into real hardware systems. It also supports an XML exchange format called PLCopen that graphical PLC tools use, so you can import and export projects from other environments. The supported input formats cover all five IEC 61131-3 language families: Structured Text, Instruction List, Sequential Function Charts, Ladder Diagram, and Function Block Diagram. Each has its own file extension and the compiler handles them through a shared frontend. There is also a command that checks how well the implementation covers the standard's requirements, and the README states that the current profile reports zero remaining compliance gaps. When the compiler generates C code, it produces a scan function and a matching state structure. Robot or PLC targets can hook into this generated code to connect the control logic to real hardware, whether that is Modbus, EtherCAT industrial networking, ROS 2 (a robotics middleware framework), or GPIO pins. Safety features like watchdogs and emergency-stop gates are included in the target adapter layer. The project is written in Rust and is intentionally kept dependency-light so it is easy to audit, modify, and embed. It is dual-licensed under MIT and Apache 2.0.

Copy-paste prompts

Prompt 1
Using the robocpp compiler, walk me through compiling a Structured Text .st file and running a simulation trace to see what the program outputs step by step.
Prompt 2
Show me how to use robocpp to generate C code from an IEC 61131-3 program and connect the scan function to ROS 2 so my robot can execute the control logic.
Prompt 3
I have a PLCopen XML file exported from my graphical PLC editor, walk me through importing it into robocpp and converting it to Structured Text.
Prompt 4
How do I run the robocpp compliance coverage check to see which IEC 61131-3 standard features are currently implemented?
Prompt 5
Write a simple Structured Text program that toggles an output every 500ms and show me the robocpp commands to compile and simulate it.
Open on GitHub → Explain another repo

← zaidmukaddam on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.