MindConnect OPC UA PubSub Service – Samples¶
Event Data¶
The sample data message is relevant "c/{clientId}/o/opcua/v3/u/d/e" topic.
Only events 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.
Data Set Message¶
The sample event message is as below:Sample
{
"networkMessageHeader": {
"versionFlags": -48,
"extendedFlags1": {
"value": 36
},
"extendedFlags2": {
"value": 0
},
"publisherId": "vehicle-001-publisher",
"uadpversion": 0,
"groupHeaderEnabled": false,
"payloadHeaderEnabled": true,
"timestampEnabled": true,
"picoSecondsEnabled": false,
"promotedFieldsEnabled": false,
"securityEnabled": false,
"chunkMessage": false,
"networkMessageType": "DATA_SET_MESSAGE",
"extendedFlags2Enabled": false,
"publisherIdEnabled": true,
"publisherIdDataType": "String",
"dataSetClassIdEnabled": false,
"extendedFlags1Enabled": true
},
"payloadHeader": {
"count": 1,
"dataSetWriterIds": [2000]
},
"extendedNetworkMessageHeader": {
"timestamp": {
"value": 132279579627160000,
"timeInMillis": 1583484362716,
"utcCalendar": 1583484362716,
"localCalendar": 1583484362716,
"milliSeconds": 13227957962716
},
"picoSeconds": 0
},
"payload": {
"messages": [{
"dataSetMessageHeader": {
"dataSetFlags1": 227,
"dataSetFlags2": 16,
"messageSequenceNumber": 0,
"timestamp": {
"value": 132279579627160000,
"timeInMillis": 1583484362716,
"utcCalendar": 1583484362716,
"localCalendar": 1583484362716,
"milliSeconds": 13227957962716
},
"picoSeconds": 0,
"status": 0,
"configurationVersionDataType": {
"majorVersion": {
"value": 123
},
"minorVersion": {
"value": 123
}
},
"timestampEnabled": true,
"picoSecondsEnabled": false,
"fieldEncoding": "RAW_DATA",
"dataSetMessageValid": true,
"dataSetMessageSequenceNumberEnabled": false,
"statusEnabled": false,
"configurationVersionMajorVersionEnabled": true,
"configurationVersionMinorVersionEnabled": true,
"dataSetFlags2Enabled": true,
"dataSetMessageType": "DATA_KEY_FRAME"
},
"dataSetMessage": [{
"fieldValue": [200]
}, {
"fieldValue": ["low"]
}, {
"fieldValue": ["full"]
}],
"fieldCount": 3
}]
}
}
Event Message¶
The sample event message is as below:Sample
{
"entityId": "4eb511dd732d485d8a8d92ea4274ea38",
"typeId": "connint5.connectivity.event.type.ElectricEngine",
"source": "engine",
"Unit": "KM",
"Overspeed": 200,
"timestamp": "2020-03-06T08:45:20.414Z",
"hiearchy": "vehicle-001"
},
{
"entityId": "00daa679be2d4f58b44be5d972518725",
"typeId": "connint5.connectivity.event.type.Battery",
"source": "primary",
"Unit": "%",
"Charge": "low",
"timestamp": "2020-03-06T08:45:20.414Z",
"hierarchy": "vehicle-001/batteries"
},
{
"entityId": "00daa679be2d4f58b44be5d972518725",
"typeId": "connint5.connectivity.event.type.Battery",
"source": "secondary",
"Unit": "%",
"Charge": "full",
"timestamp": "2020-03-06T08:45:20.414Z",
"hierarchy": "vehicle-001/batteries"
}