API reference
Enable and disable the UDT-to-JSON service
Navigate to the
config
folder.Open the
services.json
configuration file.Enable or disable the UDT-to-JSON service by editing the
"siemensUDT2JSON"
block of the"transformServices"
object.Set the
"enabled"
property totrue
to enable the UDT-to-JSON service.OR set the
"enabled"
property tofalse
to disable the UDT-to-JSON service.{ "serviceName": "siemensUDTServiceopcua", "serviceLibrary": "siemensudtservice.dllopcservice.dll", "enabled": true }
Save any changes.
Restart the server for the changes to take effect.
Request examples
Note
The listed examples require a UDT schema that matches the serialized data structure that your PLC is publishing to an MQTT topic, see Obtain and convert the UDT schema.
For a list and detailed description of the specific properties in the "createTransform"
action, see createTransform.
The Siemens UDT-to-JSON transform does not have "target"
parameters because it writes to the same integration table that it reads from. The table is specified by the "configureTopic"
, "alterInput"
, or "alterIntegrationTable"
actions which invoke this transformation.
The Seimens UDT-to-JSON transform reads binary data from one field (column) and writes JSON data to a different field of that table. Both the "inputFields"
and "outputFields"
arrays should contain exactly one field each, and those two fields should be different from each other.
Minimal request example
{ "authToken": "ReplaceWithValidToken", "api": "hub", "apiVersion": "1.0", "action": "createTransform", "params": { "transformName": "PLCData_transform", "transformActions": [ { "transformService": "siemensUDT2JSON", "transformActionName": "siemensUdtPayloadToJSON", "inputFields": [ "source_payload" ], "outputFields": [ "aValidFieldName" ], "transformParams": { "schema": "ReplaceWithConvertedUDTSchema", "rootTypeName": "ReplaceWithRootName" } } ] } }
{ "authToken": "ReplaceWithValidToken", "api": "hub", "apiVersion": "1.0", "action": "createTransform", "params": { "transformName": "PLCData_transform", "transformActions": [ { "transformService": "siemensUDT2JSON", "transformActionName": "siemensUdtPayloadToJSON", "inputFields": [ "source_payload" ], "outputFields": [ "temperature" ], "transformParams": { "schema": "ReplaceWithConvertedUDTSchema", "udtDebugTracing": false, "rootTypeName": "ReplaceWithRootName" } } ] } }
Response examples
Minimal response example
{ "result": {}, "requestId": "00000007", "errorCode": 0, "errorMessage": "" }
"params"
The "params"
property is an object that contains an action's parameters. Each action defines its own required and optional properties.
Property summary
"params"
property summariesProperty | Description | Default | Type | Limits | ||
---|---|---|---|---|---|---|
contains | Required - No default value | array of objects | ||||
| contains the name of a transform process | Required - No default value | string |
|
The "transformActions"
property is an optional array of "transformAction"
objects. It defaults to an empty array.
"transformAction"
property summariesProperty | Description | Default | Type | Limits (inclusive) | ||
---|---|---|---|---|---|---|
contains one or more of the fields in the integration table where the value of each of these fields is sent to the transform action as its primary input | Required - No default value | array | ||||
contains one element which is the name of the field that will receive the JSON generated by the transform | Required - No default value | array | ||||
| Contains the name of the transform action. For example — "siemensUdtPayloadToJSON", "jsonPropertiesToTableFields", "tableFieldsToJson", "jsonToDifferentTableFields" | Required - No default value | string |
| ||
contains a unique set of parameters that configure its transformation process NoteIt may be an empty object or contain one or more properties needed by the | Required - No default value | object |
| |||
| specifies the service that contains the transform |
| string | Any previously defined name of a transform service. |