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 2019/12/27 19:16:08 UTC

[plc4x] 03/09: - Merged the data-specs and the protocol specs - Updated the specs to use the new string type reference

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

cdutz pushed a commit to branch next-gen-core
in repository https://gitbox.apache.org/repos/asf/plc4x.git

commit cd3991191ec350dd298b59c8f0541aeab4d19515
Author: Christofer Dutz <ch...@c-ware.de>
AuthorDate: Wed Dec 25 20:58:57 2019 +0100

    - Merged the data-specs and the protocol specs
    - Updated the specs to use the new string type reference
---
 .../apache/plc4x/protocol/knxnetip/Ets5Types.java  |  46 ------
 ...e.plc4x.plugins.codegenerator.protocol.Protocol |   1 -
 .../main/resources/protocols/knxnetip/ets5.mspec   | 172 ---------------------
 .../resources/protocols/knxnetip/knxnetip.mspec    | 154 ++++++++++++++++++
 .../apache/plc4x/protocol/s7/S7DataProtocol.java   |  46 ------
 ...e.plc4x.plugins.codegenerator.protocol.Protocol |   1 -
 .../src/main/resources/protocols/s7/s7-data.mspec  | 125 ---------------
 .../s7/src/main/resources/protocols/s7/s7.mspec    | 114 +++++++++++++-
 8 files changed, 265 insertions(+), 394 deletions(-)

diff --git a/protocols/knxnetip/src/main/java/org/apache/plc4x/protocol/knxnetip/Ets5Types.java b/protocols/knxnetip/src/main/java/org/apache/plc4x/protocol/knxnetip/Ets5Types.java
deleted file mode 100644
index 0d4e526..0000000
--- a/protocols/knxnetip/src/main/java/org/apache/plc4x/protocol/knxnetip/Ets5Types.java
+++ /dev/null
@@ -1,46 +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
-
-     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.protocol.knxnetip;
-
-import org.apache.plc4x.plugins.codegenerator.language.mspec.parser.MessageFormatParser;
-import org.apache.plc4x.plugins.codegenerator.protocol.Protocol;
-import org.apache.plc4x.plugins.codegenerator.types.definitions.TypeDefinition;
-import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
-
-import java.io.InputStream;
-import java.util.Map;
-
-public class Ets5Types implements Protocol {
-
-    @Override
-    public String getName() {
-        return "ets5";
-    }
-
-    @Override
-    public Map<String, TypeDefinition> getTypeDefinitions() throws GenerationException {
-        InputStream schemaInputStream = Ets5Types.class.getResourceAsStream("/protocols/knxnetip/ets5.mspec");
-        if(schemaInputStream == null) {
-            throw new GenerationException("Error loading message-format schema for protocol '" + getName() + "'");
-        }
-        return new MessageFormatParser().parse(schemaInputStream);
-    }
-
-}
diff --git a/protocols/knxnetip/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol b/protocols/knxnetip/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
index 9fc9b82..357d89b 100644
--- a/protocols/knxnetip/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
+++ b/protocols/knxnetip/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
@@ -17,4 +17,3 @@
 # under the License.
 #
 org.apache.plc4x.protocol.knxnetip.KnxNetIpProtocol
