Seafoxc
Hi
 
I was wondering I can connect Factory IO to read the Modbus registers in the OpenPLCRuntimeV4 (if it exist). I read the documentation an looked at the plug in files and I was wondering if it is possible to connect Factory IO. Im stuck trying:
 
Im working with the docker. desktop app and changed the ''Modbus_master.json" the host to "host": "host.docker.internal",
 
This is the Factory IO setting (It stated it is connected)
[203128%2F9615149%2Fmceclip0]
 
I changed the PluginConfig to:
modbus_slave,./core/src/drivers/plugins/python/modbus_slave/simple_modbus.py,0,0,./core/src/drivers/plugins/python/modbus_slave/modbus_slave_config.json,./venvs/modbus_slave
modbus_master,./core/src/drivers/plugins/python/modbus_master/modbus_master_plugin.py,1,0,./core/src/drivers/plugins/python/modbus_master/modbus_master.json,./venvs/modbus_master
 
 
If there are planned updates to make it easy in the future I can wait :-)
thiagoralves
You don’t have to change files on the runtime. Any edit you do manually will be reverted later automatically. To enable Modbus click on the blue + button, go to server, give it a name and select Modbus protocol. Then open the newly created server on the project tree and make sure it is enabled for all interfaces (0.0.0.0).  That’s it 🙂
 
Ah, if you’re running on docker then you’ll have to forward the container port 502 (or whatever port you pick for the Modbus server) to your host.
Reply 1 0
thiagoralves
You said you wanted Factory IO to read OpenPLC registers, but then on your screenshot you seem to be configuring a Modbus server on Factory IO. In that case you will have to configure a Modbus client in the runtime. Then instead of going to + button -> server, go to + button -> remote IO. Once your Modbus remote IO device is created on the project tree, open it up to configure the IP address, port, and registers to read/write. These registers are called “IO Groups”. You can add as many IO Groups as you want.
Reply 1 0
Seafoxc
completly overlooked the button. '+' button... Thanks to let me know.
Reply 1 0
Seafoxc
It works now, Im gone try some things out and I will make a video tutorial. Cool stuff.
 
If I use in my tutorial the folowing CMD script it should work in the nearby future:
docker pull ghcr.io/autonomy-logic/openplc-runtime:latest

docker volume create openplc-runtime-data

docker run -d --name openplc-runtime -p 8443:8443 -p 502:502 --cap-add=SYS_NICE --cap-add=SYS_RESOURCE -v openplc-runtime-data:/var/run/runtime ghcr.io/autonomy-logic/openplc-runtime:latest
I can not figure out how to set more ports the one port open in the "additiona setting" tap in the windows docker desktop app.
Reply 0 0
thiagoralves
I'm not very much familiar with Docker desktop (I pretty much only use cli). I'll figure it out and let you know. If you find it out first, please post here. This will help us update the instructions on the website as well. Thanks!
Reply 1 0
thiagoralves
By the way, instead of manually installing the runtime and connecting to it, you can just use our Autonomy Edge platform and have it all done automatically for you. All you need is to install our Orchestrator on a Linux machine. To install the Orchestrator you only need to type one command on a Linux terminal:
 
curl https://getedge.me | bash
 
Once the agent is installed you type its ID on the "New Orchestrator" dialog on the Edge app and that's it. You can then create new vPLC instances on the Devices tab, connect to them from the browser, upload new programs, and have them talk over Modbus to things on your local network (including Factory IO). That's the easiest way to go 🙂
Reply 0 0
Seafoxc
By the way, instead of manually installing the runtime and connecting to it, you can just use our Autonomy Edge platform and have it all done automatically for you. All you need is to install our Orchestrator on a Linux machine. To install the Orchestrator you only need to type one command on a Linux terminal:
 
  1. curl https://getedge.me | bash
 
Once the agent is installed you type its ID on the "New Orchestrator" dialog on the Edge app and that's it. You can then create new vPLC instances on the Devices tab, connect to them from the browser, upload new programs, and have them talk over Modbus to things on your local network (including Factory IO). That's the easiest way to go 🙂
I will try it in the future but like a lot of people I'm completly submerged in the Windows platform. I'm a 1000% sure Linux is a superior operating system but as an educator I can not switch to it. I'm all onboard using web based apps. A good example where it is already happening is CAD software (Like Onshape) so I'm curious to see OpenPLC go in that direction (but I also love the OpenPLC editor way). Can I run a Linux machine in docker? Or would these be more of hassle adding the extar step?
Reply 0 0
thiagoralves
You don’t have to switch to Linux. Autonomy Edge runs on a browser, so it can run on any OS, even on a tablet. You only need Linux for the runtime, installed through the orchestrator command I sent above. You can use a simple Raspberry Pi for that for example. A docker Debian Linux image might work as well although you will end up with two virtualization layers.
Reply 1 0
Reply