Skip to main content

Siemens UDT to JSON transform method

FairCom Edge's transform method for converting binary data from Siemens PLCs into JSON

Siemens is a large industrial manufacturer based in Germany.  One of their focuses is industrial automation, and they manufacture a broad range of Programmable Logic Controllers (PLCs) and industrial PCs for this purpose, including their Simatic STEP 7 line of controllers.

These controllers can be programmed to publish MQTT messages to an MQTT broker.  Arbitrary data can be inserted into the payloads of these messages, including JSON and binary data. Since binary data uses less space than JSON, information is often transmitted in binary format to save network bandwidth. Sending information from the controller is generally accomplished by storing the desired data in a User-Defined Type (UDT) in the controller, converting it to binary using the STEP 7 Serialize command, and then publishing an MQTT message which contains that binary data.

When that message is received by the FairCom Edge MQTT broker, it is stored in an integration table. FairCom Edge has a Siemens UDT service that can convert that binary serialized UDT data to JSON, using a schema that describes the format of the original user-defined type. This schema can be exported from Siemens software (such as TIA Portal) and passed to FairCom Edge so that FairCom Edge knows how to interpret the binary UDT data.

Another approach is to have the Siemens controller publish the data directly in JSON format. This avoids the Serialize step (inside the controller) and the Siemens-UDT-to-JSON step (inside FairCom Edge), at the expense of higher network traffic.

Once the data has been converted to JSON, some or all of it can be extracted from the JSON and inserted as fields in a table using the JSON-to-table transform.

Due to the power and complexity of industrial automation equipment like Siemens PLCs, considerable expertise is required to program and operate them. Because the PLCs, development environments, and programming languages supported by Siemens differ so widely, this tutorial does not cover an explanation of how to do the tasks necessary for any particular PLC.  Siemens has extensive documentation and training available for this purpose.

FairCom assumes that users of this transform have personnel skilled in using and programming Siemens PLCs.

Section

Description

Use cases

This section describes possible use cases for how Siemens controllers can interact with FairCom Edge.

Concepts

The FairCom Edge Siemens UDT-to-JSON service can convert the Siemens native binary UDT data format into JSON.

Tutorials

These tutorials detail how to create and manage the Siemens UDT-to-JSON transform.

API reference

The API reference outlines and defines the properties used to utilize the Siemen UDT-to-JSON transform.

Default UDT type conversion to JSON

This section provides a list of Siemens S7 IEC data types and shows their conversion to JSON.