Fish
I am working on a project that requires multiple virtual PLCs to be running simultaneously. When you try and launch a second instance of OpenPLC Runtime, it gives an "address already in use" socket error.
 
I have got around this problem in the past by using containers where each container runs a single instance of OpenPLC Runtime, but now I need a lot more (8 in total) virtual PLCs running. I could continue using containers, but I would prefer to run them from all from the same machine.
 
I'm working on going through the python code of OpenPLC Runtime to fix this (allow it a range of addresses), but I've not dived into it before and am making only slow progress. Does anyone have any guidance as for what to change to add this feature?
 
Thank you all!
Reply 0 0
Fish
Turns out I was looking at the wrong file. You can edit the port number in webserver.py line 2406 to allow for multiple instances. Unfortunately, you can only use the webpage interface to interact with the first on to start a PLC program running. This is pretty inconvenient as I will need to be able to see the monitoring page of multiple of these, but I'm not sure how to fix it.
Reply 0 0
Fish
A further development I have to use port 502 to access a virtual PLC through modbus, but I need to find a way to change that for the different virtual PLCs as I need to connect to all of them.
Reply 0 0
thiagoralves
If you use multiple incognito browser windows you might be able to see multiple instances at the same time. For the Modbus port, you can change that on settings during run time.
Reply 0 0
Reply