-org.apache.plc4x.protocol.knxnetip.Ets5Types
\ No newline at end of file
diff --git a/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec b/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec
deleted file mode 100644
index edb5992..0000000
--- a/protocols/knxnetip/src/main/resources/protocols/knxnetip/ets5.mspec
+++ /dev/null
@@ -1,172 +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
-//
-//     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.
-//
-
-[discriminatedType 'KNXGroupAddress' [uint 2 'numLevels']
-    [typeSwitch 'numLevels'
-        ['1' KNXGroupAddressFreeLevel
-            [simple uint 16 'subGroup']
-        ]
-        ['2' KNXGroupAddress2Level
-            [simple uint 5  'mainGroup']
-            [simple uint 11 'subGroup']
-        ]
-        ['3' KNXGroupAddress3Level
-            [simple uint 5 'mainGroup']
-            [simple uint 3 'middleGroup']
-            [simple uint 8 'subGroup']
-        ]
-    ]
-]
-
-[discriminatedType 'KnxDatapoint' [uint 10 'mainNumber', uint 10 'subNumber']
-    [typeSwitch 'mainNumber','subNumber'
-        ['1' KnxDatapointB1
-            [reserved uint 7 '0x0']
-            [simple   bit    'value']
-        ]
-        ['2' KnxDatapointB2
-            [reserved uint 6 '0x0']
-            [simple   bit    'control']
-            [simple   bit    'value']
-        ]
-        ['21' KnxDatapointB8
-            [simple   bit    'b7']
-            [simple   bit    'b6']
-            [simple   bit    'b5']
-            [simple   bit    'b4']
-            [simple   bit    'b3']
-            [simple   bit    'b2']
-            [simple   bit    'b1']
-            [simple   bit    'b0']
-        ]
-        ['3' KnxDatapointB1U3
-            [reserved uint 4 '0x0']
-            [simple   bit    'control']
-            [simple   uint 3 'value']
-        ]
-        ['18' KnxDatapointB1U6
-            [simple   bit    'control']
-            [reserved uint 1 '0x0']
-            [simple   uint 6 'value']
-        ]
-        ['17' KnxDatapointU6
-            [reserved uint 2 '0x0']
-            [simple   uint 6 'value']
-        ]
-        ['5' KnxDatapointU8
-            [reserved uint 8 '0x0']
-            [simple   uint 8 'value']
-        ]
-        ['7' KnxDatapointU16
-            [reserved uint 8 '0x0']
-            [simple uint 16 'value']
-        ]
-        ['12' KnxDatapointU32
-            [reserved uint 8 '0x0']
-            [simple uint 32 'value']
-        ]
-        ['6','20' KnxDatapointB5I3
-            [simple   bit   'a']
-            [simple   bit   'b']
-            [simple   bit   'c']
-            [simple   bit   'd']
-            [simple   bit   'e']
-            [simple   int 8 'value']
-        ]
-        ['6' KnxDatapointI8
-            [reserved uint 8 '0x0']
-            [simple   int  8 'value']
-        ]
-        ['8' KnxDatapointI16
-            [reserved uint 8  '0x0']
-            [simple   int  16 'value']
-        ]
-        ['13' KnxDatapointI32
-            [reserved uint 8  '0x0']
-            [simple   int  32 'value']
-        ]
-        ['9' KnxDatapointF16
-            [reserved uint  8    '0x0']
-            [simple   float 4.11 'value']
-        ]
-        ['14' KnxDatapointF32
-            [reserved uint  8    '0x0']
-            [simple   float 8.23 'value']
-        ]
-        ['4' KnxDatapointA8
-            [reserved uint 8 '0x0']
-            [simple   int  8 'value']
-        ]
-        ['16' KnxDatapointA112
-            [reserved uint 8 '0x0']
-            [array    int  8 'value' count '14']
-        ]
-        ['10' KnxDatapointTime24
-            [simple   uint 3 'day']
-            [simple   uint 5 'hour']
-            [reserved uint 2 '0x0']
-            [simple   uint 6 'minutes']
-            [reserved uint 2 '0x0']
-            [simple   uint 6 'seconds']
-        ]
-        ['11' KnxDatapointDate24
-            [reserved uint 3 '0x0']
-            [simple   uint 5 'day']
-            [reserved uint 4 '0x0']
-            [simple   uint 4 'month']
-            [reserved uint 1 '0x0']
-            [simple   uint 6 'year']
-        ]
-        ['19' KnxDatapointDateTime64
-            [simple   uint 8 'year']
-            [reserved uint 4 '0x0']
-            [simple   uint 4 'month']
-            [reserved uint 3 '0x0']
-            [simple   uint 5 'dayOfMonth']
-            [simple   uint 3 'dayOfWeek']
-            [simple   uint 5 'hourOfDay']
-            [reserved uint 2 '0x0']
-            [simple   uint 6 'minutes']
-            [reserved uint 2 '0x0']
-            [simple   uint 6 'seconds']
-            [simple   bit    'fault']
-            [simple   bit    'workingDay']
-            [simple   bit    'workingDayValid']
-            [simple   bit    'yearValid']
-            [simple   bit    'dayAndMonthValid']
-            [simple   bit    'dayOfWeekValid']
-            [simple   bit    'timeValid']
-            [simple   bit    'standardSummerTime']
-            [simple   bit    'clockQuality']
-        ]
-        ['15' KnxDatapointDPT_Access_Data
-            [simple   uint 4 'D6']
-            [simple   uint 4 'D5']
-            [simple   uint 4 'D4']
-            [simple   uint 4 'D3']
-            [simple   uint 4 'D2']
-            [simple   uint 4 'D1']
-            [simple   bit    'BE']
-            [simple   bit    'BP']
-            [simple   bit    'BD']
-            [simple   bit    'BC']
-            [simple   uint 4 'index']
-        ]
-    ]
-]
diff --git a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
index 2434cc5..f3db144 100644
--- a/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
+++ b/protocols/knxnetip/src/main/resources/protocols/knxnetip/knxnetip.mspec
@@ -338,6 +338,160 @@
     [simple   uint 16 'timestamp']
 ]
 
