This is an automated email from the ASF dual-hosted git repository. cdutz pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git
The following commit(s) were added to refs/heads/master by this push: new 5487a32 Added some more content on the S7 Comm Plus protocol 5487a32 is described below commit 5487a324d38aaaa2a5896d3bc196ddccff6f330d Author: Christofer Dutz <christofer.d...@c-ware.de> AuthorDate: Tue Feb 27 17:21:43 2018 +0100 Added some more content on the S7 Comm Plus protocol --- src/site/asciidoc/protocols/s7/s7comm-plus.adoc | 78 ++++++++++++++++++++++++- src/site/asciidoc/protocols/s7/s7comm.adoc | 6 +- 2 files changed, 80 insertions(+), 4 deletions(-) diff --git a/src/site/asciidoc/protocols/s7/s7comm-plus.adoc b/src/site/asciidoc/protocols/s7/s7comm-plus.adoc index 45cffc8..4b41eda 100644 --- a/src/site/asciidoc/protocols/s7/s7comm-plus.adoc +++ b/src/site/asciidoc/protocols/s7/s7comm-plus.adoc @@ -18,6 +18,82 @@ == S7 Comm Plus (0x72) -==== General +The `S7 Comm Plus` protocol is a new version of the original `S7 Comm` protocol. +While a `S7 Comm` packet is identified, by the magic byte `0x32`, the `S7 Comm Plus` packet uses the magic byte `0x72`. +The End of a packet is indicated by a frame end sequence of 6 bytes: 00 00 72 01 00 00 + +The general structure of the protocols content however is completely different and far less documented. + +The biggest source for getting started in implementing this protocol was the https://os-s.de/thesis/MA_Maik_Brueggemann.pdf[Master Thesis of Maik Brüggemann]. +However this only covered the basic structure of a `S7 Comm Plus` packet. + +=== General Structure of a Packet + +[packetdiag,s7-comm-plus-packet,svg] +.... +{ + colwidth = 32 + + // ISO on TCP + * ISO on TCP Magic Number (0x03) [len = 8, color = "#068D9D"] + * Reserved (0x00) [len = 8, color = "#068D9D"] + * Packet Length (including ISO on TCP header) [len = 16, color = "#068D9D"] + + // ISO Transport Protocol + * ISO TP Header Length\n(excluding length byte) [len = 8, color = "#53599A"] + * TPDU-Code\n(Data = 0xF0) [len = 4, color = "#AEECEF"] + * Signal CDT\n(0x00) [len = 4, color = "#53599A"] + * TPDU-NR/EOT [len = 8, color = "#53599A"] + + // S7 Comm Plus + * S7 Comm Plus Protocol Magic Byte\n(0x72) [len = 8, color = "#6D9DC5"] + * Version (0x01) [len = 8, color = "#6D9DC5"] + * Length\n(including length bytes excluding frame boundary) [len = 16, color = "#6D9DC5"] + * Type [len = 8, color = "#6D9DC5"] + * Reserved (0x0000) [len = 16, color = "#6D9DC5"] + * Sub-Type [len = 16, color = "#6D9DC5"] + * Sequence Number [len = 32, color = "#6D9DC5"] + // Undocumented constant sequence + * 00 00 01 20 [len = 32] + * 36 00 00 01 [len = 32] + * 1d 00 04 00 [len = 32] + * 00 00 00 00 [len = 32] + * a1 00 00 00 [len = 32] + * d3 82 1f 00 [len = 32] + * 00 [len = 8] + + // Parameters + * Attribute Block Magic Byte\n(0xA3) [len = 8, color = "#00FF80"] + * Attribute Id (Type) [len = 8, color = "#00FF80"] + * Format [len = 8, color = "#00FF80"] + * Data Type [len = 8, color = "#00FF80"] + * Length [len = 8, color = "#00FF80"] + * Attribute Value [len = 56, color = "#00FF80"] + + // Parameters + * Attribute Block Magic Byte\n(0xA3) [len = 8, color = "#0080FF"] + * Attribute Id (Type) [len = 8, color = "#0080FF"] + * Format [len = 8, color = "#0080FF"] + * Data Type [len = 8, color = "#0080FF"] + * Length [len = 8, color = "#0080FF"] + * Attribute Value [len = 56, color = "#0080FF"] + + // Parameters + * Attribute Block Magic Byte\n(0xA3) [len = 8, color = "#00FF80"] + * Attribute Id (Type) [len = 8, color = "#00FF80"] + * Format [len = 8, color = "#00FF80"] + * Data Type [len = 8, color = "#00FF80"] + * Length [len = 8, color = "#00FF80"] + * Attribute Value [len = 56, color = "#00FF80"] + + // Frame End + * Reserved (0x0000) [len = 16, color = "#FF3399"] + * S7 Comm Plus Protocol Magic Byte\n(0x72) [len = 8, color = "#FF3399"] + * Version (0x01) [len = 8, color = "#FF3399"] + * Reserved (0x0000) [len = 16, color = "#FF3399"] + +} +.... + ... diff --git a/src/site/asciidoc/protocols/s7/s7comm.adoc b/src/site/asciidoc/protocols/s7/s7comm.adoc index a3996f9..bb011f2 100644 --- a/src/site/asciidoc/protocols/s7/s7comm.adoc +++ b/src/site/asciidoc/protocols/s7/s7comm.adoc @@ -18,7 +18,7 @@ == S7 Comm (0x32) -==== General +=== General While a lot of information was available on the general structure of S7 communication, only little information was available on the constant values this protocol uses. If information was available, this was mostly provided with a GPL license and therefore was disqualified for being used in this project. @@ -30,7 +30,7 @@ As soon as a valid value was found the tool then output the detected constant va The tool for generating this is located in the `plc4j/protocols/s7-utils` project. -==== Structure of a Setup Communication Request +=== Structure of a Setup Communication Request [packetdiag,s7-setup-communication-request,svg] .... @@ -78,7 +78,7 @@ Legend: - [protocolId]#Part of the packet that identifies the type of request# - [protocolParameter]#Variable Parts of the ISO Transport Protocol Packet Header# -==== Structure of a Setup Communication Response +=== Structure of a Setup Communication Response The `Setup Communication Response` is identical to the `Setup Communication Request` with the only difference that the `Message Type` has an ACK_DATA code of `0x03`. -- To stop receiving notification emails like this one, please contact cd...@apache.org.