Commit Graph

17 Commits

Author SHA1 Message Date
Dawid Pągowski
49e4d3369a Add TimeSpan serialization to Struct 2023-07-19 21:12:54 +02:00
Mike Cremer
924eb9c48f Minor changes + removed default length in S7StringAttribute 2021-03-13 12:00:32 +01:00
Mike Cremer
fdd4519f64 Minor changes 2021-01-29 21:13:38 +01:00
Mike Cremer
de0a9e64dc Added support for strings in Struct type class 2021-01-24 13:56:07 +01: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
bd8177d39e Add nullable support throughout the whole library.
This requires reference types that can be null to be annotated by a ? operator, similar to value types.

This gives the advantage that the compiler can warn against any null dereference exceptions, of which this commits elimits a few.

To make the underlying protocol implementation not any more complicated and to eliminate existing problems, and not that precise error reporting, I replaced some return null statements with explicit Exceptions. This lead to the assumption that those core protocoll functions always return non-null objects if they do not throw, making the PLC code simpler.

Adjust some NotConnected tests to look for explicit PlcException instead of NullReferenceException.
2020-08-31 22:48:45 +02:00
Raphael
932433ad69 Merge branch 'master' of https://github.com/rapha-dev/s7netplus into datatype-float 2018-07-03 08:44:51 +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
98228924ea Simplify info declaration in Struct field loops 2018-06-30 22:19:44 +02:00
Michael Croes
a1f4e44c48 R#: Cleanup usings 2018-06-30 22:19:44 +02:00
Michael Croes
7821b6b6f6 Add NetStandard 1.3 support
Supersedes UWP support since UWP 10.0 supports up to NetStandard 1.4.
2018-06-30 22:19:44 +02:00
Michele Cattafesta
7012205c3e documentation, cleanup and formatting + output xml documentation. 2016-08-26 13:06:34 +02:00
Michele Cattafesta
aff5df1b33 S7.Net and S7.Net.Core unification (issue #56): moved files, updated csproj, minor modification for compatibility in SocketClient class.
Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
2016-07-09 00:08:32 +02:00
Marcos
4fd09e7db1 VS2015 .Net Core compatible solution added. 2016-02-08 22:09:18 +00:00
Michele Cattafesta
31b38754e2 Fix an error that made impossible to read negative values when reading a struct.
Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
2014-12-22 14:35:54 +01:00
abenedykt
452cb40bd3 fixing namespaces to c# style of coding 2014-08-08 20:56:26 +02:00
Derek Heiser
e65c0eed25 S7.NET Testability Updates
Removed the Controls project and existing Test projects. Added new Test
project and references to NUnit and Should projects for testing.
Extracted IPlc interface to help test projects that reference this
library. Also implemented the IDisposable interface on the Plc object so
that references to mSocket would be cleaned up appropriately when the
object is blown away.
2013-02-09 10:17:47 -06:00