mbunds
Just in case anyone wonders whether the OpenPLC runtime can be used at industrial scale — and equipped with serious industrial communications features — we’re here to say: it absolutely can.
 
A little over three years ago, we reached out to Thiago for some basic project guidance. Since then, we have taken the OpenPLC project — completely unmodified at its core — and evolved it into the fully-tested OpenSIM DCS platform, which continues to grow and expand.


Project Overview:

OpenSIM DCS (Distributed Control System) is an experimental synthetic plant control architecture, built atop the OpenPLC core, designed to simulate real-world industrial control environments.

Originating from the expansion of earlier OpenPLC project architectures, OpenSIM DCS pushes OpenPLC runtime capabilities into full DCS-scale operation, involving hundreds of mapped I/O points, synthetic device models, and scalable virtual plant instances.
I/O Mapping Summary:
  • 256 Discrete Inputs (DI) — %IX0.0 through %IX31.7
  • 256 Discrete Outputs (DO) — %QX0.0 through %QX31.7
  • 128 Analog Inputs (IW) — %IW0 through %IW127
  • 128 Analog Outputs (QW) — %QW0 through %QW127
  • 128 Holding Registers (MW) — %MW0 through %MW127
OpenSIM DCS was created to stress-test synthetic field device simulation, memory allocation, modular system expansion, and (recently) Step 7 protocol compatibility under OpenPLC.

Project Goals:
  • Validate OpenPLC runtime behavior at high I/O density
  • Demonstrate scalable synthetic plant instance management
  • Explore hybrid integration with fieldbus protocols and soft/hardware hybrid simulation
  • Maintain full transparency of memory structures for SCADA/DCS modeling

PAC-LEVEL Inter-communications Using the OpenPLC PSM (Python Sub Module)
OpenSIM DCS is not just a controller program — it is a full synthetic Distributed Control System (DCS) built atop OpenPLC, designed to simulate both industrial field equipment and their associated process behaviors.
The project includes a universal library of Process Organization Units (POUs) representing simulated physical devices (pumps, transformers, rectifiers) as well as dynamic physics models (energy flow, dynamic loading, ramping, random process disturbances, etc.).
 
OpenSIM DCS leverages the OpenPLC runtime’s Python Sub Module (PSM) integration point to build a custom communication manager, supporting large synthetic DCS operations across distributed virtualized PLCs (VPLCs).
 
Why the Python Sub Module (PSM) Was Adapted:
While the OpenPLC OEM team provided the Python Sub Module feature to extend runtime capabilities, OpenSIM DCS adapted this hook to build a resilient peer-to-peer communication system, overcoming MODBUS address space limitations inherent in large-scale simulation projects.
 

2025-04-19_14-13-39_SMALL.png

 
In OpenSIM DCS, the PSM integration enables synthetic plant instances to connect, exchange data, and maintain synchronized runtime states across virtual PLCs — without corrupting or conflicting with OpenPLC’s internal I/O memory maps.
Key Features of OpenSIM DCS PSM Usage:
  • Connection Acceptance:
    The OpenSIM DCS PSM accepts incoming TCP/IP connections from external clients seeking structured field data exchange.

  • Peer Connection Establishment:
    The PSM also initiates outbound connections to peer controllers, creating resilient two-way data meshes across synthetic field systems.

  • Robust Re-connection Logic:
    Designed for harsh simulation conditions, lost sessions are detected and restored automatically through simple but reliable recovery patterns.

  • Parallel Operation with OpenPLC Core:
    The PSM operates alongside OpenPLC’s main runtime cycle, ensuring simulation communication does not block, interfere with, or compromise core I/O processing.

  • Scalability for Large Virtual Plants:
    By managing sessions independently, OpenSIM DCS can scale across dozens of VPLCs without burdening the core OpenPLC process scheduling.

 
