Commit Graph

17 Commits

Author SHA1 Message Date
Serge Camille
023530322e Remove Port 102 dependencies from Unit Test.
- Adjust readme.
- It is no longer be necessary to shut down service s7oiehsx64.
2020-09-13 10:15:53 +02:00
Serge Camille
9198fc1686 Test project: Enable netcore3.1 testing, switch win64 Snap7 and use custom port.
- Add netcoreapp3.1 target framework, allowing this to run on linux and macos as well.
- Switch windows snap7 DLL to 64bit version 1.4.2. This also improves UnitTest stability (reduces false positives) on the CI (including appveyor)
- Changing the port used for S7NetTests when communicating with Snap7 to a value > 1000 allows tests to run on Linux without elevated privileges.
2020-09-13 10:01:38 +02:00
Serge Camille
e8a9983367 Add LReal support, kill old "Double" sham.
- Adds true support for 64bit double / LReal datatype.
- Set old Types.Single and Types.Double to obselete. Both class names use .NET types instead of S7 type names, contrary to all other types.
- Remove already obsoleted conversion from DWord to Real. Why is this even necessary?
  For users caring about converting from DWord, they can still convert to single. But unless we get LWord support, there won't be a direct conversion to double/LReal.
- Adjust unit tests by removing rounding, testing directly double read/writes.

There is quite a bit of breaking changes at least in the automated Struct and object functions which automatically translate .NET types to appropriate S7 types.
My consideration was that if we ever want to support 64bit types, there is no way against breaking those existing incorrect conversions from 64bit .NET double to 32 bit S7 Real variables.
2020-09-04 20:46:16 +02:00
Serge Camille
2bb7ac7d2a Write large byte array in S7NetTests to check for MaxPDU problems on Snap7.
For me the tests work fine even when adjust the "chunk size" in WriteBytesAsync. So Snap7 seems to be fine, at least the current version.

This should probably be tested with some live PLC's as well.
2020-09-02 20:16:53 +02:00
Serge Camille
3258c84fbc Add DateTimeLong test to S7NetTestsSync 2020-08-17 19:20:47 +02:00
Adam Oleksy
de084394a6 Fix writing nested classes 2018-10-04 18:14:44 +02:00
Adam Oleksy
370fd6b3d9 Fix reading nested classes 2018-09-26 14:43:49 +02:00
Michael Croes
1538de148b Replace LastErrorCode and LastErrorString with exceptions 2018-07-09 20:07:47 +02:00
Raphael
b8b144d7ae Add support for datatype float (Single) and obsolete double (Double) usage 2018-07-02 10:20:02 +02:00
Michael Croes
3409e52fef Add message for ReadWriteBytesMany assertion 2018-06-27 21:51:37 +02:00
Michael Croes
2083ab1501 Remove obsolete attribute and comments
References #124.
2018-06-21 20:28:22 +02:00
Raphael
1b22badea1 Fixed ErrorCode.ReadData for specific methods 2018-06-08 10:26:52 +02:00
Thomas Jäger
64e485c54a Revert "Use socket instead of TcpClient and stream."
Revert back to using Stream/TcpClient. High performance stuff is moved
to highperformancesockets branch. I think this is interesting, but i also
feel that this is premature optimization. I doubth that this will be a
performance bottleneck ofr the forseeable future.

This reverts commit 1b34716a30.
2018-05-18 08:52:19 +02:00
Thomas Jäger
00e22ee214 Incorporate fixes from #117 (moved to helpers)
fix array naming.
2018-05-16 15:50:00 +02:00
Thomas Jäger
8ac96162f9 Merge remote-tracking branch 'upstream/master' into tcpclient 2018-05-16 11:33:46 +02:00
Thomas Jäger
1b34716a30 Use socket instead of TcpClient and stream.
Async implemented with wrapper.
2018-05-16 11:24:21 +02:00
Thomas Jäger
f53a3bd320 Use TcpClient and implemnt async methods
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
2018-04-19 13:13:08 +02:00