Commit Graph

181 Commits

Author SHA1 Message Date
Thomas Jäger
219c1cc71a Revert "Use high performance wrapper"
This reverts commit a3277133af.
2018-05-18 08:43:44 +02:00
Thomas Jäger
a3277133af Use high performance wrapper 2018-05-16 16:29:11 +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
b8b890977e Fix structured comments 2018-05-14 14:19:33 +02:00
Michele Cattafesta
013ff5fd92 Merge pull request #117 from rapha-dev/master
Fixed bug in ReadMultipleVars on VarType.Bit
v0.1.9
2018-05-12 23:03:57 +01:00
Raphael
642cf8169e Fixed bug for reading VarType.Bit and VarType.Byte on odd number of bytes in ReadMultipleVars() 2018-05-07 11:47:52 +02:00
Raphael
f6e370b162 Merge remote-tracking branch 'upstream/master' 2018-05-07 11:44:58 +02:00
Raphael
cbaa8921df import killnine master 2018-05-07 09:47:20 +02:00
Michele Cattafesta
b3458a8304 unit tests 2018-05-05 23:24:06 +01:00
Michele Cattafesta
a824344a4c Merge pull request #110 from Buchter/ImproveClassSizeCalculation
Fixed bug regarding size calculation of small S7 Structs
2018-05-05 23:00:15 +01:00
Michele Cattafesta
587e496497 Merge pull request #108 from thoj/master
Take 2: Use TPKT/COTP for reading responses from PLS
2018-05-05 22:09:13 +01:00
Raphael
0d1bc472c8 Added BitAdr to DataItem and fixed bug in ReadMultipleVars on VarType.Bit 2018-04-27 16:00:41 +02:00
Thomas Jäger
e6f1114bc1 Add COTP.ReadTSDU test 2018-04-19 15:39:41 +02:00
Thomas Jäger
84aee0671a Only return used bytes 2018-04-19 15:39:03 +02: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
c80b0dd55d Add signing key to S7.Net.UnitTest for testing internal classes 2018-04-19 15:07:06 +02:00
Thomas Jäger
eb0d6a3429 Better TPKT error handling 2018-04-19 15:06:10 +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
Buchter
4b04ed74a1 Fixed bug regarding size calculation of small S7 Structs
There was an Error when you had Structs conaining less than 8 Bits. The size calculation in this case returned 0 and the Plc.ReadClass() method throwed an excpetion. Structs in Step7 within da DataBlock always starts with adresses that can by devided by two. The extended code ensures the correct size even if there are a couple of structs in a DataBlock containing only a few bits.
2018-04-19 12:09:30 +02:00
Thomas Jäger
50b026d7a5 Read TPKT/COTP packets / Read MaxPDU size from PLC
Read responses from the PLS using classes for TPKT and COPT. This
makes the communication more robust. It will now handle empty COTP
packets that SoftPLS and WinAC based PLCs send out. I use RFC names for
functions and classes.

Change logic to use COTP and S7Comm reponse codes instead of
relying on packet sizes.

Read Max PDU size from connection setup. Ref #21
Change logic to use MaxPDUSize when reading istead of hardcoded limit.

I tried using MaxPDUSize when writing data but this failed when packet size is
over 256 on snap7. So i decided to drop changes to write size.
I have done some tests against WinAC cpu and it seems to handle bigger pdu's
when writing if negotiated in the connection setup. This might just be a SNAP7 bug.

Fix MaxPDUSize for readbytes

Remove debug line