PXL_20250428_214109927.jpg
 
 
Examples of Current Simulation Blocks (POUs):
  • SIM_RECTIFIER – Models a DC rectifier energy block with full upstream/downstream partner connectivity
  • SIM_TRANSFORMER – Models a three-phase transformer with energy intensity and phase simulation
  • SIM_DYNAMIC_LOAD – Represents variable load conditions in mechanical or electrical systems
  • SIM_AC_TRACTION_MOTOR – Simulates an AC traction motor under changing operational parameters
  • SIM_CROWN_BLOCK – Synthetic hoisting and mechanical energy conversion dynamics
  • SIM_VFD – Simulates a Variable Frequency Drive controlling synthetic motors
  • SIM_PLUMBING, SIM_VESSEL, SIM_MUD_PUMP – Simulated fluid handling and pressure systems

Project Architecture and Scaling:
OpenSIM DCS operates by managing hundreds of I/O points mapped across virtualized PLC instances.
As the OpenPLC Editor was not originally designed for projects of this magnitude, a dedicated OpenSIM DCS Manager subsystem was developed to directly manipulate project files at the source level.

2025-04-19_14-15-15_SMALL.png

Key Tools Developed to Support Scaling:
  • Bulk I/O Insertion: Direct plc.xml editing to add or modify hundreds of I/O mappings efficiently for large plant instances.
  • External Code Editing: Structured Text (ST) blocks managed outside the OpenPLC Editor to allow large modular POUs to be maintained cleanly.
  • Parser Upgrades: With the move to JSON project formats in the new OpenPLC Editor, OpenSIM DCS Manager will be upgraded to parse, generate, and modify .json project structures cleanly, ensuring continued support for bulk editing and modular development.
Why a Simulated DCS is Necessary:
  • Synthetic Testing Environments: For educational, research, and pre-deployment testing where real plants or hardware are impractical or unsafe.
  • Control System Development: To validate complex control strategies, failover systems, or plant-wide operational procedures without requiring physical equipment.
  • Training Simulators: To create realistic training environments for control room operators or field technicians.
  • Cost Reduction: Enabling full cycle testing and procedural validation without the capital costs of building a dedicated hardware testbed.
PXL_20250403_213524221.jpg

OpenSIM DCS continues to expand, evolving into a platform capable of supporting synthetic plant models of increasing complexity —
integrating control, physics simulation, and modular scalability within an open-source control architecture.

Acknowledgments:
This project would not have been possible without the OpenPLC project itself.
Sincere thanks to the developers and contributors who made this exploration feasible.

Status:
OpenSIM DCS currently operates in a virtualized environment (ProxMox) using full resource-segmented VPLCs (Virtual PLCs) and OpenPLC runtime cores.
112 Simultaneous instances have been run on the ProxMox platform on a Dell R620, 32 Xeon Cores and 128 GB RAM without driving the load beyond 6%, and that's WITH two full-desktop Windows VMs running, Win 10, and Win 11.
Further expansion will test multi-agent integration and networked synthetic control meshes.

2025-04-28_16-36-08.png

What you see above is barely the beginning, and the screens look the way they do because I have no idea what they will eventually need to look like. Suffice it to say that the GUI does flow nicely, and we have tear-off, dockable windows in case they become handy, but the other tabs to the right are a huge mess of QT Creator experimentation. Clicking on any of the icons does drill-down to their represented units, or clicking on any of them in the "Status and logs" list, but there is much work to be done on the drag-drop editors and toolbox.

Because the simulator projects running inside of the OpenPLC instances are "universal" and interconnectable, they present a multitude of challenges in connecting them together easily to form simulated systems. This is further complicated by each simulated system having multiple levels of user-selectible precision to enable varying levels of performance and accuracy, and to provide the opportunity to configure a responder to be "quick and dirty" when high precision is not demanded, but increasing levels of "dual entity bookkeeping" (yes, dual ENTITY) where systems dynamics are carefully accounted for along a chain of "physics-based" dynamic simulations. This allows loads to feedback to their drivers, to provide accurate representation of mass balanced against energy delivery.

ANYWAY, this is no small feat using the raw OpenPLC editor, the holy grail being to use the OpenSIM DCS Manager to write .st code representing entire OpenPLC projects "on the fly", meaning that the Manager must access the file system of the LXC hosing the instance, upload the project to it, then hijack the OpenPLC web-based DOM to login and force program update and compilation.

No pressure.

