{"id":50532910,"url":"https://github.com/moqui/moqui-plc","last_synced_at":"2026-06-03T15:01:50.488Z","repository":{"id":359076339,"uuid":"1216242965","full_name":"moqui/moqui-plc","owner":"moqui","description":"A starting point for writing standardized PLC code with Moqui","archived":false,"fork":false,"pushed_at":"2026-05-30T13:02:35.000Z","size":99919,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-05-30T15:04:41.280Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/moqui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.md","dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-20T17:59:01.000Z","updated_at":"2026-05-30T13:02:39.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/moqui/moqui-plc","commit_stats":null,"previous_names":["moqui/moqui-plc"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/moqui/moqui-plc","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqui%2Fmoqui-plc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqui%2Fmoqui-plc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqui%2Fmoqui-plc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqui%2Fmoqui-plc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/moqui","download_url":"https://codeload.github.com/moqui/moqui-plc/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/moqui%2Fmoqui-plc/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33870026,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-03T02:00:06.370Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-06-03T15:01:49.558Z","updated_at":"2026-06-03T15:01:50.478Z","avatar_url":"https://github.com/moqui.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# Moqui Framework for PLC\n\n[![license](http://img.shields.io/badge/license-CC0%201.0%20Universal-blue.svg)](https://github.com/moqui/moqui-plc/blob/master/LICENSE.md)\n\n**The first model-driven, no-code/low-code approach to industrial automation where\nthe PLC program is a projection of a universal data model — not a\nhand-drawn control diagram.**\n\nMoqui Framework for PLC is an IEC 61131-3 framework for building machine and\nprocess applications around reusable motion, device, logging, diagnostics, and\nMQTT components. What makes it different from a conventional function-block\nlibrary is that the orchestration on top of those components — the state machines,\nthe sequencing, the operating modes — is **AI-assisted and generated from the\n[moqui-device](https://github.com/moqui/moqui-device) data model**, not drawn by\nhand in a vendor IDE.\n\n## Why this is new\n\nGenerating PLC code from a model is not new in itself: tools like Simulink PLC\nCoder have produced IEC 61131-3 from control diagrams and state charts for years.\nThey all start from a **control model** — a block diagram or a state machine drawn\nspecifically to be compiled down.\n\n`moqui-plc` starts somewhere else: from a **universal data model**. The\ndevices, parameters, requests, and state machines already live in the same\nrelational schema that governs maintenance, configuration, recipes, audit, and\nlifecycle — the Silverston-lineage model inherited through OFBiz/Moqui. The PLC\nprogram is a *runtime projection of that model*, the same way\n[moqui-device-gateway](https://github.com/moqui/moqui-device-gateway) projects the\nsame model into Apache Camel edge routes.\n\nThat is the claim worth making: not one more code generator fed by a diagram, but\nthe **first no-code/low-code automation where the controller is generated from the\nenterprise model of the plant itself** — so the running PLC, its maintenance\nhistory, its configuration governance, and its audit trail are all faces of one\nsource of truth, instead of separate artifacts kept in uneasy sync. The orchestration logic\nis produced from the Moqui `StatusFlow`\nentities (defined in `BasicEntities.xml` of moqui-framework) combined with the\n`moqui-device` model, through model-driven templates an AI agent fills against the\ndeclared data — under human approval, with the change tracked. The field engineer\nstill adds the genuinely site-specific edges (`InputSignalUpdate`,\n`OutputSignalUpdate`, physical terminal mapping): the skill is not removed, it is\nfocused on what only a human at the machine can decide.\n\n## Core motion and device abstractions\n\nA whole plant reduces to a small set of reusable function blocks — a Hardware\nAbstraction Layer — parameterised by data:\n\n- `Axis`: a single-axis wrapper around PLCopen Motion Control Part 1/2 function blocks for servo drives and motors.\n- `AxisGroup`: a coordinated multi-axis wrapper around PLCopen Motion Control Part 4 for robot and kinematic groups.\n- `Actuator`: a bistable device controller with handshake-based enable/disable sequencing and diagnostics.\n- `ActuatorGroup`: a demand-driven group controller for multiple bistable actuators, with staging, anti-cycling delays, and wear-balancing rotation.\n- `ProcessPid`: for modulating devices.\n- `SignalMgmt`: signal conditioning, scaling, debouncing, and filtering.\n...\n\nTypical robot use cases include conveyors with cutters, pick-and-place cells,\ntripod/robot-arm kinematics, and coordinated axis groups driven through a common\nFSM-oriented application layer.\n\nThe repository also contains `mantle-hvac`, an application example showing how the\nframework can be used outside robotics to orchestrate HVAC equipment, device\nrules, and supervisory state machines on top of the same reusable PLC components.\n\n## Source layout\n\n- `iec61131/moqui/framework/src/main`: reusable framework POUs, DUTs, GVLs, and utilities.\n- `iec61131/moqui/framework/src/test`: motion, device, and pick-and-place test suites.\n- `iec61131/moqui/runtime/component/mantle-hvac`: example runtime component built on the framework.\n\nThe IEC 61131-3 source exports under `iec61131/moqui` can be imported into any\ncompliant IDE (CODESYS, Siemens AX, etc.). The repository also includes\n`moqui.projectarchive`, a ready-to-open CODESYS project archive that can be used\nfor demos, manual validation, and automated test execution.\n\n`MoquiStart` is the entry-point orchestrator: it initializes clocks, diagnostics,\nlogging, input/output processing, configuration loading, and then dispatches the\napplication `Main` POU.\n\n## Recipe Storage Path\n\n`DeviceConfigMgmt` uses `Recipe_Management.RecipeManCommands` to load device\nconfigurations at runtime. The CODESYS IDE Recipe Manager deploys recipe files to\n`PlcLogic/` (device root) with the naming `recipes\u003cName\u003e.\u003cDefinition\u003e.txtrecipe`,\nwhile `RecipeManCommands` searches relative to the application directory\n(`PlcLogic/\u003cAppName\u003e/`).\n\nTo bridge this gap, `DeviceConfigCmds` calls `SetStoragePath` before every\n`ReloadRecipes`. The path is configured via `deviceConfigStoragePath` in\n`MoquiConf.gvl` (default: `'recipes'`).\n\nThe default value is `'../'`, which points to `PlcLogic/` (one level above the\napplication directory `PlcLogic/\u003cAppName\u003e/`). This matches where CODESYS IDE\nautomatically deploys recipe files when the Recipe Manager Storage \"File path\"\nfield is left empty. Recipe files are named `\u003cRecipeName\u003e.\u003cDefinition\u003e.txtrecipe`\n(no prefix).\n\nDo not set a prefix in the Recipe Manager Storage \"File path\" field — leave it\nempty. A non-empty prefix (e.g. `recipes`) becomes part of the filename, which\nwould require `SetStoragePath` to include that prefix as well and creates\nunnecessary complexity.\n\nAfter changing `deviceConfigStoragePath`, rebuild and redeploy. The CODESYS File\nManager (Tools → Files) can be used to inspect or move recipe files on the\nruntime.\n\n## Prerequisites\n\nTo open the CODESYS project for testing, you need to download the CODESYS IDE from:\n\n* [CODESYS Store](https://store.codesys.com/en/codesys.html)\n\n## Demo Project Archive\n\nUse `moqui.projectarchive` to open the full demo project directly in CODESYS.\nThis archive is the recommended starting point when you want to explore the\nframework behavior, run the included test suites, or prepare a local demo\nenvironment without importing the source tree manually.\n\n## Testing Setup\n\nTo be able to carry out automatic tests or start the framework, it is necessary to\nconnect the CODESYS tasks to the appropriate PLC PROGRAM.\n\n### Pick and Place (PnP)\n\nTo run the **pick and place (pnp)** test suite, you need to link:\n\n* `TestTripodPlanningTask` --\u003e `TestTripodPlanning`\n* `PickAndPlaceTestSuiteTask` --\u003e `PickAndPlaceTestSuite`\n\n### Robot Arm 6 DOF\n\nTo run the **robot arm with 6 DOF** test suite, you need to link:\n\n* `TestRobotArmPlanningTask` --\u003e `TestRobotArmPlanning`\n* `AxisGroupTestSuiteTask` --\u003e `AxisGroupTestSuite`\n\n## Related components\n\n- **[moqui-device](https://github.com/moqui/moqui-device)** — the device data model and status flows this framework generates from.\n- **[moqui-math](https://github.com/moqui/moqui-math)** — the dual math model: trajectories, controllers, model lifecycle.\n- **[moqui-device-gateway](https://github.com/moqui/moqui-device-gateway)** — projects the same model into Apache Camel edge routes.\n\n## License\n\nCC0 1.0 Universal.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoqui%2Fmoqui-plc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmoqui%2Fmoqui-plc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmoqui%2Fmoqui-plc/lists"}