Skip to main content
Version: 2.7

Common Settings for DataLoggers

Different pervasive service plugins exists for data logging (publishers) and data consuming (subscribers):

NameDescriptionPublisherSubscriber
HumanOS.PeSeL.AzureIoTClientAccess to Microsoft Azure cloudXX
HumanOS.PeSeL.CsvDataLoggerLogger to simple csv fileX-
HumanOS.PeSeL.InfluxDbLoggerLogger to the influx databaseX-
HumanOS.PeSeL.MQTTClientAccess to a MQTT BrokerXX
HumanOS.PeSeL.NodeSpaceDataLoggerAccess to a NodeSpace commandsX-
HumanOS.PeSeL.RabbitMqClientAccess to RabbitMessageQueue protocolXX
HumanOS.PeSeL.RestDataLoggerLogger to any web endpointX-
HumanOS.PeSeL.SqlDataLoggerLogger to SQL DatabaseX-

Plugin Configuration

The plugin configuration for publisher and subscriber contains various settings.

The next picture shows the class model of the configuration.

Configuration model for DataLogger configuration

Each plugin is configured by a DataLoggerPluginConfiguration. This Configuration contains following Parameters:

ParameterDescriptionData Type
DisabledFlag if the plugin is disabled. Set to false for plugin activation.System.Boolean
PublishersList of data publishersTAbstractDataLoggerConfiguration
SubscribersList of data subscribersTAbstractDataPublisherConfiguration

DataConsumer Configuration (Subscriber)

Each subscriber instance represents a client subscribing data from a data source. Each subscriber has its own configuration.

ParameterDescriptionData Type
IdId of the data consumerSystem.Guid
NameName of the data consumer. Used in log filesSystem.String
ConnectionConnection string of the data consumerSystem.String
NetworkTimeout[OPT] Timeout in milliseconds [ms] of the network call when sending or receiving data from the platform.System.Double
PayloadScriptFileC# Script file to parse the subscribed data. Further information see the specific plugin documentation.System.String
Properties[OPT] array of key-value pairs containing custom specific data. Properties are accessible for payload processing.[String, String]
SamplingRateTime interval in seconds [s] in which data are polled.System.Double
ServiceRuleThe service rule enables and binds the client to the HumanOS® kernel.TServiceRuleConfig

DataLogger Configuration (Publisher)

Each publisher instance represents a client publishing data to a destination (data sink). Each publisher has its own configuration.

ParameterDescriptionData Type
IdId of the publisherSystem.Guid
NameName of the publisher. Used in log filesSystem.String
ConnectionConnection string of the data loggerSystem.String
DataSetsArray of data sets see DataSet Config.
NetworkTimeout[OPT] Timeout in milliseconds [ms] of the network call when sending or receiving data from the platform. Careful this impacts the buffering of data directly. Default is 1000msSystem.Double
PayloadDumpEnabled[OPT] Flag if payload dump is enabled.System.Boolean
PayloadDumpFileName[OPT] Filename of the log file to dump the payload. Payload is logged to a text file when a send of the payload is successfulSystem.String
PayloadDumpRetentionTime[OPT] Retention time in days [d] to keep the log files.System.Int32
PayloadScriptFileC# Script file to process datasets and generate the customized publish payload (message).System.String
Properties[OPT] array of key-value pairs containing custom specific data. Properties are accessible for payload processing.[String, String]
SamplerTypeType of the data sampler.EDataSamplerType
SamplingRateTime interval in seconds [s] in which log data is sent. If set to 0, then only data is sent on changes (event-based logging)System.Double
StartingSecondDefines the a starting second, e.g. 10 will trigger the logging on the next 10 second markSystem.Int32
MinimalInterruptionTimeMinimum time which the logger must rest between sendingSystem.Double
ProcessOnlyValidDataIf this flag is set, values are reported only if the data state is EDataState.GoodSystem.Boolean
ServiceRuleThe service rule enables and binds the client to the HumanOS® kernel.TServiceRuleConfig

Well known Properties

Here are some properties that are always available on a logger:

ParameterDescriptionData Type
LastTimeStampTimestamp of the last successful sendSystem.DateTime
ConnectedData logger is running and not bufferingSystem.Boolean
FunctionNode indicator, always 'DataLogger'System.String
SamplingRateThe sampling rate in which the data logger sends dataSystem.Double
BufferingIndicates wether the logger is bufferingSystem.Boolean

Sampler Type

The following values are possible for the property SamplerType:

ValueDescription
OnlyLastValueSends only the last value in the buffer. (last data received on interval end)
AllDataSends all data recorded between two sampling cycles as time series. (Send all data received during interval)

Buffering

Whenever a data logger cannot send its data to the endpoint, it enters the buffering mode.

SamplingRateSamplerTypeDescription
= 0msOnlyLastValueIn case of buffering the complete history is processed at once.
= 0msAllDataIn case of alarm and event buffering, all alarms are processed
> 0msOnlyLastValueReturns the history in sampling cycles, but only the last value within this cycle. If no values are present in current cycle, the last value of the prior cycle is returned. If history is empty, no data is returned.
> 0msAllDataReturns all history data within a sampling cycle. If no values are present in current cycle, no data is returned.
NOTE

For buffering, the history mode is required for data nodes and alarm event pools. See historization.

DataSet Configuration

The DataSet-element specifies the log entry data set. The data set contains fields.

info

The Dataset Name must be UNIQUE.

Configuration model for data sets

The dataset is specified by following elements (fields, more fields are possible):

ParameterDescriptionData Type
NameName of the fieldSystem.String
NodeFilterNode filter expression, e.g. node.hasProperty<string>("EnableMqtt", "1")System.String
TypeType of data provider. Possible values are: "AlarmEvent" (Alarm event objects), "DataNode" (data nodes)EDataSetType
TagTag data of the datasetSystem.String
Properties[OPT] array of key-value pairs containing custom specific data. Properties are accessible for payload processing.[String, String]
FieldsField data of the dataset. See Field Configuration.

DataField Configuration

ParameterDescriptionData Type
NameName of the fieldSystem.String
NodeFilterNode filter expressionSystem.String
DataTypeDatatypeSystem.Type
QueryExpression selecting the data from a node. Data from a node is always expressed in the following format: item.{DataField}. See Available Query Information. **System.String

Following objects can be used to query information:

QueryValue
item.GlobalIdGlobal node id
item.NodeData node object
item.TimeStampSource timestamp
item.ValueValue
item.DataStateDataState
item.getValue<T>(name)Gets the sub-value. Only available for TGenericEntity data types
logger.TimeStampSampler timestamp, takes into account the historization

Service Rules

Service rules are used to bind services and devices. More information about Service Rules.

Important:

  • Each client (publisher or subscriber) needs its own rule to bind and unbind nodes from devices. This allows to pipe each device to another Data Logger Client (broker, payload, etc.)

Understanding the Sampling Based Logger

If a sampling rate greater than zero is set, a sampling behavior applies. There are three main cases which can occur while sampling:

  • Case 1: Sample duration not exceeded and minimal interruption can be applied
    • Each sample is executed as scheduled
  • Case 2: Sample duration exceeded
    • Reschedules to the next possible execution based on the scheduling timeline
    • Will then add any missed data to the actual data
  • Case 3: Minimal interruption time cannot be applied
    • Minimal interruption time is applied and the scheduler will then behave as described in case 2

Below is an example with a sample rate of 2s and a minimal interruption time of 1s:

DataSampler Function