New 32/64 bit S7 communication library

D

Thread Starter

Dave Nardella

Hi All,

I published to sourceforge a library for communicating with S7300/400/1200/1500 PLC and SINAMICS drives.

This is not (only) an usual driver for reading/writing data into a PLC, but a set of three components that allow the full integration of a PC into a PLC chain.

The Client to read/write data into a PLC and to control it (run/stop, set/clear password and so on).

The Server to connect any HMI panel/scada to your application, which will be seen as a real PLC.

The Partner to manage "unsolicited" data transfer from a PLC (which uses BSend/BRecv)

Supported platforms:
- Windows
- Linux
- BSD
- Solaris

Supported Architectures:
- Intel/AMD - 32/64 bit for all platforms supported.
- ARM (Raspberry, pcDuino, BeagleBoard, CubieBoard2).

Supported Languages:
- Delphi/FreePascal
- .NET/Mono (the interface assembly is written in C#)
- C/C++
- LabVIEW

Comments, criticism and suggestions to improve and bug fix the library are warmly welcomed.

I hope can help..

Thanks for your time.
<i>Dave</i>
http://snap7.sourceforge.net
http://www.facebook.com/snap7.project

<b>I want to remark that this is not a commercial advertisement, the project is free and open source.</b>
 
C

Curt Wuollet

Way to go Dave!

This is the kind of stuff we really need to use the gear the way _we_ want to.

I just did a little project with the Raspberry Pi as a data display. It's really interesting as a HMI because it has very high quality video and with Python you can do quite a bit with just a little code. Probably not for a full blown scada, but for operator panels and parameter displays it's pretty cool. Your work should make it possible to replace a really, really expensive panel with a $25 computer and a commodity DVI or HDMI monitor. The trick is to get the data from the PLC and this solves that at least for some Siemens units. Too bad touch panels are so spendy.

Regards
cww
 
D

Dixit Solanki

You did a great job.

Will test it in my spare time.

Update you for any fixes if require.

-Dixit
 
V

Vanderley Maia

Very nice work!

I try to use this library and your samples (rich-demos) but something doesn't work, I cannot read DB Blocks, in my C# program I don't receive the bytes from DB and in your Client sample program I received the follow message: CPU : Address out of range.

DO you know if there are something to set in the S7-1200.

Note: I can read and write I/O, but the DB/Counter/Timer I cannot.

Thank you!
 
>CPU : Address out of range.
>
>DO you know if there are something to
>set in the S7-1200.
>
>Note: I can read and write I/O, but the
>DB/Counter/Timer I cannot.

Same problem! Did you find any solution?
 
Nice e to have a new Open Source LGPL library for Siemens PLC communication.

I downloaded your snap7-full-1.2.1.tar.gz
and created a qmake PRO project file for it.

Here is the PRO file:<pre>
me@mybox:~/Downloads/snap7-full-1.2.1/src> cat snap7.pro
TEMPLATE = lib
#CONFIG += warn_on release staticlib
CONFIG += warn_on release
CONFIG -= qt

INCLUDEPATH += lib
INCLUDEPATH += core
INCLUDEPATH += sys

HEADERS = lib/snap7_libmain.h \
core/s7_micro_client.h \
core/s7_isotcp.h \
core/s7_client.h \
core/s7_firmware.h \
core/s7_partner.h \
core/s7_peer.h \
core/s7_types.h \
core/s7_server.h \
core/s7_text.h \
sys/snap_msgsock.h \
sys/snap_sysutils.h \
sys/snap_threads.h \
sys/unix_threads.h \
sys/snap_platform.h \
sys/snap_tcpsrvr.h \
sys/win_threads.h \
sys/sol_threads.h

SOURCES = lib/snap7_libmain.cpp \
core/s7_partner.cpp \
core/s7_isotcp.cpp \
core/s7_client.cpp \
core/s7_server.cpp \
core/s7_text.cpp \
core/s7_peer.cpp \
core/s7_micro_client.cpp \
sys/snap_tcpsrvr.cpp \
sys/snap_msgsock.cpp \
sys/snap_threads.cpp \
sys/snap_sysutils.cpp

TARGET = snap7</pre>
With qmake snap7.pro make i could compile and create the library without problems on my openSUSE system.

The only annoying thing are some warnings about unused variables and some "may be used uninitialized in this function" warnings.
It would be nice if you modify the source code, so that no warnings occur any more.

There are also other libraries for Siemens PLC communication.
For example:
http://libnodave.sourceforge.net/
which is also integrated and tested within our
HMI/SCADA framework
http://pvbrowser.org

Within our pvbrowser we also have a class for Siemens PLC communication.
You can review it on github
https://github.com/pvbrowser/pvb/blob/master/rllib/lib/rlsiemenstcp.h
Here is the tiny url for the documentation
http://tinyurl.com/lvapbyn
There you can also have a look into the implementation.

Since our pvbrowser also runs on all the systems you support it might be also interesting for you.
 
Top