Simplify byte copy. Remove unessesarry buffer
2018-04-19 00:34:11 +02:00
Thomas Jäger
f740ba0078 Fix writing double to PLC 2018-04-19 00:34:11 +02:00
Thomas Jäger
1b4faf21d7 Code Lint: Standard dispose Pattern. /// to // comment 2018-04-19 00:34:11 +02:00
Thomas Jäger
3a18d13805 Add test for Read/Write Double and PDUSize Test 2018-04-19 00:34:10 +02:00
Michele Cattafesta
9fd515280a Revert "Merge pull request #107 from thoj/master"
This reverts commit d17fdf8efb, reversing
changes made to bfeacee08f.
2018-04-11 20:22:24 +01:00
Michele Cattafesta
d17fdf8efb Merge pull request #107 from thoj/master
Fix communication with WinAC/SoftPLC CPUs and Fix write double
2018-04-11 19:28:41 +01:00
Thomas Jäger
8a3db22629 Read TPKT/COTP packets / Read MaxPDU size from PLC
Read responses from the PLS using classes for TPKT and COPT. This
makes the communication more robust. It will now handle empty COTP
packets that SoftPLS and WinAC based PLCs send out. I use RFC names for
functions and classes.

Change logic to use COTP and S7Comm reponse codes instead of
relying on packet sizes.

Read Max PDU size from connection setup. Ref #21
Change logic to use MaxPDU from cpu limit instead of hardcoded limit.

Remove var count limit.
2018-04-10 15:26:04 +02:00
Thomas Jäger
6470f8d076 Document bSend1 data packet 2018-04-10 15:25:20 +02:00
Thomas Jäger
723b0ffd42 Fix writing double to PLC 2018-04-10 15:23:46 +02:00
Michele Cattafesta
bfeacee08f Merge pull request #102 from mbalous/master
Non breaking changes. Code styling, comments, etc...
2018-04-08 21:12:22 +01:00
Michele Cattafesta
b6b53078f9 Merge pull request #101 from tomsoftware/master
fix data type converting for num-types
2018-04-08 21:08:27 +01:00
mbalous
a99ea469ce Correct exceptions. Constructor parameter checking. 2018-03-21 22:40:25 +01:00
mbalous
dd71e1bf0b Checking constructor parameters. 2018-03-21 22:32:23 +01:00
mbalous
530072b70f Improved XML function comments. 2018-03-21 22:18:37 +01:00
Thomas Ze
117ad5cd1b fix variable length bug for StringEx 2018-03-20 22:37:44 +01:00
Thomas Ze
7cedec5909 - fix data type converting
- add new string string data type
2018-03-18 21:26:22 +01:00
Michele Cattafesta
f6a2e11045 0.1.8 v0.1.8 2018-02-05 20:07:11 +00:00
Michele Cattafesta
8005304827 Merge pull request #97 from GS770/master
Added Bit to Types
2017-12-14 23:00:19 +00:00
shen.jz
ef5e060948 Added Bit to Types
get bool or BitArray from byte array
2017-12-14 10:38:10 +08:00
Michele Cattafesta
3178d2aa09 Merge pull request #96 from GS770/master
Get bit of read bytes
2017-12-13 08:57:52 +00:00
shen.jz
6a2bc708a9 Get bit of read bytes 2017-12-12 15:56:18 +08:00
Michele Cattafesta
ea84cd414f Fix UWP build v0.1.7 2017-09-14 18:26:49 +01:00
Michele Cattafesta
ad98783888 Added one more test 2017-09-14 18:20:06 +01:00
Michele Cattafesta
cddb826053 Fix V0.1.6 bit write to DB don't work #91 2017-09-14 18:16:35 +01:00
Michele Cattafesta
61ebfca0c2 Nuget 0.1.6 v0.1.6 2017-09-05 20:25:26 +01:00
Michele Cattafesta
9a9231d6d3 Update README.md 2017-08-31 21:17:31 +01:00
Michele Cattafesta
9f3de01911 Update README.md 2017-08-31 21:17:17 +01:00
Michele Cattafesta
e0ba394bf7 Png for wiki 2017-08-31 20:59:39 +01:00
Michele Cattafesta
03ff8bda8e Merge pull request #89 from uknickwilliams/atomic-bit-writing
Support atomic bit writing protocol, instead of read-modify-write
2017-08-31 20:43:55 +01:00