skrider
I'm investigating the use of OpenPLC in an educational environment and need to be able to create dozens of virtual temporary instances for student use.  When I first stumbled across OpenPLC a few months ago I *thought* I saw a post somewhere indicating that there was a custom hardware driver that could be added to the runtime to connect to some sort of Arduino simulator/emulator for use as virtual I/O.  I've spent hours looking today and cannot seem to locate such a thing.
 
Did I imagine that? 
 
All of the Arduino "simulators" I see tend to be more of a GUI based debug environment. What I'm really looking for is more of an Arduino VM that would allow OpenPLC to connect via TCP (or RTU) so that I could then use PyModbus to externally interact with virtual IO.  I know that Simulink and Factory IO could do this, but I'm trying to find an open source/free alternative if possible. 
 
In my case the runtime is on a Linux VM, I'm just looking for the virtual Arduino to act as the IO.  Is there any other sort of Modbus virtual IO appliance that would do that?
 
Thanks!
thiagoralves
You can hook up a real Arduino to an OpenPLC VM as a Slave Device. There is plenty of information on how to do that online and on the OpenPLC website as well. But I guess you need something virtual, right? In that case, you can simply run OpenPLC with the blank hardware layer. All IOs are there, they just won't affect anything on the "real" world. You can interface each OpenPLC instance with PyModbus and read/write to the IO points.
Reply 0 0
skrider
Yes, I need virtual devices for scalability.
 
So a hardware device is not needed to "create" the IO addresses?  They still exist in memory and can be written and read by the PLC program and PyModbus even if there's no corresponding hardware mapping?  If so that's even better.  Thanks!
Reply 0 0
thiagoralves
Yes, they all exist in memory. The job of each hardware driver is to translate that memory into physical hardware locations. If you use the "blank" hardware driver, it essentially won't translate anything, but all addresses still exist in memory and can be used as usual.
Reply 0 0
skrider
That's perfect, thanks for the clarification.
Reply 0 0
Reply