I’m new to the openHAB but have messed with modbus TCP from Advanced HMI.
I am trying to setup a modbus TCP communication to a Click plc and cannot seem to figure out the configuration of openHAB’s Modbus. I’ve read through the documentation and cannot seem to figure it out.
If anyone has an example of what i need to do to just get one output to turn on and off with a switch or push button to get me started that would be great.
Platform information:
Running openHAB v2.5.7-1
On a raspberry pi 3b+
Trying to MODBUS TCP to control Automation Directs “Click” PLC
Project Info/ End goal:
Currently I control the PLC with an AdvancedHMI program that is running on a raspberry Pi communicating through Modbus TCP.
Have Click PLC controlled by openhab to control my already installed sprinkler system that is controlled by the PLC.
Also should note that I plan to run the raspberry pi that has openhab on it in headless mode over WIFI network and leave the other raspberry pi with advanced HMI running plugged in communicating over LAN. If this is not possible please let me know.
openHAB Modbus binding does not care about what your PLC does.
What you will need to find out is at a lower level. Which Modbus registers to I need to read and write - addresses, type? What is the IP address and Modbus ID of my PLC? Does the PLC work as a Modbus slave or master?
That’s assuming you want openHAB talking to the PLC, it’s not that clear if you are trying to compete with this AdvancedHMI thing or communicate with that instead?
Not trying to compete. Just using openhab as an equal. Reason being is so i can use my phone to control it. I would possibly ditch Advanced HMI because they do not have capability to run on android.
Okeydoke. You might need to think about how the PLC feels about having multiple masters. Assuming the PLC presents as a Modbus-TCP slave, this is sometimes not possible.
Then there are the logical issues; what happens with conflicting instructions? Most likely a non-issue, if it does what its told by anyone who tells it, and allows anyone to read back data. But worth considering.
I have disconnected the HMI from it to only have openhab while trying it. I guess I just dont know where to put the modbus addresses in openhab. I know the address of the PLC. I have the click running as a slave. (No send or receive instructions programmed.)
The HMI thingy presumably knows the details that you need.
But if you don’t know which register means what, you’re not likely to have success.
You need the info from whoever programmed the PLC.