-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server side of S7 for emulation purpose #6
Comments
S7NetPlus uses Snap7 in its unit tests. I think most of the code for that is in https://github.com/S7NetPlus/s7netplus/blob/develop/S7.Net.UnitTest/Helpers/S7TestServer.cs . Your implementation using Snap7.Managed might be better though. I was able to get that Snap7 unit test in S7NetPlus working on net core linux and windows in S7NetPlus/s7netplus#318, while also removing the Port 102 dependency. I don't think all of that is ever a replacement for true integration testing using S7 PLCs, but it could definitely be a part of automated unit/integration tests. |
It's actually a really interesting problem on its own. If I implement server side support in Sally7, I intend to share as much code as possible for the data structs. Evidently what happens if I change a struct is that both client and server will change, so the question is how valuable a unit test against Sally7 as server would be. On the other hand testing against another S7 implementation should not be affected by internal refactorings, so there's something to say for that as well. Still, I don't feel like introducing a dependency on Snap7 in any way, I guess that library just doesn't live up to my expectations of code quality. As far as proper unit testing is concerned, it would mostly be important to actually separate out the units. Currently there's a mixture of connection management and structuring protocol data in the Anyway, I'm somehow currently very motivated to make some next steps with Sally7 (and possibly S7NetPlus as well), so maybe the next few days/weeks might provide some improvements. |
(As briefly discussed through email in the end of 2019)
Sally7 provides a great experience for the client part of the S7 protocol, but there is no server component at the moment. It means you need a real server or use another library to create an emulator if you want to test your code.
I've been using Snap7 in the mean time, but it would be nice to have a complete Sally7 experience for the S7 protocol.
Here an example adapted from the code provided by Snap7 for a basic S7 server emulator, using Snap7:
The text was updated successfully, but these errors were encountered: