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 2018/08/14 14:33:34 UTC

[incubator-plc4x] branch master updated (49cd675 -> 5877abe)

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

cdutz pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-plc4x.git.


    from 49cd675  Merge branch 'DerDackel-s7_azure_iothub_example'
     new d2035b3  Created a first version of a S7DataType enum to help with the TIA portal type addresses.
     new 5877abe  - Worked on the documentation of how to get involved and where to meet the community (or part of it) - Fixed the links in the community menu.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../plc4x/java/s7/types/S7ControllerType.java}     |  15 +-
 .../org/apache/plc4x/java/s7/types/S7DataType.java | 155 +++++++++++++++++++++
 .../types/S7DataTypeTest.java}                     |  41 +++---
 src/site/asciidoc/community/conferences.adoc       |  24 ++--
 src/site/asciidoc/community/getting-involved.adoc  |  62 ++++++++-
 .../resources/img/community-contribute-fork.png    | Bin 0 -> 195211 bytes
 src/site/site.xml                                  |   4 +-
 7 files changed, 259 insertions(+), 42 deletions(-)
 copy plc4j/{api/src/main/java/org/apache/plc4x/java/api/types/ResponseCode.java => protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7ControllerType.java} (85%)
 create mode 100644 plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7DataType.java
 copy plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/{isotp/netty/model/params/TsapParameterTests.java => s7/types/S7DataTypeTest.java} (51%)
 create mode 100644 src/site/resources/img/community-contribute-fork.png


[incubator-plc4x] 02/02: - Worked on the documentation of how to get involved and where to meet the community (or part of it) - Fixed the links in the community menu.

Posted by cd...@apache.org.
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

commit 5877abed7a0a1c5a76fe2e8dc547c141402e9943
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Aug 14 16:33:30 2018 +0200

    - Worked on the documentation of how to get involved and where to meet the community (or part of it)
    - Fixed the links in the community menu.
---
 src/site/asciidoc/community/conferences.adoc       |  24 ++++----
 src/site/asciidoc/community/getting-involved.adoc  |  62 ++++++++++++++++++++-
 .../resources/img/community-contribute-fork.png    | Bin 0 -> 195211 bytes
 src/site/site.xml                                  |   4 +-
 4 files changed, 76 insertions(+), 14 deletions(-)

diff --git a/src/site/asciidoc/community/conferences.adoc b/src/site/asciidoc/community/conferences.adoc
index 9e14a8d..f86825a 100644
--- a/src/site/asciidoc/community/conferences.adoc
+++ b/src/site/asciidoc/community/conferences.adoc
@@ -17,20 +17,22 @@
 
 == Conferences
 
-On this page we are listing options to attend talks dealing with PLC4X.
+On this page we are listing options to attend talks and events around PLC4X.
 
-[width="100%",cols="4,^2,^2,^3,3",options="header"]
+[width="100%",cols="2,^2,2,^2,^3",options="header"]
 |=========================================================
-|Date |Location |Event |Title |Speaker
-
-|5th April 2018 |Hamburg |https://techcamp.hamburg/[TechCamp Hamburg] |https://techcamp.hamburg/events/revolutionizing-industrial-iot-with-apache-plc4x/[Revolutionizing Industrial IoT with Apache PLC4X] |Christofer Dutz
-
-|4th June 2018 |Colone |https://www.buildingiot.de/[Building IoT] |https://www.buildingiot.de/veranstaltung-6815-industrial-iot-und-edge-computing-mit-apache-plc4x-und-apache-edgent-%5Bsponsored-talk%5D.html?id=6815[Industrial IoT und Edge Computing mit Apache PLC4X und Apache Edgent] |Christofer Dutz
-
-|13th-14th June 2018 |Berlin |http://www.apachecon.com/euroadshow18/#[Apache EU Roadshow] |Revolutionizing the production industry with Apache PLC4X |Christofer Dutz
-
+|Date |Location |Type |Event | Title
+|21 January 2018 |Hamburg (GER) |Conference |https://www.nortec-hamburg.de/[Nortec] |Mehr für Weniger? Aber Sicher!
+|5th April 2018 |Hamburg (GER) |Conference |https://techcamp.hamburg/[TechCamp Hamburg] |https://techcamp.hamburg/events/revolutionizing-industrial-iot-with-apache-plc4x/[Revolutionizing Industrial IoT with Apache PLC4X]
+|4th June 2018 |Cologne (GER) |Conference |https://www.buildingiot.de/[Building IoT] |https://www.buildingiot.de/veranstaltung-6815-industrial-iot-und-edge-computing-mit-apache-plc4x-und-apache-edgent-%5Bsponsored-talk%5D.html?id=6815[Industrial IoT und Edge Computing mit Apache PLC4X und Apache Edgent]
+|13th-14th June 2018 |Berlin (GER) |Conference |http://www.apachecon.com/euroadshow18/#[Apache EU Roadshow] |https://foss-backstage.de/session/revolutionizing-production-industry-apache-plc4x[Revolutionizing the production industry with Apache PLC4X]
+|20th September 2018 |Nürtingen (GER) |Meetup |PLC4X Meetup |First general committer meetup
+|24th-19th September 2018 |Montreal (CAN) |Conference |http://apachecon.com/acna18/?ref=apachecon.com[ApacheCon NA 2018] |https://apachecon.dukecon.org/acna/2018/#/scheduledEvent/51feeb6f55f250c39[Revolutionizing the Production Industry with Apache PLC4X (incubating)]
+|22th-24th October 2018 |Edinburgh (GB) |Conference |https://events.linuxfoundation.org/events/open-source-summit-europe-2018/[Open-Source Summit Europe] |Revolutionizing the production industry with Apache PLC4X
+|12th-13th November 2018 |Berlin (GER) |Conference |https://www.sv-veranstaltungen.de/fachbereiche/big-data-3/[3. Fachkonferenz: Industrial Analytics & Big Data in der Industrie] |Kommunikation mit Industrieanlagen ohne Umbau- und Lizenzkosten
+|15th November 2018 |Düsseldorf (GER) |Meetup |RheinJUG |http://www.rheinjug.de/rheinjug/event/2018/11/15/wie-wir-mit-apache-plc4x-die-silos-in-der-automatisierungsindustrie-aufbrechen.html[Wie wir mit Apache PLC4X die Silos in der Automatisierungsindustrie aufbrechen]
 |=========================================================
 
 Looking forward to meeting you.
 
-If you've got or found any talks we might be missing, please inform us on dev@plc4x.apache.org.
+If you've got or found any events or talks we might be missing, please inform us on dev@plc4x.apache.org.
diff --git a/src/site/asciidoc/community/getting-involved.adoc b/src/site/asciidoc/community/getting-involved.adoc
index ac8420a..fd2b740 100644
--- a/src/site/asciidoc/community/getting-involved.adoc
+++ b/src/site/asciidoc/community/getting-involved.adoc
@@ -14,10 +14,14 @@
 //  See the License for the specific language governing permissions and
 //  limitations under the License.
 //
+:imagesdir: ../img/
 
 == Getting Involved
 
 Being a fairly fresh project we know there is a lot to do.
+
+=== Areas of contribution
+
 If you are looking for a way to get involved, we have compiled a list of areas, where we are looking for help.
 
 If you find something you think you could help out with, please come forward and introduce yourself and tell us about your plans on our mailinglist: dev@plc4x.apache.org.
@@ -25,12 +29,16 @@ If you find something you think you could help out with, please come forward and
 Possible Areas of contribution (These are the ones we discussed, but this list is definitely not complete):
 
 * Protocol Implementations:
-** OPC-UA
+** Beckhoff ADS
+** EtherNet/IP
 ** Modbus
+** OPC-UA
 ** Profinet
+** S7
 ** ...
 * Integrations:
 ** Kafka Connect
+** Apache Nifi
 ** ...
 * Languages:
 ** Scala (Maybe just a wrapper)
