openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.86k stars 3.56k forks source link

[PLCLogo] Support of other S7 style PLCs with Ethernet like Vipa S7-300, Siemens S7-1200, S7-1500 or any S7 PLC with CP343 #14886

Open MarkusThur opened 1 year ago

MarkusThur commented 1 year ago

As the used moka / snap7 library is originally intended to support S7 Style CPUs ethernet communication, and the Logo 7 and 8 just how to say support that com protocol in a very basic manner, it should not be that difficult to extend the binding to support the "full born" S7 PLCs also... I am fully aware, that using a Logo in a home automation already is shooting with cannons on small birds and using S7 PLCs maybe the big cannons. But being able to communicate with S7 PLCs would enhance the use cases of openhab in a broad manner... Asuming doing energy management with openhab, being able to read out (and write) to full born machine PLCs would enable to integrate those in the energy management and change openHAB from "smart home" to "smart factory".. The ability of openhab3 to record data to persistence databases and the easiness of visualization of data, even would give it a usecase as a lightweight energy saving scada system. Furthermore integrating a full born S7 PLC would give acces to a lot of "fancy" sensors and actors on a broad range of communication Protocols...

Just a simple use case: Asuming there is a machine that needs to heat up for 1 hour before it can be used at a pretty high electric energy consumption, while idling around it has low losses on the temperature.. Those machines typically are turned on by a more or less sophisticated timer that makes sure the machine is ready to use at a given point of the day... Once those timers shall differentiate between workdays and weekend get pretty difficult already and when they shall be aware of holidays they get really tricky to do or to buy. Furthermore u could start them more sophisticated if synced with energy management. So e.g. u could start them earlier if renewable energy is aviable.. And if multiple machines are used it's even possible to start them cascaded in order to reduce peak load or to let them heat up slower in order to have them inside the renewable power limit... Or whatever fancy things one could think about. I didn't look very deep into the code right now, but what I did see is, that moka uses the "normal" Adress ranges of S7 PLCs and the binding then creates a Logo subclass with the logo Adress ranges for digital and analog inputs / outputs, memory and datablocks.. So it should be not that much of work to also support other S7 types, maybe they are even easier to support then the logo.

MarkusThur commented 11 months ago

Close this please, there is a suitable plugin now called "Simatic Binding".. But still would be nice, to have both types in one binding