Skip to main content
Version: 2.8

Publisher Configuration

The publisher is used to report datasets (values or alarms) to a node. The node is identified by its global id which is set in the Connection property of the publisher.

Example:

"Connection": "F14069B5-BFF1-4936-93E9-949B4AF0BC02"

Following fields must be defined in a dataset:

Field NameDescriptionData Type
IdId of the data node that reports its data.System.Guid
DeviceId[OPT] Id of the reporting device.System.Guid
NameName of the data node (field name).System.String
ValueValue of the data node.System.Object
State[OPT] Value state of the data node. Default is GoodEDataState
TimeStamp[OPT] Timestamp of the value event. If not set, the current UTC time is taken.System.DateTime
Tap:<TagName>[OPT] Tags that are passed with the messageSystem.String

These dataset fields are converted to the JSON formatted string that will be passed to the node space.

Example of Publisher Configuration:

{
"Disable": false,
"Publishers": [
{
"Id": "B4389318-95B7-4094-8F27-FE4CDF6D2D1E",
"Name": "DataLogger",
"Connection": "143FB14C-0509-442F-B38B-1FDADD372E0E", // Node ID
"NetworkTimeout": 10000,
"MinimalInterruptionTime": 5.0,
"PayloadDumpFileName": "$(AppConfig:CommonAppPath)\\Dumps\\CommandNodeLogger\\Publisher.log",
"PayloadDumpRetentionTime": 2,
"SamplerType": "OnlyLastValue",
"SamplingRate": 30.0,
"StartingSecond": 30,
"Properties": {},
"DataSets": [
{
"Name": "DataNode Logger for Entity X",
"Type": "DataNode",
"NodeFilter": "node.hasProperty<bool>(\"EnableNodeSpaceLogger\", true)",
"Tag": "",
"Fields": [
{
"Name": "DeviceId",
"DataType": "System.Guid",
"Query": "item.Node.getProperty<Guid>(\"DeviceId\")"
},
{
"Name": "Id",
"DataType": "System.Guid",
"Query": "item.GlobalId"
},
{
"Name": "Name",
"DataType": "System.String",
"Query": "item.Node.Name"
},
{
"Name": "TimeStamp",
"DataType": "System.DateTime",
"Query": "item.TimeStamp"
},
{
"Name": "Value",
"DataType": "System.Object",
"Query": "item.Value"
},
{
"Name": "State",
"DataType": "System.Int32",
"Query": "item.DataState"
}
]
}
],
"ServiceRule": {
"BindingRuleId": "{8A80927A-B1F8-4505-B4BA-FB2DFED765E4}",
"UnbindingRuleId": "{1058566D-0787-48C3-95A5-235E9A55CCF3}",
"Type": "All"
}
}
]
}

The publisher sends all pending datasets as one payload formatted in JSON.

Example Payload:

[
{
"DeviceId": "6d6730f6-21e6-4e85-818b-0575ad67fd93",
"Id": "67177e31-c40e-4441-80e4-62c196faa1ed",
"Name": "MachineState",
"State": "Good",
"Tags": { },
"TimeStamp": "2023-06-13T19:51:19.4088869Z",
"Value": "900"
}
]

Logging Data

Following node types are supported for data logging:

  • Command Nodes
  • Data Nodes (only of System.String)

Logging to a CommandNode

The Connection property of the publisher references a command node. The command must provide following arguments:

ArgumentDescriptionData Type
SourceServiceIdId of the micro-service or gateway reporting the data.System.Guid
DataContains the data sets in JSON format.System.String

The NodeSpaceDataLogger calls a command node with the following configuration:

{
"Id": "F14069B5-BFF1-4936-93E9-949B4AF0BC02",
"Name": "$(CommandNodeName)",
"Type": "CommandNode",
"ScriptFile": "ProductionMachineDataLogger.cs",
"Arguments": [
{
"Name": "SourceServiceId",
"Type": "Input",
"DataType": "System.Guid",
},
{
"Name": "Data",
"Type": "Input",
"DataType": "System.String",
}
]
},

Logging to a DataNode

The Connection property of the publisher references a data node. The data node must be of type System.String. The content is sent as JSON formatted string.