But if I can pull this off, a user should be able to connect one or more of the "SIM_GENERATOR" routines, to the "SIM_RECTIFIER", to the "SIM_VFD", to the "SIM_TRACTION_MOTOR", to the "SIM_GEARBOX", to the "SIM_DRAWWORKS_DRUM", to the "SIM_CROWN_BLOCK", to hoist a "SIM_LOAD", each of these logical entities defining their upstream and downstream partners, and each having bi-directional channels which account for energy transfer and losses throughout a chain of devices as a simulation runs.
There are "SIM" routines to cover every conceivable, common industrial scenario, including valve controllers, vessels, steam transfer, heat exchangers, piping and plumbing, flowmeters, level sensors, and the list goes on.
A drag and drop interface seems more than suitable, but is a large project which I will be returning to very soon.

Reply 0 0
thiagoralves
This is ABSOLUTELY FANTASTIC!!! Thank you for sharing this @mbunds ! Is this project open source? If so, do you have a repository with the source?
Reply 0 0
mbunds
This is ABSOLUTELY FANTASTIC!!! Thank you for sharing this @mbunds ! Is this project open source? If so, do you have a repository with the source?
Thank you Dr. Alves.

The entire system at large is and will be open-source, except for the OpenSIM DCS Manager, which is my only possible value-add since everything else is free, except for any optional OPC servers.
 
You would not believe how well the OpenPLC runtimes perform even at scale. Each runtime instance is installed into a minimally-configured LXC container in ProxMox, with 512 MB RAM and 8 GB HDD, but even with 112 simultaneous instances running with two full Windows instances running, the CPU load barely peaks at 8%, even on this old Dell server (40% when Windows does something nefarious in the background of one of its instances).

Now, admittedly, none of these instances are doing any "heavy processing" at the moment, since under testing those configured to cross-connect via the PSM routines to clients and servers are passing a few REAL values to increment ramps, talk to the hardware DL-06, and toggle a few Booleans, which hardly represents much of a "load", but the very few that were "loaded up" hardly increased their own load, much less the server, so we have all confidence that one server of this class will be able to run 100 "loaded instances" with room to spare for soft EWS machines, and with performance metrics that outstrip most high-end PACs.

I am re-familiarizing myself with the new interface and .json structure so I can refactor the plc.xml parsing tools to manage the .json-based projects, which will likely be simpler since I don't have to sweat the new UUID identifiers as long as none are identical, which the OpenSIM DCS database has no problem enforcing. I will also be eliminating any and all LAD-based POUs since .st is so much more convenient.

Regardless, I can't thank you enough for this project, and all of the time spent answering the "complainers" who seem to have some sense of entitlement, but whenever I arrive at the forums with a question, I discover that I either didn't read carefully enough, or my questions were answered in other posts long ago.

(Wait until you see our ScadaBR implementation; it should be inspiring to some users.)
Reply 0 0
thiagoralves
❤️
Thanks for your kind words! Indeed ST is much more straightforward than LD once you figure out how things work in PLC textual programming. However, I feel like one of the biggest improvements we had on v4 is its neat LD editor. The new editor alone makes me want to use LD more often 😂
Reply 1 0
mbunds
As promised, my work-in-progress for a municipal water system filter control console. This is being designed for HMI replacement of hardware controls, and is still prototypical in this iteration so the "finished version" will lack some of the diagnostic "LEDs", but cost analysis shows that twin HMI panels (for redundancy) actually cost substantially less (depending on the HMI vendor; select Iconics or other mil-spec panels and all bets are off) than the labor required to fabricate new panels using discrete switches and PID controllers.

Our control method for selector switches simply requires the operator to touch center, or either side of a selector on the touch screen to enable the associated function, but using multi-touch panel PCs allows us to require the operator use two fingers to effect any changes; one finger must be touching an "enable" button on the HMI screen (just a blank place on the prototype image below) before a control will accept input, and the zones "between" selector right and left are scanned to prevent unwanted changes to adjacent controls, as activating two of them causes the HMI to ignore both. Some relevant controls are "sequenced" to require the selector to pass through its "off" position before proceeding to other positions, while others allow direct selection between "Hand" and "Auto".

This is "pure ScadaBR" which is simply using custom graphics for the visualization pages.

