Hi,
I would like to share some open-source projects aimed at evaluating Moqui’s potential in the context of Industrial Automation, Mathematical Modeling, and System Simulation.
The repositories are available here:
Context and Flow
Interfacing an ERP framework with the factory floor often involves control systems theory.
The proposed architecture explores this general flow:
System Simulation & Math Modeling → Logic Execution → PLC Communication.
System Simulation and Data Model
A key focus of this work is the simulation of the physical systems to be controlled.
Testing the logic against a simulated machine model is a standard and safe step before any physical deployment.
To support this, I drafted some specific components:
-
Data Model: I added
mantle-udmextensions with experimental entities for math models and devices (MathEntities.xml & DeviceEntities.xml). -
Control Logic and Simulation: I provided
moqui-jep(Java Embedded Python).
While Python’s ecosystem is incredibly useful for simulating complex systems and I personally rely on it, it is proposed purely as an option.
It is not a strict requirement, and standard Groovy/Java can still be used.
Hardware Communication and PLC
For the communication with the machines (whether simulated or physical), I explored a few approaches (moqui-plc4j, moqui-plc, and Camel):
- Integration Options: Moqui can communicate via Apache PLC4X. Alternatively, the provided PLC code includes sections to publish data via MQTT to a broker or via OPC UA.
On the software side, this data can be consumed using moqui-camel or a standalone Apache Camel on Quarkus application.
- A Framework for PLCs: The provided PLC source code is intended to be a sort of “Moqui framework for PLCs”.
The goal is to offer a reusable foundation to avoid reinventing the wheel for every new machine.
It is written in standard IEC 61131-3 with the intention of making it portable to any compliant PLC brand.
-
Robotics: The code is structured to support robotics, utilizing the PLCOpen Motion control library (Part 1, 2, and 4).
-
Reference IDE: Please note that Codesys was used purely as a reference platform because its IDE is available as a free download for testing, but the code is meant to be transferable to other standard PLC platforms.
I invite anyone interested in Industry 4.0 or IoT to take a look at the repositories.
Best regards,
Igor Gallingani
