Sample Message for Event MetaData Samples¶
Event MetaData Sample¶
The sample metadata message is relevant "c/{clientId}/o/opcua/v3/u/m/e" topic.
Only Event Type resources are created by this operation. Update and Delete operations are not possible.
Note
The code below is just a json representation of the UADP message format. You have to create an UADP message in binary format before sending it to the topic.
MetaData Message¶
Sample
{
"networkMessageHeader": {
"versionFlags": -112,
"extendedFlags1": {
"value": 132
},
"extendedFlags2": {
"value": 8
},
"publisherId": "vehicle-001-publisher",
"uadpversion": 0,
"groupHeaderEnabled": false,
"payloadHeaderEnabled": false,
"timestampEnabled": false,
"picoSecondsEnabled": false,
"promotedFieldsEnabled": false,
"securityEnabled": false,
"chunkMessage": false,
"networkMessageType": "DISCOVERY_RESPONSE",
"extendedFlags2Enabled": true,
"publisherIdEnabled": true,
"publisherIdDataType": "String",
"dataSetClassIdEnabled": false,
"extendedFlags1Enabled": true
},
"payload": {
"messages": [{
"discoveryResponseHeader": {
"responseType": "DATA_SET_METADATA_MESSAGE",
"sequenceNumber": 0
},
"discoveryResponseMessage": {
"dataSetWriterId": 2000,
"metaData": {
"structureDataTypes": [{
"structureDefinition": {
"dataTypeId": {
"namespaceIndex": 2,
"value": 1,
"nullNodeId": false,
"idType": "Numeric"
},
"name": {
"namespaceIndex": 0,
"name": "ElectricEngine"
},
"defaultEncodingId": {
"namespaceIndex": 0,
"value": 12,
"nullNodeId": false,
"idType": "Numeric"
},
"baseDataType": {
"namespaceIndex": 0,
"value": 12,
"nullNodeId": false,
"idType": "Numeric"
},
"structureType": < Ignored Value > ,
"fields": [{
"name": "Overspeed",
"description": {
"text": "Event occurs over the maximum speed"
},
"dataType": {
"namespaceIndex": 0,
"value": 6,
"nullNodeId": false,
"idType": "Numeric"
},
"valueRank": -1,
"optional": false
}]
}
}, {
"structureDefinition": {
"dataTypeId": {
"namespaceIndex": 2,
"value": 2,
"nullNodeId": false,
"idType": "Numeric"
},
"name": {
"namespaceIndex": 0,
"name": "Battery"
},
"defaultEncodingId": {
"namespaceIndex": 0,
"value": 12,
"nullNodeId": false,
"idType": "Numeric"
},
"baseDataType": {
"namespaceIndex": 0,
"value": 12,
"nullNodeId": false,
"idType": "Numeric"
},
"structureType": < Ignored Value > ,
"fields": [{
"name": "Charge",
"description": {
"text": "Event occurs when the battery is low or full"
},
"dataType": {
"namespaceIndex": 0,
"value": 12,
"nullNodeId": false,
"idType": "Numeric"
},
"valueRank": -1,
"optional": false
}]
}
}],
"name": "vehicle-001-publisher",
"description": {
"text": "OPCUA Pub/Sub Publisher for vehicle-001"
},
"fields": [{
"name": "vehicle-001/engine",
"description": {
"text": "< Ignored Value > Engine that provides the needed torque to move the vehicle",
"localeId": < Ignored Value >
},
"fieldFlags": {
"promotedField": false
},
"builtInDataType": "ExtensionObject",
"dataType": {
"namespaceIndex": 1,
"value": 1,
"nullNodeId": false,
"idType": "Numeric"
},
"dataSetFieldId": < Ignored Value > ,
"properties": [{
"encodingMask": 12,
"key": {
"namespaceIndex": 0,
"name": "unit"
},
"value": "KM"
}]
},
{
"name": "vehicle-001/batteries/primary",
"description": {
"text": "< Ignored Value > Primary battery feeding the engine",
"localeId": < Ignored Value >
},
"fieldFlags": {
"promotedField": false
},
"builtInDataType": "ExtensionObject",
"dataType": {
"namespaceIndex": 1,
"value": 2,
"nullNodeId": false,
"idType": "Numeric"
},
"dataSetFieldId": < Ignored Value > ,
"properties": [{
"encodingMask": 12,
"key": {
"namespaceIndex": 0,
"name": "unit"
},
"value": "%"
}]
},
{
"name": "vehicle-001/batteries/secondary",
"description": {
"text": "< Ignored Value > Secondary battery feeding the engine",
"localeId": < Ignored Value >
},
"fieldFlags": {
"promotedField": false
},
"builtInDataType": "ExtensionObject",
"dataType": {
"namespaceIndex": 1,
"value": 2,
"nullNodeId": false,
"idType": "Numeric"
},
"dataSetFieldId": < Ignored Value > ,
"properties": [{
"encodingMask": 12,
"key": {
"namespaceIndex": 0,
"name": "unit"
},
"value": "%"
}]
}
],
"configurationVersion": {
"majorVersion": {
"value": 123
},
"minorVersion": {
"value": 123
}
}
},
"statusCode": {
"value": 0,
"description": "",
"severity": 0,
"bad": false,
"good": true,
"notBad": true,
"notGood": false,
"notUncertain": true,
"uncertain": false,
"semanticsChanged": false,
"structureChanged": false,
"subcode": 0,
"infotype": 0,
"limitBits": 0,
"historianBits": 0,
"valueAsIntBits": 0,
"name": "GOOD",
"overflow": false
}
}
}]
}
}
Event Types¶
If the above metadata message arrives in the OPC UA PubSub Service, Event types are created in Event Management as below:Sample
{
"id": "connint5.connectivity.event.type.ElectricEngine",
"name": "ElectricEngine",
"ttl": 35,
"etag": 0,
"owner": "connint5",
"scope": "LOCAL",
"parentId": "core.connectivity.event.type.OPCUABaseEvent",
"fields": [{
"name": "unit",
"filterable": false,
"required": true,
"updatable": true,
"type": "STRING"
},
{
"name": "Overspeed",
"filterable": false,
"required": true,
"updatable": true,
"type": "INTEGER"
}
],
"_links": {
"self": {
"href": "https://connint5-fleetmanager.eu1-int.mindsphere.io/api/eventmanagement/v3/eventTypes/connint5.connectivity.event.type.ElectricEngine"
},
"events": {
"href": "https://connint5-fleetmanager.eu1-int.mindsphere.io/api/eventmanagement/v3/events?filter=%7B%22typeId%22:%22connint5.connectivity.event.type.ElectricEngine%22%7D"
}
}
},
{
"id": "connint5.connectivity.event.type.Battery",
"name": "Battery",
"ttl": 35,
"etag": 0,
"owner": "connint5",
"scope": "LOCAL",
"parentId": "core.connectivity.event.type.OPCUABaseEvent",
"fields": [{
"name": "unit",
"filterable": false,
"required": true,
"updatable": true,
"type": "STRING"
},
{
"name": "Charge",
"filterable": false,
"required": true,
"updatable": true,
"type": "STRING"
}
],
"_links": {
"self": {
"href": "https://connint5-fleetmanager.eu1-int.mindsphere.io/api/eventmanagement/v3/eventTypes/connint5.connectivity.event.type.Battery"
},
"events": {
"href": "https://connint5-fleetmanager.eu1-int.mindsphere.io/api/eventmanagement/v3/events?filter=%7B%22typeId%22:%22connint5.connectivity.event.type.Battery%22%7D"
}
}
}