As usual, I extend my warmest thanks to Dr. Alves and the community bringing these seriously powerful tools to professionals and hobbyists alike.

SCADABR TRANSPLANT FROM ZEUS TO THOR 2022-10-09_12-53-44.png
Reply 1 0
mbunds
❤️
Thanks for your kind words! Indeed ST is much more straightforward than LD once you figure out how things work in PLC textual programming. However, I feel like one of the biggest improvements we had on v4 is its neat LD editor. The new editor alone makes me want to use LD more often 😂
It is a "sexy" environment. I find it very easy on the eyes, and its layout is beneficial for better focus and concentration, for me anyway/
Reply 1 0
FutureHorizon
I think this project rocks! How on earth did you make scadaBR look like that... :-) PLEASE make a youtube video!
 
I really think the information on advanced uses of the open source scada softwares out there. Entirely insufficient. There is very little english videos or documentaion for SCADABR, a little on Scada LTS and an little on FUXA.
 
Reply 1 0
FutureHorizon
 
This OpenSIM DCS looks very interesting. I could see many use cases. I'd be interested in contributing to the project if I can.
Reply 1 0
mbunds
I think this project rocks! How on earth did you make scadaBR look like that... :-) PLEASE make a youtube video!
 
I really think the information on advanced uses of the open source scada softwares out there. Entirely insufficient. There is very little english videos or documentaion for SCADABR, a little on Scada LTS and an little on FUXA.
 
Alrighty then; a YouTube video will be forthcoming, but you'll find it to be exceptionally easy to do this. The hard part is deciding on your graphics.

I created these graphics in 3D CAD by modeling the panels then setting lights and rendering, but there's no reason you couldn't use Photoshop (I used to), Blender, or your favorite graphics program that will allow you to apply gradients and shading.

The one below is all Adobe Photoshop, and was driven by Visual C++.

Auto Drill.jpg
 
This OpenSIM DCS looks very interesting. I could see many use cases. I'd be interested in contributing to the project if I can.
If you are using OpenPLC for your projects, you are already contributing.

The thing about the OpenSIM DCS system is that you can have it all right now, and you don't even need a server; all you need is the ProxMox hypervisor (free), and the OpenPLC editor/Runtime (also free).

My ProxMox instance has Windows and Linux installs, but the Linux CTs and VMs provided with ProxMox, also FREE, offer a huge, HUGE selection of containers and fully-blown desktops. I use an LXC built from Debian Linux 22.04 LTS to host the OpenPLC runtimes, but I have some full-Debian and other distros, such as MINT and Vera, along with some Windows 10 and 11 Desktops which I am working hard on abandoning.

The point is, I got this far by testing this thing under some of the worst possible environments you can imagine, get this: I initially installed ProxMox on a Windows 10 machine inside of VirtualBox, so we're already talking about a hypervisor (ProxMox), running inside of a hypervisor (VirtualBox), running on top of WIndows 10.

I only did this to poke around at ProxMox, and did not expect it to perform well.
 
But it did.

Extremely well. So I asked Thiago a few questions, then created a three-node ProxMox cluster so I could test multiple OpenPLC instances running on RAM-limited workstations, and the instances simply refused to quit. Long story slightly less long, I purchased a used Dell server afterwards and haven't looked back.

I will be providing the custom PSM and the OpenSIM DCS PLC project after I am done refactoring these for the new editor, which will take some time as the OpenPLC project simulator function blocks are rather large and complex.

I'm working on getting all this out ASAP.
Reply 0 0
mbunds
I think this project rocks! How on earth did you make scadaBR look like that... :-) PLEASE make a youtube video!
 
I really think the information on advanced uses of the open source scada softwares out there. Entirely insufficient. There is very little english videos or documentaion for SCADABR, a little on Scada LTS and an little on FUXA.
 
I forgot to mention, That's another thing I was working on, which now must be re-edited to fit the new OpenPLC system; additional DOCs.

I have a lot done, but a lot more to go. When complete, I'll release them after Dr. Alves reviews them. There's a lot of differences in the way the new program manages its projects, which changes what's going on in it's "down-and-dirty underside" which my utilities must access to do the extended work for the editor.
Reply 0 0
Reply