@@ -40,3 +48,55 @@ Possible Areas of contribution (These are the ones we discussed, but this list i
 ** JavaScript
 ** TypeScript
 ** ...
+
+=== How to get involved
+
+==== Mailinglist
+
+If it's information you have and you want to inform us about something or are in need of information, the mailinglist is probably your best option.
+
+In order to sign up, just send an empty email to dev-subscribe@plc4x.apache.org and as soon as you are subscribed, send what you want to dev@plc4x.apache.org.
+
+You can always read the mailinglist content via our Apache list archive here: https://lists.apache.org/list.html?dev@plc4x.apache.org
+
+We're a friendly bunch, so don't be afraid :-)
+
+==== Jira
+
+Another option to contribute is via Jira.
+
+Here you can create bug reports, feature requests, and so on.
+
+Our Jira instance is located here: https://issues.apache.org/jira/projects/PLC4X/issues
+
+In order to create, edit and comment issues, you need to create a login.
+
+If you are willing to become an active part of PLC4X and the Apache family, we suggest you use your Jira name as you would your Apache username.
+Unfortunately Jira and the rest of Apache have different user bases. You can check if your desired apache user id is already taken here: http://people.apache.org/committer-index.html
+Having the same id on both systems makes it easier to manage for us ... and you.
+
+Here we have also tagged some issues with tags like: 'easy-fix'
+
+==== GitHub
+
+GitHub is currently our preferred way of getting new coders involved.
+Even if you could also create Jira Issues and attach patch files to these, it is far simpler to check and merge your changes if they come from GitHub.
+
+In order to start contributing code, we suggest you make sure you are logged in with a valid GitHub account and visit our GitHub repository clone at: https://github.com/apache/incubator-plc4x
+(the primary is on Apache hardware at: https://gitbox.apache.org/repos/asf?p=incubator-plc4x.git)
+
+Here in the top-right, by clicking the `Fork` button, you create a clone of the Apache repository for your user.
+
+image::community-contribute-fork.png[width=600, align=center]
+
+You then have to check-out this freshly cloned repository and can start editing, committing and pushing things back to your clone.
+
+As soon as you are finished with this, all you have to do, is go to the GitHub page of your fork and click on the `New pull Request` button.
+
+On this screen you are asked which branch of your fork you want to have pulled into which branch of the original repository (Usually you just leave the default).
+
+Here you should also provide some information about what your pull request is about and give it a title.
+
+As soon as that's done, someone from the PLC4X team can review your changes and discuss things with you via GitHub.
+
+As soon as all things are settled, we take care of merging the changes back into the official PLC4X repository.
\ No newline at end of file
diff --git a/src/site/resources/img/community-contribute-fork.png b/src/site/resources/img/community-contribute-fork.png
new file mode 100644
index 0000000..b7e8607
Binary files /dev/null and b/src/site/resources/img/community-contribute-fork.png differ
diff --git a/src/site/site.xml b/src/site/site.xml
index e2339a8..6c8411a 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -89,8 +89,8 @@
     </head>
 
     <menu name="Community">
-      <item name="Getting Involved" href="community/help-wanted.adoc"/>
-      <item name="Conferences" href="community/conferences.adoc"/>
+      <item name="Getting Involved" href="community/getting-involved.html"/>
+      <item name="Conferences &amp; Meetups" href="community/conferences.html"/>
     </menu>
     <menu name="Users">
       <item name="Getting Started" href="users/gettingstarted.html"/>


[incubator-plc4x] 01/02: Created a first version of a S7DataType enum to help with the TIA portal type addresses.

Posted by cd...@apache.org.
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

commit d2035b3e9d00b53e13b709d65a55c599c01a222d
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Tue Aug 14 13:14:40 2018 +0200

    Created a first version of a S7DataType enum to help with the TIA portal type addresses.
---
 .../plc4x/java/s7/types/S7ControllerType.java      |  29 ++++
 .../org/apache/plc4x/java/s7/types/S7DataType.java | 155 +++++++++++++++++++++
 .../apache/plc4x/java/s7/types/S7DataTypeTest.java |  57 ++++++++
 3 files changed, 241 insertions(+)

diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7ControllerType.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7ControllerType.java
new file mode 100644
index 0000000..d8c68c7
--- /dev/null
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7ControllerType.java
@@ -0,0 +1,29 @@
+/*
+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
+
+  http://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.
+*/
+package org.apache.plc4x.java.s7.types;
+
+public enum S7ControllerType {
+
+    S7_ANY,
+    S7_300,
+    S7_400,
+    S7_1200,
+    S7_1500
+
+}
diff --git a/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7DataType.java b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7DataType.java
new file mode 100644
index 0000000..a5f8fae
--- /dev/null
+++ b/plc4j/protocols/s7/src/main/java/org/apache/plc4x/java/s7/types/S7DataType.java
@@ -0,0 +1,155 @@
+/*
+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
+
+  http://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.
+*/
+package org.apache.plc4x.java.s7.types;
+
+import java.util.Arrays;
+import java.util.HashSet;
+import java.util.Set;
+
+public enum S7DataType {
+
+    /**
+     * TODO: For the types with code 0x00 we need to put some additional effort in reverse engineering the codes for these types.
+     */
+    BOOL(0x01, "X", null, S7ControllerType.S7_ANY),
+
+    BYTE(0x02, "B", null, S7ControllerType.S7_ANY),
+
+    CHAR(0x03, "B", null, S7ControllerType.S7_ANY),
+
+    WORD(0x04, "W", null, S7ControllerType.S7_ANY),
+    DWORD(0x06, "D", WORD, S7ControllerType.S7_ANY),
+    // Only got a basic TIA license (S7-1500 needed to find this out)
+    LWORD(0x00, null, null, S7ControllerType.S7_1200, S7ControllerType.S7_1500),
+
+    INT(0x05, "W", null, S7ControllerType.S7_ANY),
+    // Double Precision Int
+    DINT(0x07, "D", INT, S7ControllerType.S7_ANY),
+    // Unsigned Small Int
+    USINT(0x00, "B", INT, S7ControllerType.S7_1200, S7ControllerType.S7_1500),
+    // (Signed) Small Int
+    SINT(0x00, "B", INT, S7ControllerType.S7_1200, S7ControllerType.S7_1500),
+    // Unsigned Int
+    UINT(0x00, "W", INT, S7ControllerType.S7_1200, S7ControllerType.S7_1500),
+    // Unsigned Double Precision Int
+    UDINT(0x00, "D", INT, S7ControllerType.S7_1200, S7ControllerType.S7_1500),
+    // Only got a basic TIA license (S7-1500 needed to find this out)
+    UDLINT(0x00, null, INT, S7ControllerType.S7_1500),
+    // Only got a basic TIA license (S7-1500 needed to find this out)
+    LINT(0x00, null, INT, S7ControllerType.S7_1500),
+
+    REAL(0x08, "D", null, S7ControllerType.S7_ANY),
+    // Ok ... this is strange ...
+    LREAL(0x00, "X", REAL, S7ControllerType.S7_1200, S7ControllerType.S7_1500);
+
+    /* TO BE CONTINUED */
+
+    private byte typeCode;
+    private String sizeCode;
+    private Set<S7ControllerType> supportedControllerTypes;
+    private S7DataType baseType;
+
+    S7DataType(int typeCode, String sizeCode, S7DataType baseType, S7ControllerType... supportedControllerTypes) {
+        this.typeCode = (byte) typeCode;
+        this.sizeCode = sizeCode;
+        this.supportedControllerTypes = new HashSet<>(Arrays.asList(supportedControllerTypes));
+        this.baseType = baseType;
+    }
+
+    byte getTypeCode() {
+        return typeCode;
+    }
+
+    public String getSizeCode() {
+        return sizeCode;
+    }
+
+    boolean isBaseType() {
+        return baseType == null;
+    }
+
+    S7DataType getBaseType() {
+        // If this is a base-type itself, the baseType is null, in all
+        // other cases it is set.
+        if (baseType == null) {
+            return this;
+        } else {
+            return baseType;
+        }
+    }
+
+    S7DataType getSubType(String sizeCode) {
+        // Try to find a sub-type with this base type for which the size code matches.
+        for (S7DataType value : values()) {
+            if ((value.baseType == this) && (value.sizeCode != null) && (value.sizeCode.equals(sizeCode))) {
+                return value;
+            }
+        }
+        return null;
+    }
+
+    boolean isControllerTypeSupported(S7ControllerType controllerType) {
+        return supportedControllerTypes.contains(controllerType);
+    }
+
+    /**
+     * This finder method tries to find the correct sub-type for given input.
+     * The algorithm how types are selected is the following:
+     * - If the user provided just a type and no size-code, this type is returned.
+     * - If the user provided a base-type and a size-code, then the algorithm first checks if maybe the base-type
+     * was intentionally requested. Otherwise all sub-types for the same base-type are scanned in search for one
+     * that matches the provided size-code.
+     * - If a sub-type was provided, all we do, is check if the size-code matches
+     *
+     * @param javaType java type used in the request item
+     * @param s7Type   type or sub-type provided (optional)
+     * @param sizeCode size-code provided (optional)
+     * @return best matching type.
+     * @throws IllegalArgumentException no type with matching type and size-code was found.
+     */
+    static S7DataType findMatchingType(Class<?> javaType, S7DataType s7Type, String sizeCode) throws IllegalArgumentException {
+        assert s7Type != null;
+
+        if (javaType != null) {
+
+            if (sizeCode != null) {
+                // If this is a base type, we will try to check if we can select a better fitting sub-type.
+                if (s7Type.isBaseType()) {
+                    S7DataType subType = s7Type.getSubType(sizeCode);
+                    if (subType == null) {
+                        throw new IllegalArgumentException(String.format(
+                            "Selected base type %s does not have a sub-type for provided size code %s", s7Type, sizeCode));
+                    }
+                    s7Type = subType;
+                }
+                // If this is not a base type, we have to check if the sizeCode matches the selected sub-type.
+                else {
+                    if (!s7Type.getSizeCode().equals(sizeCode)) {
+                        throw new IllegalArgumentException(
+                            String.format("Selected data type %s does not match provided size code %s", s7Type, sizeCode));
+                    }
+                }
+            }
+
+        }
+        // TODO: Check compatibility with the java-type.
+        return s7Type;
+    }
+
+}
\ No newline at end of file
diff --git a/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/types/S7DataTypeTest.java b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/types/S7DataTypeTest.java
new file mode 100644
index 0000000..3b22728
--- /dev/null
+++ b/plc4j/protocols/s7/src/test/java/org/apache/plc4x/java/s7/types/S7DataTypeTest.java
@@ -0,0 +1,57 @@
+/*
+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
+
+  http://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.
+*/
+package org.apache.plc4x.java.s7.types;
+
+import org.apache.plc4x.test.FastTests;
+import org.junit.Test;
+import org.junit.experimental.categories.Category;
+import static org.hamcrest.core.IsEqual.equalTo;
+import static org.junit.Assert.assertThat;
+
+public class S7DataTypeTest {
+
+    @Test
+    @Category(FastTests.class)
+    public void findMatchingTypeRedundantInformation() {
+        S7DataType result = S7DataType.findMatchingType(Integer.class, S7DataType.UINT, "W");
+        assertThat(result, equalTo(S7DataType.UINT));
+    }
+
+    @Test
+    @Category(FastTests.class)
+    public void findMatchingTypeMissingSizeCode() {
+        S7DataType result = S7DataType.findMatchingType(Integer.class, S7DataType.UINT, null);
+        assertThat(result, equalTo(S7DataType.UINT));
+    }
+
+    @Test
+    @Category(FastTests.class)
+    public void findMatchingTypeBaseTypeAndSizeCode() {
+        S7DataType result = S7DataType.findMatchingType(Integer.class, S7DataType.INT, "W");
+        assertThat(result, equalTo(S7DataType.UINT));
+    }
+
+    @Test(expected = IllegalArgumentException.class)
+    @Category(FastTests.class)
+    public void findMatchingTypeBaseTypeAndWrongSizeCode() {
+        S7DataType result = S7DataType.findMatchingType(Integer.class, S7DataType.INT, "X");
+        assertThat(result, equalTo(S7DataType.UINT));
+    }
+
+}
\ No newline at end of file