In the context of the Web of Things (WoT), a Binding Template is a blueprint that gives guidance on how to implement a specific IoT protocol, data format or IoT platform. The Core Binding Templates specification explains the overall mechanism and requirements for any binding to follow. This document gives implementation guidelines regarding the PROFINET protocol, which is a well-known high-speed industrial ethernet protocol for communication between industrial control and automation devices.

More specifically, this document defines a set of vocabulary terms that can be used inside a Thing Description document, and associated rules which allow to describe WoT operations using the PROFINET protocol over the network. Additionally, relevant examples are provided to showcase different vocabulary terms and the associated behavior.

This document is a work in progress

Introduction

PROFINET is an open standard communication protocol developed and published by PROFIBUS Nutzerorganisation (PNO) for Industrial Ethernet. PROFINET which is an Ethernet version of PROFIBUS is designed to satisfy requirements of most industrial automation processes by providing a high-speed data transfer for time critical applications like motion control and drive. It can also have a safety (PROFIsafe) implementation onboard for safety related application.

Generally, profinet is classified into PROFINET IO (Input Output) which is used for distributed input/output processes of field devices (sensors and actuators) data and PROFINET CBA (Component Based Automation) which is used for distributed automation. The scope of this document focuses on the PROFINET IO. PROFINET IO network consist of three main actors which are IO controller, IO supervisor and IO device. The IO controllers are PLCs and DCS, they are most used for profinet cyclic communications like IO data exchange. The IO supervisor is a standalone application that is mostly used for acyclic communications like diagnostics and parameterization. The IO device is general field devices that are controlled by both IO controller and IO supervisor.

Due to the different requirements by different industrial automation applications, PROFINET IO provides three different communications channels to exchange data between IO controllers and IO device or IO supervisor and IO devices. The Real-Time (RT) and Isochronous Real Time (IRT) channels are used for cyclic data transfer and high-speed cyclic data transfer for motion control application respectively, the User Data Protocol (UDP) channel is mostly used by IO supervisor for parameterization, diagnostic and acyclic communications. The addressing in PROFINET slot/sublsot/index mechanism where the slot identifies a module and subslot identifies submodules that exist within a module. The index identifies datapoint of interest in the submodule.

Concretely, this document describes how WoT TDs can be used to describe devices that use the PROFINET acyclic communication (IO supervisor). The IO controller operations that use cyclic communication is beyond the scope of this document. This document explains how to create valid URLs and Forms for read or write operation from or to an IO device respectively. Developers are encouraged to use this document as an implementation guidelines and as a reference for the creation of their own binding implementations. The following sections will cover the URL format, the vocabulary and a list of Form examples.

Forms of a Thing Description instance with PROFINET Binding complies with this specification if it follows the normative statements in and .

A JSON Schema [[?JSON-SCHEMA]] to validate Thing Description instances containing PROFINET Binding is provided in the GitHub repository.

URL format

In conformance to the structure of other bindings provided in the WoT TD, the url form defines a resource endpoint information and it follows standard URL scheme common to the web. For PROFINET, the url scheme will begin with profinet:// and that will the only valid scheme to consider. The following shows the typical structure of an URL of the PROFINET protocol:
            profinet://{address}/{slot}/{subslot}/?api={api}&index={index}&datalength={datalength}
        

Where:

