krishnadas
As part of a PoC project, I need to access the variables inside openPLC on the node-red flow diagram.
In simpler, I'm using node-red as a Web UI so need to accept the setpoints from the operator and pass the same to openPLC for processing again need to get the status of some devices from openPLC to show the status on the web UI.
I'm using Modbus com to communicate with the actual field device, hence a Modbus com between openPLC and Node-Red is not recommended.
Is there any way to do the same, I appreciate your suggestions.
Quote 0 0
thiagoralves
The best way to read values from OpenPLC is using Modbus. I don't understand why you can't use Modbus between OpenPLC and Node-Red. Even if OpenPLC is using Modbus to communicate with slave devices, a connection to Node-Red would take place on a separate thread. It should work just fine.
Quote 0 0
jonas_rotter
As @thiagoralves already said, the easiest way would be to use Modbus. Just have a look at node-red-contrib-modbus, there are even examples of how to convert the whole thing into Nodered.

A difficult and maybe also unsafe way would be to log into the Openplc webserver with an exec node
curl -c cookie.txt -d "username=openplc" -d "password=openplc" http://localhost:8080/login
then read the corresponding data from http://localhost:8080/monitoring with
curl -b cookie.txt http://localhost:8080/monitoring
(see also OpenPLC_v3/webserver/monitoring.py) and log out again with
curl -b cookie.txt http://localhost:8080/logout


Certainly possible, but quite cumbersome. Modbus is definitely simpler and more useful.
Quote 0 0