Commit Graph

14 Commits

Author SHA1 Message Date
Смирнов Виталий
0dbe401ce9 feature: added ReadTimeout and WriteTimeout to PLC class for NetworkStream. 2019-05-27 13:52:38 +03:00
Michael Croes
70506e7dba Throw InvalidDataException in Open(Async) 2019-03-14 23:02:15 +01:00
Adam Oleksy
370fd6b3d9 Fix reading nested classes 2018-09-26 14:43:49 +02:00
Michael Croes
bf4550655e Add support for creating DataItem from string (#149)
* Refactor PLCAddress

- Change fields into properties
- Apply PascalCase naming to all properties
- Make Parse public static with out parameters

* Support creating DataItem from string

* Rename PlcAddress.Address to StartByte
2018-07-11 10:21:49 +02:00
Michael Croes
1538de148b Replace LastErrorCode and LastErrorString with exceptions 2018-07-09 20:07:47 +02:00
Michael Croes
a1f4e44c48 R#: Cleanup usings 2018-06-30 22:19:44 +02:00
Michael Croes
6569e5e169 Extract ConnectionRequest from PLCHelpers 2018-06-27 21:07:41 +02:00
Michael Croes
2083ab1501 Remove obsolete attribute and comments
References #124.
2018-06-21 20:28:22 +02:00
Michael Croes
299918e293 Add Plc.Write/WriteAsync(params DataItem[] dataItems) 2018-06-15 21:50:41 +02:00
Michael Croes
aaab24a4c2 Add and move serialization helpers
Added (Get|Set)WordAt, SetAddressAt and moved GetPackage method.
2018-06-15 21:39:38 +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
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