Closed rapha-dev closed 6 years ago
This probably also relates to open issue for PR #133.
Increasing the TPDU to maximum of 1024 bytes
We're negotiating 1920 byte PDU, so maybe we should increase to 2048. Also, the ISO over TCP spec states the default is 65355 bytes IIRC, which means we could possibly zero out the PDU size entirely. We should really have access to all supported PLC's to verify these changes though.
You are right, I have made some tests using different sizes up to 2^15, using 2^11 should be sufficient to support max PDU on all available PLCs.
I have noticed all tests negotiated a TPDU of 1024 bytes when requesting a higher value (e.g. 2048).
Merged into develop
.
Possible bug in COTP CR when connecting to a S7-1500, TPDU is too small (actually 512 bytes). Any Read resulting in
actualPDU + COTPHeader > TPDU
(which is 957 + 3 = 960 > 512) will fail (Socket disconnects).Maximum Bytes of 491 would work: 509 + 3 = 512 > 512
For reference: PLC4X
Increasing the TPDU to maximum of 1024 bytes (still need to check on S7-300, 400 and 1200) will allow to read an unspecified maximum of bytes as PDUs will be split into multiple PDUs with maximum size.
I will create a PR for this and need some testing.