Note: This keeps the old methods to be backward compatible. Note: Unforntunatly a lot of whitespace fixes, refactoring and other trivial stuff is included. It was to hard to split of in a seperate commit. Note: Async methods does not use exactly the same structure/signature as the existing methods. "Out" parameters like ReadClass and ReadStruct instead returns the struct in tuple. Async methods also rely on exceptions instead of ErrorCodes to communicate exception states to calling client. * Use TcpClient and use Async methods (ReadAsync/WriteAsync) * Implemnt async methods for all existing methods * Implemnt existing methods using tcpclient. * Split Plc.cs in more files. (Common, Async, Sync, Helpers) * Mark old methods as Obsolete * Split tests in two files * Implement Async tests
s7netplus
A .NET Library for Siemens S7 Connectivity
Overview
S7.Net Plus is a continuation of the work done on the S7.Net project by Juergen1969. I found the library simple and effective, but the project has languished unchanged since late 2009.
I was doing some automation work already and saw a few places where the code base could be improved. Because Juergen did not respond to my request for committing code, I decided to pick up where he left off here on GitHub.
Documentation
Check the Wiki and feel free to edit it: https://github.com/killnine/s7netplus/wiki
S7.Net Plus has a User Manual, check it out.
Supported PLC
- Compatible S7 PLC (S7-200, S7-300, S7-400, S7-1200, S7-1500)
Target framework
- .NET Framework 3.5 or higher
- Universal Windows Application (.Net Core) - see S7.UniversalWindowsApp.sln
Compile
You need at least Visual Studio 2015 (you can download the Community Edition for free).
Nuget
PM> Install-Package S7netplus
Latest build (Appveyor)
https://ci.appveyor.com/project/mesta1/s7netplus
Running the tests
Unit tests use Snap7 server, so port 102 must be not in use. If you have Siemens Step7 installed, the service s7oiehsx64 is stopped when running unit tests. You have to restart the service manually if you need it.