Commit Graph

15 Commits

Author SHA1 Message Date
Adam Oleksy
370fd6b3d9 Fix reading nested classes 2018-09-26 14:43:49 +02:00
Michael Croes
96efb9d56a Add tests for String.ToByteArray(...) 2018-07-11 22:07:34 +02:00
Michael Croes
2204ab360c Fix write stringex (#162)
* Add StringEx.ToByteArray(...)

* Add Serialization.SerializeDataItem(DataItem)

Supports StringEx VarType or offloads to SerializeValue method.

* Use SerializeDataItem in S7WriteMultiple

* Assume string length without header in StringEx.ToByteArray

VarTypeToByteLength already assumed that StringEx declared count for
the number of characters without the header, this now matches that
behavior.

* Add unit tests for StringEx conversions

* Fix incorrect value passed to Encoding.GetBytes

The length must actually be within string limits.
2018-07-11 09:47:43 +02:00
Michael Croes
0f151e4947 Add tests for ConnectionRequest 2018-06-27 21:24:23 +02:00
Michael Croes
5f220cd31f Fix default namespace in S7.Net.UnitTest 2018-06-27 21:09:11 +02:00
Thomas Jäger
8ac96162f9 Merge remote-tracking branch 'upstream/master' into tcpclient 2018-05-16 11:33:46 +02:00
Michele Cattafesta
b3458a8304 unit tests 2018-05-05 23:24:06 +01:00
Thomas Jäger
74af1c0da7 Change project to allow testing internal classes.
Add protocol tests
Simplify async tests
2018-04-19 15:08:52 +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
Thomas Bargetz
07fe703b3d Classes with arrays can now be read/written from/to the plc 2017-08-07 11:51:58 +02:00
Thomas Bargetz
6328efbc5b Ignoring properties without a public setter or no setter at all 2017-07-07 10:57:12 +02:00
Michele Cattafesta
9108dbde51 documentation, cleanup and unit tests.
Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
2016-05-02 21:58:09 +02:00
Michele Cattafesta
9aa01a4aad Read/Write class and structs now handle more than 200 bytes with multiple requests (Issue #30 and Issue #27).
Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
2015-10-05 23:44:49 +02:00
Johnnyxy
533a18e2cc o changed target .NET framework to v3.5 (higher .NET versions can load and execute lower versions code)
x fixes compatibility to support .NET 3.5 (removed unused usings/imports and changed method calls to .NET equivalents)
2015-06-17 17:04:12 +02:00
Michele Cattafesta
73437f9ea3 Added Unit Tests.
Signed-off-by: Michele Cattafesta <michele.cattafesta@mesta-automation.com>
2014-12-22 14:31:52 +01:00