+[discriminatedType 'KNXGroupAddress' [uint 2 'numLevels']
+    [typeSwitch 'numLevels'
+        ['1' KNXGroupAddressFreeLevel
+            [simple uint 16 'subGroup']
+        ]
+        ['2' KNXGroupAddress2Level
+            [simple uint 5  'mainGroup']
+            [simple uint 11 'subGroup']
+        ]
+        ['3' KNXGroupAddress3Level
+            [simple uint 5 'mainGroup']
+            [simple uint 3 'middleGroup']
+            [simple uint 8 'subGroup']
+        ]
+    ]
+]
+
+[dataIo 'KnxDatapoint' [uint 10 'mainNumber', uint 10 'subNumber']
+    [typeSwitch 'mainNumber','subNumber'
+        ['1' Boolean
+            [reserved uint 7 '0x0']
+            [simple   bit    'value']
+        ]
+        ['2' Boolean
+            [reserved uint 6 '0x0']
+            [simple   bit    'control']
+            [simple   bit    'value']
+        ]
+        ['21' Struct
+            [simple   bit    'b7']
+            [simple   bit    'b6']
+            [simple   bit    'b5']
+            [simple   bit    'b4']
+            [simple   bit    'b3']
+            [simple   bit    'b2']
+            [simple   bit    'b1']
+            [simple   bit    'b0']
+        ]
+        ['3' Integer
+            [reserved uint 4 '0x0']
+            [simple   bit    'control']
+            [simple   uint 3 'value']
+        ]
+        ['18' Integer
+            [simple   bit    'control']
+            [reserved uint 1 '0x0']
+            [simple   uint 6 'value']
+        ]
+        ['17' Integer
+            [reserved uint 2 '0x0']
+            [simple   uint 6 'value']
+        ]
+        ['5' Integer
+            [reserved uint 8 '0x0']
+            [simple   uint 8 'value']
+        ]
+        ['7' Integer
+            [reserved uint 8 '0x0']
+            [simple uint 16 'value']
+        ]
+        ['12' Long
+            [reserved uint 8 '0x0']
+            [simple uint 32 'value']
+        ]
+        ['6','20' Integer
+            [simple   bit   'a']
+            [simple   bit   'b']
+            [simple   bit   'c']
+            [simple   bit   'd']
+            [simple   bit   'e']
+            [simple   int 8 'value']
+        ]
+        ['6' Integer
+            [reserved uint 8 '0x0']
+            [simple   int  8 'value']
+        ]
+        ['8' Integer
+            [reserved uint 8  '0x0']
+            [simple   int  16 'value']
+        ]
+        ['13' Integer
+            [reserved uint 8  '0x0']
+            [simple   int  32 'value']
+        ]
+        ['9' Float
+            [reserved uint  8    '0x0']
+            [simple   float 4.11 'value']
+        ]
+        ['14' Float
+            [reserved uint  8    '0x0']
+            [simple   float 8.23 'value']
+        ]
+        ['4' String
+            [reserved uint   8 '0x0']
+            [simple   string 8 'utf8' 'value']
+        ]
+        ['16' String
+            [reserved uint   8   '0x0']
+            [simple   string 112 'utf8' 'value']
+        ]
+        ['10' Time
+            [simple   uint 3 'day']
+            [simple   uint 5 'hours']
+            [reserved uint 2 '0x0']
+            [simple   uint 6 'minutes']
+            [reserved uint 2 '0x0']
+            [simple   uint 6 'seconds']
+        ]
+        ['11' Date
+            [reserved uint 3 '0x0']
+            [simple   uint 5 'day']
+            [reserved uint 4 '0x0']
+            [simple   uint 4 'month']
+            [reserved uint 1 '0x0']
+            [simple   uint 6 'year']
+        ]
+        ['19' DateTime
+            [simple   uint 8 'year']
+            [reserved uint 4 '0x0']
+            [simple   uint 4 'month']
+            [reserved uint 3 '0x0']
+            [simple   uint 5 'day']
+            [simple   uint 3 'dayOfWeek']
+            [simple   uint 5 'hours']
+            [reserved uint 2 '0x0']
+            [simple   uint 6 'minutes']
+            [reserved uint 2 '0x0']
+            [simple   uint 6 'seconds']
+            [simple   bit    'fault']
+            [simple   bit    'workingDay']
+            [simple   bit    'workingDayValid']
+            [simple   bit    'yearValid']
+            [simple   bit    'dayAndMonthValid']
+            [simple   bit    'dayOfWeekValid']
+            [simple   bit    'timeValid']
+            [simple   bit    'standardSummerTime']
+            [simple   bit    'clockQuality']
+        ]
+        ['15' Struct
+            [simple   uint 4 'D6']
+            [simple   uint 4 'D5']
+            [simple   uint 4 'D4']
+            [simple   uint 4 'D3']
+            [simple   uint 4 'D2']
+            [simple   uint 4 'D1']
+            [simple   bit    'BE']
+            [simple   bit    'BP']
+            [simple   bit    'BD']
+            [simple   bit    'BC']
+            [simple   uint 4 'index']
+        ]
+    ]
+]
+
 [enum uint 2 'CEMIPriority'
     ['0x0' SYSTEM]
     ['0x1' NORMAL]
diff --git a/protocols/s7/src/main/java/org/apache/plc4x/protocol/s7/S7DataProtocol.java b/protocols/s7/src/main/java/org/apache/plc4x/protocol/s7/S7DataProtocol.java
deleted file mode 100644
index 079142a..0000000
--- a/protocols/s7/src/main/java/org/apache/plc4x/protocol/s7/S7DataProtocol.java
+++ /dev/null
@@ -1,46 +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
-
-     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.protocol.s7;
-
-import org.apache.plc4x.plugins.codegenerator.language.mspec.parser.MessageFormatParser;
-import org.apache.plc4x.plugins.codegenerator.protocol.Protocol;
-import org.apache.plc4x.plugins.codegenerator.types.definitions.TypeDefinition;
-import org.apache.plc4x.plugins.codegenerator.types.exceptions.GenerationException;
-
-import java.io.InputStream;
-import java.util.Map;
-
-public class S7DataProtocol implements Protocol {
-
-    @Override
-    public String getName() {
-        return "s7-data";
-    }
-
-    @Override
-    public Map<String, TypeDefinition> getTypeDefinitions() throws GenerationException {
-        InputStream schemaInputStream = S7DataProtocol.class.getResourceAsStream("/protocols/s7/s7-data.mspec");
-        if(schemaInputStream == null) {
-            throw new GenerationException("Error loading message-format schema for protocol '" + getName() + "'");
-        }
-        return new MessageFormatParser().parse(schemaInputStream);
-    }
-
-}
diff --git a/protocols/s7/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol b/protocols/s7/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
index 9b0d336..5310523 100644
--- a/protocols/s7/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
+++ b/protocols/s7/src/main/resources/META-INF/services/org.apache.plc4x.plugins.codegenerator.protocol.Protocol
@@ -17,4 +17,3 @@
 # under the License.
 #
 org.apache.plc4x.protocol.s7.S7Protocol
-org.apache.plc4x.protocol.s7.S7DataProtocol
\ No newline at end of file
diff --git a/protocols/s7/src/main/resources/protocols/s7/s7-data.mspec b/protocols/s7/src/main/resources/protocols/s7/s7-data.mspec
deleted file mode 100644
index 2e8faf4..0000000
--- a/protocols/s7/src/main/resources/protocols/s7/s7-data.mspec
+++ /dev/null
@@ -1,125 +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
-//
-//     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.
-//
-
-[discriminatedType 'DataItem' [uint 8 'dataProtocolId']
-    [typeSwitch 'dataProtocolId'
-        // -----------------------------------------
-        // Bit
-        // -----------------------------------------
-        ['01' DataItemBOOL
-            [reserved uint 7 '0x00']
-            [simple   bit    'value']
-        ]
-
-        // -----------------------------------------
-        // Bit-strings
-        // -----------------------------------------
-        // 1 byte
-        ['11' DataItemBYTE
-            [array bit 'value' count '8']
-        ]
-        // 2 byte (16 bit)
-        ['12' DataItemWORD
-            [array bit 'value' count '16']
-        ]
-        // 4 byte (32 bit)
-        ['13' DataItemDWORD
-            [array bit 'value' count '32']
-        ]
-        // 8 byte (64 bit)
-        ['14' DataItemLWORD
-            [array bit 'value' count '64']
-        ]
-
-        // -----------------------------------------
-        // Integers
-        // -----------------------------------------
-        // 8 bit:
-        ['21' DataItemSINT
-            [simple int 8 'value']
-        ]
-        ['22' DataItemUSINT
-            [simple uint 8 'value']
-        ]
-        // 16 bit:
-        ['23' DataItemINT
-            [simple int 16 'value']
-        ]
-        ['24' DataItemUINT
-            [simple uint 16 'value']
-        ]
-        // 32 bit:
-        ['25' DataItemDINT
-            [simple int 32 'value']
-        ]
-        ['26' DataItemUDINT
-            [simple uint 32 'value']
-        ]
-        // 64 bit:
-        ['27' DataItemLINT
-            [simple int 64 'value']
-        ]
-        ['28' DataItemULINT
-            [simple uint 64 'value']
-        ]
-
-        // -----------------------------------------
-        // Floating point values
-        // -----------------------------------------
-        ['31' DataItemREAL
-            [simple float 8.23  'value']
-        ]
-        ['32' DataItemLREAL
-            [simple float 11.52 'value']
-        ]
-
-        // -----------------------------------------
-        // Characters & Strings
-        // -----------------------------------------
-        ['41' DataItemCHAR
-        ]
-        ['42' DataItemWCHAR
-        ]
-        ['43' DataItemSTRING
-        ]
-        ['44' DataItemWSTRING
-        ]
-
-        // -----------------------------------------
-        // TIA Date-Formats
-        // -----------------------------------------
-        ['51' DataItemTime
-            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaTime", io, _value.value)' '4']
-        ]
-        // TODO: Check if this is really 8 bytes
-        ['52' DataItemLTime
-            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaLTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaLTime", io, _value.value)' '8']
-        ]
-        ['53' DataItemDate
-            [manual date 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaDate", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaDate", io, _value.value)' '2']
-        ]
-        ['54' DataItemTimeOfDay
-            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaTimeOfDay", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaTimeOfDay", io, _value.value)' '4']
-        ]
-        ['55' DataItemDateAndTime
-            [manual dateTime 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.parseTiaDateTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.readwrite.utils.StaticHelper.serializeTiaDateTime", io, _value.value)' '8']
-        ]
-    ]
-]
-
diff --git a/protocols/s7/src/main/resources/protocols/s7/s7.mspec b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
index 7f74e3e..9f44ff3 100644
--- a/protocols/s7/src/main/resources/protocols/s7/s7.mspec
+++ b/protocols/s7/src/main/resources/protocols/s7/s7.mspec
@@ -209,8 +209,10 @@
 
 [discriminatedType 'S7Payload' [uint 8 'messageType', S7Parameter 'parameter']
     [typeSwitch 'parameter.discriminatorValues[0]', 'messageType'
-        ['0xF0' S7PayloadSetupCommunication]
-        ['0x04','0x01' S7PayloadReadVarRequest]
+        ['0xF0' S7PayloadSetupCommunication
+        ]
+        ['0x04','0x01' S7PayloadReadVarRequest
+        ]
         ['0x04','0x03' S7PayloadReadVarResponse
             [array S7VarPayloadDataItem 'items' count 'CAST(parameter, S7ParameterReadVarResponse).numItems']
         ]
@@ -256,6 +258,112 @@
     ]
 ]
 
+[dataIo 'DataItem' [uint 8 'dataProtocolId']
+    [typeSwitch 'dataProtocolId'
+        // -----------------------------------------
+        // Bit
+        // -----------------------------------------
+        ['01' Boolean
+            [reserved uint 7 '0x00']
+            [simple   bit    'value']
+        ]
+
+        // -----------------------------------------
+        // Bit-strings
+        // -----------------------------------------
+        // 1 byte
+        ['11' List
+            [array bit 'value' count '8']
+        ]
+        // 2 byte (16 bit)
+        ['12' List
+            [array bit 'value' count '16']
+        ]
+        // 4 byte (32 bit)
+        ['13' List
+            [array bit 'value' count '32']
+        ]
+        // 8 byte (64 bit)
+        ['14' List
+            [array bit 'value' count '64']
+        ]
+
+        // -----------------------------------------
+        // Integers
+        // -----------------------------------------
+        // 8 bit:
+        ['21' Integer
+            [simple int 8 'value']
+        ]
+        ['22' Integer
+            [simple uint 8 'value']
+        ]
+        // 16 bit:
+        ['23' Integer
+            [simple int 16 'value']
+        ]
+        ['24' Integer
+            [simple uint 16 'value']
+        ]
+        // 32 bit:
+        ['25' Integer
+            [simple int 32 'value']
+        ]
+        ['26' Long
+            [simple uint 32 'value']
+        ]
+        // 64 bit:
+        ['27' Long
+            [simple int 64 'value']
+        ]
+        ['28' BigInteger
+            [simple uint 64 'value']
+        ]
+
+        // -----------------------------------------
+        // Floating point values
+        // -----------------------------------------
+        ['31' Float
+            [simple float 8.23  'value']
+        ]
+        ['32' Double
+            [simple float 11.52 'value']
+        ]
+
+        // -----------------------------------------
+        // Characters & Strings
+        // -----------------------------------------
+        ['41' String
+        ]
+        ['42' String
+        ]
+        ['43' String
+        ]
+        ['44' String
+        ]
+
+        // -----------------------------------------
+        // TIA Date-Formats
+        // -----------------------------------------
+        ['51' Time
+            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseTiaTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeTiaTime", io, _value)' '4']
+        ]
+        // TODO: Check if this is really 8 bytes
+        ['52' Time
+            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseTiaLTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeTiaLTime", io, _value)' '8']
+        ]
+        ['53' Date
+            [manual date 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseTiaDate", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeTiaDate", io, _value)' '2']
+        ]
+        ['54' Time
+            [manual time 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseTiaTimeOfDay", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeTiaTimeOfDay", io, _value)' '4']
+        ]
+        ['55' DateTime
+            [manual dateTime 'value' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.parseTiaDateTime", io)' 'STATIC_CALL("org.apache.plc4x.java.s7.utils.StaticHelper.serializeTiaDateTime", io, _value)' '8']
+        ]
+    ]
+]
+
 [enum int 8 'COTPTpduSize' [uint 8 'sizeInBytes']
     ['0x07' SIZE_128 ['128']]
     ['0x08' SIZE_256 ['256']]
@@ -319,7 +427,7 @@
     ['0x02' DATE_AND_TIME    ['X'              , '8'                 , 'null'                  , 'null'                               , '55']]
 ]
 
-[enum int 8 'MemoryArea'             [string 'shortName']
+[enum int 8 'MemoryArea'             [string 24 'utf8' 'shortName']
     ['0x1C' COUNTERS                 ['C']]
     ['0x1D' TIMERS                   ['T']]
     ['0x80' DIRECT_PERIPHERAL_ACCESS ['D']]