Collector Simulated data
  • 11 Aug 2021
  • 4 Minutes to read
  • Contributors
  • Dark
    Light
  • PDF

Collector Simulated data

  • Dark
    Light
  • PDF

Article Summary

The purpose of this article is to be a reference for the Aggregation part of the full Data Collection Module documentation

Prerequisite

A Starter package (SiteManager + accounts)



Simulator data possibilities
  • "counter"
  • "sawtooth" 
  • "oscillator" 
  • "sine"

Config main

The Config main (array of objects, mandatory) contain the following fields:

FunctionTypeImportanceDescription
ConfigNamestringmandatoryUnique name for this configuration file. Follows the rules for names.
ConfigDescriptionstringoptionaltext describing this configuration.
CheckpointIntervalinteger == 0 or >= 60optionalThe interval with which all data from the internal datasample cache is saved to disk. This more unstable (power) the SiteManager, the more often data should be saved. Saving it often, however will also cost performance and wear on the hard-disk/flash. A value of 0 means, never checkpoint, otherwise it means interval in seconds between saves. If not specified the value 15 * 60 (15 minutes) is used.
AlarmsSavedinteger >= 4optionalThe number of alarms saved in the store-and-forward database. If this values is not specified, it will default to 32.
WaitForNTPbooleanoptionalSynchronize DCM data collection with NTP time. If this parameter is true, all DCM collectors will not begin collecting data until NTP is enabled and configured and NTP has synchronized date/time. If not specified, the value is true.

Since the JSON format itself doesn't define a comment notation, DCM accepts a fieldname comment with any type of value in any section.

Example of comment

"Comment": "Example of a comment for use in any section.": 

The Collectors (array of objects, mandatory) list elements contains the following fields:

FunctionTypeImportanceDescription
CollectorNamestringmandatoryThe unique name (within this configuration file) of a device to collect data from. (This is the name used in the agent configuration). Follows the normal rules for names.
CollectorDescriptionstringoptionalDescription of this collector.
CollectorIPAddrstringoptionalProvides a default IP address (or DNS name) for the device to be polled. The agent Target IP address will take precedence over this.
CollectorPortnointeger > 0 and < 65535optionalProvides the default port number for the device to be polled. The agent Target Port number will take precedence over this. If neither CollectorPortno, nor agent Target Port Number, is specified, the appropriate port will be used, depending on the Protocol parameter value.
AliasstringoptionalThis is the CollectorName of another collector from which all the parameters (expect CollectorName, CollectorDescription, CollectorIPAddr and CollectorPortno) are copied from. An alias cannot refer to another alias.
Protocolstring-enummandatoryThe protocol used to collect data. Currently 7 possible values exist: "OPC-UA/TCP", "Modbus/TCP", "S7/TCP", "Http/GET", "Rockwell", "Simulator" and "Internal".
ConnectRetryMininteger > 0mandatoryMinimum number of seconds before trying to reestablish a connection to the device being sampled. An exponential back-off algorithm is used to retry connection establishment, starting after ConnectRetryMin and increasing to ConnectRetryMax.
ConnectRetryMaxinteger > 0mandatoryMaximum number of seconds before trying to reestablish a connection to the device being sampled.
SamplePointsarray of objectsmandatoryList of samples to be collected, possibly aggregated and stored in the Store'n'Forward database.


Samplepoint items

The SamplePoints objects contains the following elements:

