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 [[WOT-THING-DESCRIPTION]] (TD)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 [[IEC CD 61158-5-10]].

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 Non-Real-Time channel which is based on User Data Protocol (UDP) is mostly used by IO supervisor for parameterization, diagnostic and acyclic communications. The RT channel can also be used for acyclic real time messages like alarm 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 [[IEC CD 61158-5-10]].

Concretely, this document describes how WoT TDs can be used to describe devices that use the PROFINET acyclic non-real time communication (IO supervisor) [[Profinet Uni]]. 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 guideline 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.

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 with the structure of other bindings provided in the WoT TD, the URL form defines a resource endpoint's information, and it follows a standard URL scheme common to the web. For PROFINET, the URL scheme will begin with profinet:// and that will be 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. An implementation of a protocol binding template should use the vocabulary defined in this section to describe the different configurations that Things can use to exchange data on the Web of Things.

URL terms

Vocabulary term Description Assignment Type
profv:slot Specifies the location where the IO device is plugged in to. required integer
profv: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 differentiate profile parameters. If the term is not provided, the TD processor treats it as the default of zero. optional integer
profv:datalength used in application and network optimization to appropriately define the specific data length of resource payload. optional integer

Form terms

Vocabulary term Description Assignment Type
profv:mostSignificantByte When true, it indicates that the byte order of the data in the PROFINET message is most-significant byte (i.e., Big-Endian). When false, it indicates least-significant-byte (i.e., Little-Endian).If the term is not provided, the TD processor defaults it to true optional boolean
profv:mostSignificantWord When true, it indicates that the word order of the data in the PROFINET message is most-significant-word (i.e., no word swapping). When false, it indicates least-significant-word (i.e., word swapping). If the term is not provided, the TD processor treats it as the default of true. optional boolean
profv:method Indicates operation to perform on defined affordance. string

(one of "READ", "WRITE")

profv:pollingTime IO supervisor polling rate in milliseconds. To ensure that the cyclic communication will not be interrupted, it is recommended to keep this polling rate above the IO device's send clock time. optional integer
profv:timeout PROFINET response maximum waiting time. Defines how long the runtime should wait to receive a reply from the device. optional integer
profv:byteOffset For object type properties. Used to identify the starting point within a byte stream payload that represents a property. optional integer
profv:byteLength For object type properties. Used to identify the byte length of a property from the byte stream payload optional integer
profv:bitOffset For object type properties. Used to identify the starting point within a bit stream payload that represents a property. optional integer
profv:bitlength For object type properties. Used to identify the bit length of a property from the bit stream payload optional integer
profv:payloadMapping used for object to provides logical mapping information of a complex payload from a 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 a PROFINET payload. In PROFINET communications, the arrangement of bytes and words can 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. Similarly, the profv:mostSignificantWord property extends this functionality to message payloads composed by more than two bytes. For example, given a message payload composed by four bytess (e.g., AABBCCDD), with profv:mostSignificantWord set to true, the client will interpret the data as AABBCCDD, while setting the property to false will result in the client interpreting the data as CCDDAABB. Although almost all implementations provided by vendors are Big-Endian, the PROFINET specification does not specify Big-Endianness. This means that some off-the-shelf or user-specific implementations might adopt Little-Endianness. Therefore, when creating a Thing Description (TD), users are advised to account for such potential deviations by setting the profv:mostSignificantWord and profv:mostSignificantByte properties accordingly.

Payload DataType

The PayloadDataType class within the PROFINET Binding Template defines values for the profv:type property, which is used to specify the expected data types of payload content in PROFINET messages. It offers a set of terms taken from the 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 to describe established conventions in the PROFINET ecosystem; further development might remove this functionality or add new terms. Currently, the PayloadDataType class includes the following data types[[IEC CD 61158-6-10]]:

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

Payload Mapping

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

Vocabulary term Description Assignment Type
profv:byteOffset For object type properties. Used to identify the starting point within a byte stream payload that represents a property. optional integer
profv:byteLength For object type properties. Used to identify the byte length of a property from the byte stream payload optional integer
profv:bitOffset For object type properties. Used to identify the starting point within a bit stream payload that represents a property. optional integer
profv:bitlength For object type properties. Used to identify the bit length of a property from the bit 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. Information 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,
    "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",
                    "contentType": "application/octet-stream",
                    "profv:type": "Unsigned16",
                    "profv:pollingTime": 200
                }
            ]
        }
    }
}
        
[[[#example-complex-datatype]]] shows how object type property is defined in TM 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,
    "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 threshold voltage": {
                    "type": "integer",
                    "unit": "V",
                    "minimum": 2100,
                    "maximum": 2500,
                    "default": 2150
                },
                "Stop buffering threshold 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",
                    "contentType": "application/octet-stream",
                    "profv:type": "object",
                    "profv:pollingTime": 200,
                    "profv:payloadMapping": {
                        "Buffer time 2": {
                            "profv:type": "Unsigned16",
                            "profv:byteOffset": 2,
                            "profv:byteLength": 2
                        },
                        "Buffer threshold voltage": {
                            "profv:type": "Unsigned16",
                            "profv:byteOffset": 4,
                            "profv:byteLength": 2
                        },
                        "Stop buffering threshold voltage": {
                            "profv:type": "Unsigned16",
                            "profv:byteOffset": 6,
                            "profv:byteLength": 2
                        },
                        "Input voltage OK time": {
                            "profv:type": "Unsigned16",
                            "profv:byteOffset": 8,
                            "profv:byteLength": 2
                        },
                        "Downtime alarm": {
                            "profv:type": "Unsigned16",
                            "profv:byteOffset": 10,
                            "profv:byteLength": 2
                        },
                        "Buffering allowed": {
                            "profv:type": "boolean",
                            "profv:byteOffset": 12,
                            "profv:byteLength": 1,
                            "profv:bitOffset": 0,
                            "profv:enumeratedValue": [
                                {
                                    "profv:encondedPayload": 0,
                                    "profv:decodedPayload": false
                                },
                                {
                                    "profv:encondedPayload": 1,
                                    "profv:decodedPayload": true
                                }
                            ]
                        },
                        "Enable reset after buffering": {
                            "profv:type": "boolean",
                            "profv:byteOffset": 13,
                            "profv:byteLength": 1,
                            "profv:bitOffset": 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.

            PROFINET-URI = "profinet://" authority path-profinet [ "?api=" api, "?index=" index, "?datalength=" datalength ]
            path-profinet = "/" slot "/" subslot
            slot=1*DIGIT
            subslot=1*DIGIT
            api=1*DIGIT
            index=1*DIGIT
            datalength=4*DIGIT