For the full syntax see [[[#abnf]]]

PROFINET Vocabulary

This section describes the vocabulary used in the PROFINET protocol. A protocol binding template implementation should use the vocabulary defined in this section to describe the different configuration that can be used to exchanged data between Web of Things.

URL terms

Vocabulary term Description Assignment Type
profv:slot Specifies the location where the IO device is plugged into required integer
profv:subslot subslot provides the interface for the parameter to read/write, a slot can contain one or more subslots required integer
profv:index an identifier that uniquely points to a resource within slot/subslot combination of a PROFINET IO device required integer
profv:api used to provide additional addressing to differentiates profiles parameter. if the term is not provided the TD processor defaults it to zero optional integer
profv:datalength used for aplication and network optimization to appropriately define the specific data length of the resource payload. optional integer

Form terms

Vocabulary term Description Assignment Type
profv:mostSignificantByte When true, it describes that the byte order of the data in the PROFINET message is the most significant byte first (i.e., Big-Endian). When false, it describes the least significant byte first (i.e., Little-Endian).If the term is not provided, the TD processor defaults it to true optional boolean
profv:mostSignificantWord When true, it describes that the word order of the data in the Modbus message is the most significant word first (i.e., no word swapping). When false, it describes the least significant word first (i.e. word swapping). If the term is not provided, the TD processor defaults it to true optional boolean
profv:method When true, it describes that the word order of the data in the Modbus message is the most significant word first (i.e., no word swapping). When false, it describes the least significant word first (i.e. word swapping). If the term is not provided, the TD processor defaults it to true optional string

(one of "READ", "WRITE")

profv:pollingTime IO supervisor polling rate in milliseconds. It is recommended to keep the polling rate above IO device send clock time. this will ensure that the cyclic communication will not be interferrupted in anyway. optional integer
profv:timeout PROFINET response maximum waiting time. Defines how much time the runtime should wait until it receives a reply from the device. optional integer
profv:offset used for object type properties to identify the starting point within a byte stream payload that represent a property. optional integer
profv:byte used for object type properties to identify the byte length of a proterty from the byte stream payload optional integer
profv:Bit used for object type properties to identify the byte length of a proterty from the byte stream payload optional integer
profv:payloadMapping used for object to rovides logical mapping information of the complex payload from PROFINET device optional Map of PayloadMapping
profv:type Specifies the data type contained in the request or response payload. optional PayloadDataType

The profv:mostSignificantByte and profv:mostSignificantWord properties within the PROFINET binding template define the byte and word order of data within PROFINET payload. In PROFINET communication,. The arrangement of bytes and words may vary between systems, and these properties provide a declarative way to capture such configurations. For instance, in Big-Endian byte order (e.g., AABBCC), the most significant byte comes first, and setting profv:mostSignificantByte to true ensures the correct interpretation of the data as AABBCC. Conversely, in Little-Endian byte order (e.g., CCBBAA), the least significant byte comes first, therefore profv:mostSignificantByte has to be set to false. On the other hand, the profv:mostSignificantWord property extends this functionality to message payloads composed by more than two registers. For example, given a message payload composed by four registers (e.g., AABBCCDD), with profv:mostSignificantWord set to true let the client to correctly interpretate the data as AABBCCDD, while setting the property to false will result in the interpretation of the data as CCDDAABB. Though, almost all implemtnetations provided by vendors are in Big-Endian but PROFINET specification does not specifically adopt Big-Endianness. So, some off-the-shelf implementation or user specific implementaiton might adopt a different endianness. Therefore, when creating a Thing Description (TD), users may need to account for such deviations by configuring the profv:mostSignificantWord and profv:mostSignificantByte properties accordingly.

Payload DataType

The PayloadDataType class within the PROFINETE Binding Template serves as value for the profv:type property to specify the expected data types of payload content in PROFINET messages. It offers a set of terms taken from PROFINET specification (chapter 5 of IEC 61158-5-10)[ref] to cover the most common data types used in PROFINET messages. Note that the PayloadDataType entity is designed for describing established conventions in the PROFINET ecosystem, further development might remove this functionality or add new terms. Currently, the PayloadDataType class contains the following data types:

Value Byte Length Code
Boolean 1 1
Integer8 1 2
Integer16 2 3
Integer32 4 4
Unsigned8 1 5
Unsigned16 2 6
Unsigned32 4 7
Unsigned64 8 56
Float32 4 8
Float64 8 15
VisibleString profv:datalength 9
OctetString profv:datalength 10
UnicodeString8 profv:datalegth 40
61131_STRING profv:datalegth 41
61131_WSTRING profv:datalegth 42
TimeStamp 12 60
TimeStampDifference 12 61
TimeStampDifferenceShort 8 62
Unsigned8+Unsigned8 2 102
Float32+Unsigned8 5 101
OctetString2+Unsigned8 3 103
Unsigned8_S 1 106
Unsigned16_S 2 104
Integer16_S 2 105
OctetString_S profv:datalegth 107
N2 2 113
N4 4 114
V2 2 115
L2 2 116
R2 2 117
T2 2 118
T4 4 119
D2 2 120
E2 2 121
C4 4 122
X2 2 123
X4 4 124
Unipolat2.16 2 125
Float64 8 15

Payload Mapping

The payloadMapping class within PROFINET binding template helps map the nested properties of object types. It is common that the payload of a PROFINET device response are provided in a complex/object form. this payload requires mapping the individual parameters to object definitions provided at the thing description dataSchema class. The table below shows the terms provided in payloadMapping class.

Vocabulary term Description Assignment Type
profv:offset used for object type properties to identify the starting point within a byte stream payload that represent a property. optional integer
profv:byte used for object type properties to identify the byte length of a proterty from the byte stream payload optional integer
profv:Bit used for object type properties to identify the byte length of a proterty from the byte stream payload optional integer
profv:enumeratedValue used for object type properties to identify the bit mask of a proterty from the byte stream or byte payload optional Arrayof EnumeratedValue
profv:type Specifies the data type contained in the request or response payload. optional PayloadDataType

Enumerated Value

The enumeratedValue class within the PROFINET binding template helps provide context to encoded parameters in the payload. Bit payloads in PROFINET are sometimes used as encoded payload to logical mean something aside from 1 and 0. Informaiton about how the encoding payload will be decoded is defined in this section. The table below defines the terms used in the enumeratedValue class.

Vocabulary term Description Assignment Type
profv:encodedPayload used for object type properties to identify the bit mask of a proterty from the byte stream or byte payload optional number or boolean
profv:decodedPayload used for object type properties to identify the bit mask of a proterty from the byte stream or byte payload optional string , number or boolean

Mappings

This section describes strategies and default values to employ protocol specific concepts within the WoT Interaction model.

Default mappings

The following table lists the default mappings between the protocol specific concepts and the WoT concepts. Please note that operations that are not listed in the table are not supported by this binding template. For example, since the scope of this binding focuses on acyclic communication of the PROFINET protocol, the subscribeevent operation is not supported.

Operation Default Binding
readproperty "profv:method": "READ"
writeproperty "profv:method": "WRITE"
readallproperties "profv:method": "READ"
writeallproperties "profv:method": "WRITE"
readmultipleproperties "profv:method": "READ"
writemultipleproperties "profv:method": "WRITE"
The next table defines default values for other terms, regardless of their use in combination with one of the operations listed in the table above.
Operation Default Comments
profv:api 0
profv:mostSignificantByte true
profv:mostSignificantWord true
profv:timeout infinite

Examples

This section will present a set of examples about how the terms defined in this document can be used to describe and configure a Form. [[[#example-thing-class-definition]]] shows the minimal set of terms to define some identifications that uniquely destinct a device in a network.
            {
                "@context": [
                    "https://www.w3.org/2019/wot/td/v1",
                    {
                    "profv" : "https://profinet_vocabulary_context"
                    }
                ],
                "@type": "tm:ThingModel",
                "title": "ET200SP",
                "id": "{{ID}}",
                "profv:deviceId" : 12,
                "profv:vendorId" : 268,
                "base": "profinet://192.168.0.100",
                "securityDefinitions": {
                    "nosec_sc": {
                    "scheme": "nosec"
                    }
                },
                "security": "nosec_sc",
                "properties" : {},
                "actions" : {},
                "events" : {}
            }
        
[[[#example-device-property]]] shows the minimal set of terms to read or write to a PROFINET device. Notice that the slot, subslot is contained in the href as the first and second elements of the URL path respectively. Also, as part of the PROFINET vocabulary is a polling mechanism (profv:pollingTime) can be used to set intervals for reading a PROFINET device parameter.
            {
                "@context": [
                    "https://www.w3.org/2019/wot/td/v1",
                    {
                    "profv" : "https://profinet_vocabulary_context"
                    }
                ],
                "@type": "tm:ThingModel",
                "title": "ET200SP",
                "id": "{{ID}}",
                "profv:deviceId" : 12,
                "profv:vendorId" : 268,
                "base": "profinet://192.168.0.100",
                "securityDefinitions": {
                    "nosec_sc": {
                    "scheme": "nosec"
                    }
                },
                "security": "nosec_sc",
                "properties": {
                    "Buffer time": {
                    "title": "Buffer time",
                    "type": "integer",
                    "minimum" : 1,
                    "maximum" : 60000,
                    "default" : 3000,
                    "unit" : "s",
                    "forms": [
                        {
                        "op": [
                            "writeproperty",
                            "readproperty"
                        ],
                        "href": "profinet://127.0.0.1/0/1?api=0&index=268&datalength=2",
                        "profv:type": "Unsigned16",
                        "profv:pollingTime": 200
                        }
                        ]
                    }
                }
            }
        
[[[#example-complex-datatype]]] shows how object type property is defined in TD form and its mappings. It also show how bit payload encodings and decodings are defined as enumeration.
            {
                "@context": [
                  "https://www.w3.org/2019/wot/td/v1",
                  {
                    "profv" : "https://profinet_vocabulary_context"
                  }
                ],
                "@type": "tm:ThingModel",
                "title": "ET200SP",
                "id": "{{ID}}",
                "profv:deviceId" : 12,
                "profv:vendorId" : 268,
                "base": "profinet://192.168.0.100",
                "securityDefinitions": {
                  "nosec_sc": {
                    "scheme": "nosec"
                  }
                },
                "security": "nosec_sc",
                "properties": {
                  "Buffering parameters": {
                  "title": "Buffering parameters",
                  "type": "object",
                  "properties" : {
                    "Buffer time": {
                      "type" :  "integer",
                      "unit" : "s",
                      "minimum" : 1,
                      "maximum" : 32767,
                      "default" : 600
                      },
                    "Buffer time 2": {
                      "type" :  "integer",
                      "unit" : "s" 
                      "minimum" : 1,
                      "maximum" : 300,
                      "default" : 60,  
                      },
                    "Buffer treshold voltage": {
                      "type" :  "integer",
                      "unit" : "V",
                      "minimum" : 2100,
                      "maximum" : 2500,
                      "default" : 2150
                      },
                    "Stop buffering treshold voltage": {
                      "type" :  "integer",
                      "minimum" : 1800,
                      "maximum" : 2300,
                      "default" : 1850,
                      },
                    "Input voltage OK time": {
                      "type" :  "integer",
                      "unit" : "ms",
                      "minimum" : 5,
                      "maximum" : 65000,
                      "default" : 1000,
                      },
              
                    "Downtime alarm": {
                      "type" :  "integer",
                      "unit" : "ms",
                      "minimum" : 0,
                      "maximum" : 20000,
                      "default" : 100,
                      },
                    "Buffering allowed": {
                      "type" :  "Boolean",
            
                      },
              
                    "Enable reset after buffering": {
                      "type" :  "Boolean",
                      }
                  },
                  "forms": [
                    {
                      "op": [
                        "writeproperty",
                        "readproperty"
                      ],
                      "href": "profinet://127.0.0.1/0/1?api=0&index=1&datalength=14",
                      "profv:type": "object",
                      "profv:pollingTime": 200,
                      "profv:payloadMapping" : {
                        "Buffer time 2": {
                          "profv:type": "Unsigned16",
                          "profv:offset": 2,
                          "profv:byte" : 2
                        },
                        "Buffer treshold voltage": {
                          "profv:type": "Unsigned16",
                          "profv:offset": 4,
                          "profv:byte" : 2
                          },
                        "Stop buffering treshold voltage": {
                          "profv:type": "Unsigned16",
                          "profv:offset": 6,
                          "profv:byte" : 2
                          },
                        "Input voltage OK time": {
                          "profv:type": "Unsigned16",
                          "profv:offset": 8,
                          "profv:byte" : 2
                          },
                  
                        "Downtime alarm": {
                          "profv:type": "Unsigned16",
                          "profv:offset": 10,
                          "profv:byte" : 2
                          },
                        "Buffering allowed": {
                          "profv:type": "boolean",
                          "profv:offset": 12,
                          "profv:byte" : 1,
                          "profv:bitMask" : 0,
                          "profv:enumeratedValue":[
                            
                              {
                                "profv:encondedPayload" : 0,
                                "profv:decodedPayload" : false
                              },
              
                              {
                                "profv:encondedPayload" : 1,
                                "profv:decodedPayload" : true
                              }
                            ]
                          },
                  
                        "Enable reset after buffering": {
                          "profv:type": "boolean",
                          "profv:offset": 13,
                          "profv:byte" : 1,
                          "profv:bitMask" : 0,
                          "profv:enumeratedValue":[
                            
                              {
                                "profv:encondedPayload" : 0,
                                "profv:decodedPayload" : false
                              },
              
                              {
                                "profv:encondedPayload" : 1,
                                "profv:decodedPayload" : true
                              }
                            ]
                          }
                      }
                    }
                  ]
                   }
                }
            }
        

PROFINET URL ABNF syntax

The following describe the [[[#url]]] using [[[RFC2234]]] with the reference to [[[uri]]] specification.

            MODBUS-URI = "profinet://" authority path-modbus [ "?api=" api, "?quantity=" quantity  ]
            path-modbus = "/" slot "/" subslot
            slot=1*DIGIT
            subslot=1*DIGIT
            api=1*DIGIT
            index=1*DIGIT
        
Deploys by Netlify