I am working on the integration of the S7 protocol in OpenPLC using my Snap7 libraries.
S7Protocol is a structurally complex protocol but it is very performant and secure (from the point of view of data integrity).
The Server part completely emulates a Siemens communication processor, once activated, OpenPLC is seen from the outside (including Step7) as a Siemens S7-315 PN/DP CPU.
All scadas that implement this protocol can read and write internal resources.
Current status
I have grafted the library into OpenPLC maintaining the existing conventions: there is an option file (s7protocol) in /script that if it contains the string s7ptrotocol, at the first compilation of a new PLC program, the wrapper files are automatically included in the compilation; otherwise they are deleted and no reference to them remains.
In Linux/Raspberry the library is compiled during the OpenPLC installation, so they will always be aligned with the libcc and the architecture (32/64).
In Windows I use the compiled (VisualStudio) dll wich are smaller and more performant.(However, if you want you can recompile them with mingw32/64, there is a makefile into the official Snap7 distribution).
Install (Raspberry)
Compile user program
Run program (Raspberry)
Client connected to Windows OpenPLC
I currently have it implemented on
- Windows (msys2)
- Linux
- Raspberry
Now all the work will be done only in the oplc_snap7.cpp file that in addition to containing the wrapper of the communication functions, manages the interface with OpenPLC.
and here we come to the second part...