FunctionTypeImportanceDescription
SampleNamestringmandatoryName of this sampled value (sometimes called a tagname). Follows the normal rules for names.
SampleDescriptionstringoptionalIs a text description of this sample value.
SampleUnitstringoptionalIs a description of the unit of measurement for this sample.
SampleGroupstringoptionalDesignates (in some datasrvs) that all samplepoints in that group should be handled (displayed) together. The DCM system itself places no meaning on this group affiliation.
SamplesSavedinteger > 0optional
The number of values collected that is saved in the Store'n'Forward database even after the values have been sent to all dataservers. When 0 is specified, the value can be used in aggregators. but nothing is sent via dataservers to cloud system. If left unspecified, values are only saved in the Store'n'Forward database until they have been delivered to all dataservers.
OnlySaveOnChangedbooloptionalControl if new sample values should only be saved to the Store’n’Forward database if the values have changed since last sample. If not set, it is false.
SampleDataTypestring-enummandatoryThe type of data collected. The possible values are: "bool" (1 bit), "sbyte" (8 bit signed), "byte" (8 bit unsigned), "int16" (16 bit signed), "uint16" (16 bit unsigned), "int32" (32 signed), "uint32" (32 bit unsigned), "int64" (64 bit signed), "uint64" (64 bit unsigned), "float" (32 bit), "double" (64 bit), "string" (variable text up to 24575 bytes. Includes terminating NUL), "data" (variable variable data up to 24575 bytes).
SampleMaxVDataSize
integer > 0 and <= 24575
optional
The max size of variable data enforced for this sample. This is only relevant for SampleDataType "string" or "data". If not specified, the value is 1024.
SampleLowerLimitinteger/doubleoptionalThe lower limit for the collected data. If the collected data value is less than SampleLowerLImit, it is evaluated in accordance to SampleLimitDiscard and SampleLimitAlarm.
SampleUpperLimitinteger/doubleoptionalThe upper limit for the collected data. If the collected data value is more than SampleUpperLimit, it is evaluated in accordance to SampleLimitDiscard and SampleLimitAlarm.
SampleLimitDiscardboolmaybe-optionalControls if a sample limit violation results in the sample value being discarded. Mandatory if either SampleLowerLimit or SampleUpperLimit is present.
SampleLimitAlarmboolmaybe-optionalControls if a sample limit violation generates an alarm. Mandatory if either SampleLowerLimit or SampleUpperLimit is present.
SimulatorDataObjectmaybe-optionalDescription of the simulation behaviour of this sample point. Mandatory if the protocol type is "Simulator".


Simulatordata

The SimulatorData object contains the following elements:

FunctionTypeImportanceDescription
InternalFunctionstring-enummandatoryThis is the simulation function to be performed. The currently possible values are: 
  • "counter", 
  • "sawtooth", 
  • "oscillator", 
  • "sine".
If none are specified, "counter" will be used.
SimulatorInitValuedoublemandatoryThe initial value of the simulation data.
SimulatorIncValuedoublemandatoryThe value added to the simulation data every sample interval.
SimulatorTimescaledoubleoptionalThe timescale (in seconds) the simulation data is being generated. If not specified, the value defaults to same SimulatorSampleInterval value unless it 0, then the value default to 1. If you use the same value for SimulatorTimescale and SimulatorSampleInterval, the functions appear "perfect".
SimulatorSampleIntervalinteger >= 0mandatoryThe number of seconds between each sample of this Simulator object. If the interval is 0, only eventdriven polling is used.


Aggregation samplepoint for condition monitoring (Eventbased logging).

{
  "CollectorDescription": "SDCM Internal Values Server",
  "CollectorName": "demointernal",
  "Protocol": "Internal",
  "SamplePoints": [
    {
      "SampleDataType": "double",
      "SampleDescription": "CPU load",
      "SampleLimitAlarm": false,
      "SampleLimitDiscard": false,
      "SampleLowerLimit": -1000,
      "SampleName": "CPU",
      "SampleUpperLimit": 1000,
      "SamplesSaved": 3000000,
      "InternalData": {
        "InternalFunction": "CPULoad",
        "InternalSampleInterval": 1
      }
    },
    {
      "SampleDataType": "double",
      "SampleDescription": "FreeMem",
      "SampleLimitAlarm": false,
      "SampleLimitDiscard": false,
      "SampleLowerLimit": -1000,
      "SampleName": "FreeMemory",
      "SampleUpperLimit": 1000,
      "SamplesSaved": 3000000,
      "InternalData": {
        "InternalFunction": "FreeMem",
        "InternalSampleInterval": 1
      }
    },
    {
      "SampleDataType": "double",
      "SampleDescription": "SystemTemperature",
      "SampleLimitAlarm": false,
      "SampleLimitDiscard": false,
      "SampleLowerLimit": -1000,
      "SampleName": "SystemTemperature",
      "SampleUpperLimit": 1000,
      "SamplesSaved": 3000000,
      "InternalData": {
        "InternalFunction": "SystemTemperature",
        "InternalSampleInterval": 1
      }
    }
  ]
}

See complete simulator examples in the related articles section below:


Was this article helpful?