You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@plc4x.apache.org by cd...@apache.org on 2022/09/18 13:23:11 UTC

[plc4x] branch develop updated: docs(plc4j/ads): Updated the statemachine for ADS

This is an automated email from the ASF dual-hosted git repository.

cdutz pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/plc4x.git


The following commit(s) were added to refs/heads/develop by this push:
     new c0e73c9c2 docs(plc4j/ads): Updated the statemachine for ADS
c0e73c9c2 is described below

commit c0e73c9c20a896c9be0fcaa8d0b715fe482f5fa6
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Sun Sep 18 15:23:02 2022 +0200

    docs(plc4j/ads): Updated the statemachine for ADS
---
 protocols/ads/src/site/asciidoc/protocol.adoc      | 110 ------------
 .../developers/protocols/ads/protocol.adoc         | 198 +++++++++++++++++++++
 src/site/site.xml                                  |   3 +
 3 files changed, 201 insertions(+), 110 deletions(-)

diff --git a/protocols/ads/src/site/asciidoc/protocol.adoc b/protocols/ads/src/site/asciidoc/protocol.adoc
deleted file mode 100644
index bf054fde8..000000000
--- a/protocols/ads/src/site/asciidoc/protocol.adoc
+++ /dev/null
@@ -1,110 +0,0 @@
-//
-//  Licensed to the Apache Software Foundation (ASF) under one or more
-//  contributor license agreements.  See the NOTICE file distributed with
-//  this work for additional information regarding copyright ownership.
-//  The ASF licenses this file to You under the Apache License, Version 2.0
-//  (the "License"); you may not use this file except in compliance with
-//  the License.  You may obtain a copy of the License at
-//
-//      https://www.apache.org/licenses/LICENSE-2.0
-//
-//  Unless required by applicable law or agreed to in writing, software
-//  distributed under the License is distributed on an "AS IS" BASIS,
-//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//  See the License for the specific language governing permissions and
-//  limitations under the License.
-//
-
-== Beckhoff ADS Protocol
-
-// https://plantuml.com/de/activity-diagram-legacy
-// https://deepu.js.org/svg-seq-diagram/Reference_Guide.pdf
-
-[plantuml,ads-statemachine,svg,opts="inline",svg-type="inline"]
-----
-@startuml
-
-(*) --> Connect
-
-partition Connect {
-    (*) --> "initializing"
-    if "Using Authentication?" then
-        -->[true] "Send 'Add Or Update AMS Routes'"
-    else
-        -->[false] ===Connected===
-    endif
-    "Send 'Add Or Update AMS Routes'" ..> "Receive 'Add Or Update AMS Routes'"
-    "Receive 'Add Or Update AMS Routes'" --> "Send 'ADS Read Device Info'"
-    "Send 'ADS Read Device Info'" ..> "Receive 'ADS Read Device Info'"
-    if "Config: Load Symbol- and Data-Type-Tables?" then
-        -->[true] "Send 'Read Symbol- and Data-Type-Table sizes'"
-    else
-        -->[false] ===Connected===
-    endif
-    "Send 'Read Symbol- and Data-Type-Table sizes'" ..> "Receive 'Read Symbol- and Data-Type-Table sizes'"
-    "Receive 'Read Symbol- and Data-Type-Table sizes'" --> "Send 'Read Data-Type-Table'"
-    "Send 'Read Data-Type-Table'" ..> "Receive 'Read Data-Type-Table'"
-    "Receive 'Read Data-Type-Table'" --> "Send 'Read Symbol-Table'"
-    "Send 'Read Symbol-Table'" ..> "Receive 'Read Symbol-Table'"
-    "Receive 'Read Symbol-Table'" --> ===Connected===
-}
-
-===Connected=== -->[API Browse Request] Browse
-
-partition Browse {
-    if "Is symbol- and data-type-table loaded?" then
-        -->[true] "Return API Browse Result"
-    else
-        -->[false] "Do something"
-        "Do something" --> "Return API Browse Result"
-    endif
-    "Return API Browse Result" --> ===Connected===
-}
-
-===Connected=== -->[API Read Request] Read
-
-partition Read {
-    if "Is single item read request?" then
-        if "Are all field addresses resolved?" then
-            -->[true] "Send 'Multi Item Address Resolution'"
-            "Send 'Multi Item Address Resolution'" --> "Receive 'Multi Item Address Resolution'"
-            "Receive 'Multi Item Address Resolution'" --> "Send 'Multi Item Read'"
-        else
-            -->[false] "Send 'Multi Item Read'"
-        endif
-        "Send 'Multi Item Read'" ..> "Receive 'Multi Item Read'"
-        "Receive 'Multi Item Read'" --> "Return API Read Result"
-    else
-        if "Is the field address resolved?" then
-            -->[true] "Send 'Single Item Address Resolution'"
-            "Send 'Single Item Address Resolution'" --> "Receive 'Single Item Address Resolution'"
-            "Receive 'Single Item Address Resolution'" --> "Send 'Single Item Read'"
-        else
-            -->[false] "Send 'Single Item Read'"
-        endif
-        "Send 'Single Item Read'" ..> "Receive 'Single Item Read'"
-        "Receive 'Single Item Read'" --> "Return API Read Result"
-    endif
-    "Return API Read Result" --> ===Connected===
-}
-
-===Connected=== -->[API Write Request] Write
-
-partition Write {
-    WriteTest --> ===Connected===
-}
-
-===Connected=== -->[API Subscription Request] Subscribe
-
-partition Subscribe {
-    SubscribeTest --> ===Connected===
-}
-
-===Connected=== -->[API Unsubscription Request] Unsubscribe
-
-partition Unsubscribe {
-    UnsubscribeTest --> ===Connected===
-}
-
-@enduml
-----
\ No newline at end of file
diff --git a/src/site/asciidoc/developers/protocols/ads/protocol.adoc b/src/site/asciidoc/developers/protocols/ads/protocol.adoc
new file mode 100644
index 000000000..d71aa7903
--- /dev/null
+++ b/src/site/asciidoc/developers/protocols/ads/protocol.adoc
@@ -0,0 +1,198 @@
+//
+//  Licensed to the Apache Software Foundation (ASF) under one or more
+//  contributor license agreements.  See the NOTICE file distributed with
+//  this work for additional information regarding copyright ownership.
+//  The ASF licenses this file to You under the Apache License, Version 2.0
+//  (the "License"); you may not use this file except in compliance with
+//  the License.  You may obtain a copy of the License at
+//
+//      https://www.apache.org/licenses/LICENSE-2.0
+//
+//  Unless required by applicable law or agreed to in writing, software
+//  distributed under the License is distributed on an "AS IS" BASIS,
+//  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//  See the License for the specific language governing permissions and
+//  limitations under the License.
+//
+
+== Beckhoff ADS Protocol
+
+// https://plantuml.com/de/activity-diagram-legacy
+// https://deepu.js.org/svg-seq-diagram/Reference_Guide.pdf
+
+[plantuml,ads-statemachine,svg,opts="inline",svg-type="inline"]
+----
+@startuml
+
+(*) --> Connect
+
+partition "Connected" #EEEEEE {
+    ===Connected=== -->[API Browse Request] Browse
+    ===Connected=== -->[API Read Request] Read
+    ===Connected=== -->[API Write Request] Write
+    ===Connected=== -->[API Subscription Request] Subscribe
+    ===Connected=== -->[API Unsubscription Request] Unsubscribe
+}
+
+partition Connect #EEEECC {
+    (*) --> "initializing"
+    if "Using Authentication?" then
+        -->[true] "Send 'Add Or Update AMS Routes'"
+    else
+        -->[false] "Send 'ADS Read Device Info'"
+    endif
+    "Send 'Add Or Update AMS Routes'" ..> "Receive 'Add Or Update AMS Routes'"
+    "Receive 'Add Or Update AMS Routes'" --> "Send 'ADS Read Device Info'"
+    "Send 'ADS Read Device Info'" ..> "Receive 'ADS Read Device Info'"
+    if "Config: Monitor PLC changes?" then
+        -->[true] "Init Read Online and Offline Version"
+    else
+        -->[false] "Reset Symbol and Data-Type Data"
+    endif
+    "Init Read Online and Offline Version" --> "Send 'Read Online-Version (Symbolic)'"
+    "Init Read Online and Offline Version" --> "Send 'Read Offline-Version'"
+    "Send 'Read Online-Version (Symbolic)'" ..> "Receive 'Read Online-Version (Symbolic)'"
+    "Receive 'Read Online-Version (Symbolic)'" --> ===OnlineAndOfflineVersionRead===
+    "Send 'Read Offline-Version'" ..> "Receive 'Read Offline-Version'"
+    "Receive 'Read Offline-Version'" --> ===OnlineAndOfflineVersionRead===
+    ===OnlineAndOfflineVersionRead=== --> "Reset Symbol and Data-Type Data"
+    if "Config: Load Symbol- and Data-Type-Tables?" then
+        -->[true] "Send 'Read Symbol- and Data-Type-Table sizes'"
+    else
+        -->[false] ===FinishedReadingSymbolAndDataTypeTable===
+    endif
+    "Send 'Read Symbol- and Data-Type-Table sizes'" ..> "Receive 'Read Symbol- and Data-Type-Table sizes'"
+    "Receive 'Read Symbol- and Data-Type-Table sizes'" --> "Send 'Read Data-Type-Table'"
+    "Send 'Read Data-Type-Table'" ..> "Receive 'Read Data-Type-Table'"
+    "Receive 'Read Data-Type-Table'" --> ===FinishedReadingSymbolAndDataTypeTable===
+    "Receive 'Read Symbol- and Data-Type-Table sizes'" --> "Send 'Read Symbol-Table'"
+    "Send 'Read Symbol-Table'" ..> "Receive 'Read Symbol-Table'"
+    "Receive 'Read Symbol-Table'" --> ===FinishedReadingSymbolAndDataTypeTable===
+    if "Config: Monitor PLC changes?" then
+        -right->[true] "Subscribe to changes to the Online- and Offline Version"#EECCEE
+    endif
+    "Subscribe to changes to the Online- and Offline Version" ..>[Update the online- or offline version (Depending on wich one changed)] "Reset Symbol and Data-Type Data"
+    ===FinishedReadingSymbolAndDataTypeTable=== --> ===Connected===
+}
+
+partition Browse #CCCCEE {
+    "Browse" --> ===BrowseStart===
+    if "Is symbol- and data-type-table loaded?" then
+        -->[true] ===BrowseFinishedReadingSymbolAndDataTypeTable===
+    else
+        -->[false] "Browse: Send 'Read Symbol- and Data-Type-Table sizes'"
+        "Browse: Send 'Read Symbol- and Data-Type-Table sizes'" ..> "Browse: Receive 'Read Symbol- and Data-Type-Table sizes'"
+        "Browse: Receive 'Read Symbol- and Data-Type-Table sizes'" --> "Browse: Send 'Read Data-Type-Table'"
+        "Browse: Send 'Read Data-Type-Table'" ..> "Browse: Receive 'Read Data-Type-Table'"
+        "Browse: Receive 'Read Data-Type-Table'" --> ===BrowseFinishedReadingSymbolAndDataTypeTable===
+        "Browse: Receive 'Read Symbol- and Data-Type-Table sizes'" --> "Browse: Send 'Read Symbol-Table'"
+        "Browse: Send 'Read Symbol-Table'" ..> "Browse: Receive 'Read Symbol-Table'"
+        "Browse: Receive 'Read Symbol-Table'" --> ===BrowseFinishedReadingSymbolAndDataTypeTable===
+    endif
+    ===BrowseFinishedReadingSymbolAndDataTypeTable=== --> "Return API Browse Result"
+    "Return API Browse Result" --> ===Connected===
+}
+
+partition Read #CCEECC {
+    "Read" --> ===ReadStart===
+    if "Is single item read request?" then
+        -->[false] if "Are all field addresses resolved?" then
+            -->[unresolved] "Read: Send 'Multi Item Address Resolution' for unresolved"
+            "Read: Send 'Multi Item Address Resolution' for unresolved" ..> "Read: Receive 'Multi Item Address Resolution' for unresolved"
+            "Read: Receive 'Multi Item Address Resolution' for unresolved" --> ===ReadAllItemsResolved===
+        else
+            -->[resolved] ===ReadAllItemsResolved===
+        endif
+        ===ReadAllItemsResolved=== --> "Read: Send 'Multi Item Read'"
+        "Read: Send 'Multi Item Read'" ..> "Read: Receive 'Multi Item Read'"
+        "Read: Receive 'Multi Item Read'" --> "Read: Return API Read Result"
+    else
+        -->[true] if "Is the field address resolved?" then
+            -->[false] "Read: Send 'Single Item Address Resolution'"
+            "Read: Send 'Single Item Address Resolution'" ..> "Read: Receive 'Single Item Address Resolution'"
+            "Read: Receive 'Single Item Address Resolution'" --> "Read: Send 'Single Item Read'"
+        else
+            -->[true] "Read: Send 'Single Item Read'"
+        endif
+        "Read: Send 'Single Item Read'" ..> "Read: Receive 'Single Item Read'"
+        "Read: Receive 'Single Item Read'" --> "Read: Return API Read Result"
+    endif
+    "Read: Return API Read Result" --> ===Connected===
+}
+
+partition Write #EECCCC {
+    "Write" --> ===WriteStart===
+    if "Is single item write request?" then
+        -->[false] if "Are all field addresses resolved?" then
+            -->[unresolved] "Write: Send 'Multi Item Address Resolution' for unresolved"
+            "Write: Send 'Multi Item Address Resolution' for unresolved" ..> "Write: Receive 'Multi Item Address Resolution' for unresolved"
+            "Write: Receive 'Multi Item Address Resolution' for unresolved" --> ===WriteAllItemsResolved===
+        else
+            -->[resolved] ===WriteAllItemsResolved===
+        endif
+        ===WriteAllItemsResolved=== --> "Write: Send 'Multi Item Write'"
+        "Write: Send 'Multi Item Write'" ..> "Write: Receive 'Multi Item Write'"
+        "Write: Receive 'Multi Item Write'" --> "Write: Return API Write Result"
+    else
+        -->[true] if "Is the field address resolved?" then
+            -->[false] "Write: Send 'Single Item Address Resolution'"
+            "Write: Send 'Single Item Address Resolution'" ..> "Write: Receive 'Single Item Address Resolution'"
+            "Write: Receive 'Single Item Address Resolution'" --> "Write: Send 'Single Item Write'"
+        else
+            -->[true] "Write: Send 'Single Item Write'"
+        endif
+        "Write: Send 'Single Item Write'" ..> "Write: Receive 'Single Item Write'"
+        "Write: Receive 'Single Item Write'" --> "Write: Return API Write Result"
+    endif
+    "Write: Return API Write Result" --> ===Connected===
+}
+
+partition Subscribe #EECCEE {
+    "Subscribe" --> ===SubscribeStart===
+    if "Is single item subscription request?" then
+        -->[false] if "Are all field addresses resolved?" then
+            -->[unresolved] "Subscribe: Send 'Multi Item Address Resolution' for unresolved"
+            "Subscribe: Send 'Multi Item Address Resolution' for unresolved" ..> "Subscribe: Receive 'Multi Item Address Resolution' for unresolved"
+            "Subscribe: Receive 'Multi Item Address Resolution' for unresolved" --> ===SubscribeAllItemsResolved===
+        else
+            -->[resolved] ===SubscribeAllItemsResolved===
+        endif
+    else
+        -->[true] if "Is the field address resolved?" then
+            -->[false] "Subscribe: Send 'Single Item Address Resolution'"
+            "Subscribe: Send 'Single Item Address Resolution'" ..> "Subscribe: Receive 'Single Item Address Resolution'"
+            "Subscribe: Receive 'Single Item Address Resolution'" --> ===SubscribeAllItemsResolved===
+        else
+            -->[true] ===SubscribeAllItemsResolved===
+        endif
+        ===SubscribeAllItemsResolved=== --> "Subscribe: Send 'Single Item 1 Subscibe'"
+        "Subscribe: Send 'Single Item 1 Subscibe'" ..> "Subscribe: Receive 'Single Item 1 Subscibe'"
+        "Subscribe: Receive 'Single Item 1 Subscibe'" --> ===SubscribeAllItemsSubscribed===
+        ===SubscribeAllItemsResolved=== --> "Subscribe: Send 'Single Item 2 Subscibe'"
+        "Subscribe: Send 'Single Item 2 Subscibe'" ..> "Subscribe: Receive 'Single Item 2 Subscibe'"
+        "Subscribe: Receive 'Single Item 2 Subscibe'" --> ===SubscribeAllItemsSubscribed===
+        ===SubscribeAllItemsResolved=== --> "Subscribe: Send 'Single Item n Subscibe'"
+        "Subscribe: Send 'Single Item n Subscibe'" ..> "Subscribe: Receive 'Single Item n Subscibe'"
+        "Subscribe: Receive 'Single Item n Subscibe'" --> ===SubscribeAllItemsSubscribed===
+        ===SubscribeAllItemsSubscribed=== --> "Subscribe: Return API Write Result"
+    endif
+    "Subscribe: Return API Write Result" --> ===Connected===
+}
+
+partition Unsubscribe #LightSkyBlue {
+    "Unsubscribe" --> ===UnsubscribeStart===
+    ===UnsubscribeStart=== --> "Unsubscribe: Send 'Single Item 1 Unsubscribe'"
+    "Unsubscribe: Send 'Single Item 1 Unsubscribe'" ..> "Unsubscribe: Receive 'Single Item 1 Unsubscribe'"
+    "Unsubscribe: Receive 'Single Item 1 Unsubscribe'" --> ===UnsubscribeAllItemsUnsubscribed===
+    ===UnsubscribeStart=== --> "Unsubscribe: Send 'Single Item 2 Unsubscribe'"
+    "Unsubscribe: Send 'Single Item 2 Unsubscribe'" ..> "Unsubscribe: Receive 'Single Item 2 Unsubscribe'"
+    "Unsubscribe: Receive 'Single Item 2 Unsubscribe'" --> ===UnsubscribeAllItemsUnsubscribed===
+    ===UnsubscribeStart=== --> "Unsubscribe: Send 'Single Item n Unsubscribe'"
+    "Unsubscribe: Send 'Single Item n Unsubscribe'" ..> "Unsubscribe: Receive 'Single Item n Unsubscribe'"
+    "Unsubscribe: Receive 'Single Item n Unsubscribe'" --> ===UnsubscribeAllItemsUnsubscribed===
+    ===UnsubscribeAllItemsUnsubscribed=== --> "Unsubscribe: Return API Unsubscribe Result"
+    "Unsubscribe: Return API Unsubscribe Result" --> ===Connected===
+}
+
+@enduml
+----
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
index e2657eba9..266f05972 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -124,6 +124,9 @@
         <item name="Language: Apache Freemarker" href="developers/code-gen/language/freemarker.html"/>
         <item name="Example: DF1 MSpec" href="developers/code-gen/protocol/df1.html"/>
       </item>
+      <item name="Protocols" href="developers/protocols/index.html">
+        <item name="ADS/AMS" href="developers/protocols/ads/protocol.html"/>
+      </item>
       <item name="Infrastructure" href="developers/infrastructure/index.html">
         <item name="Continuous Integration" href="developers/infrastructure/ci.html"/>
         <item name="Bug &amp; Issue Tracker" href="developers/infrastructure/issues.html"/>