The purpose of this article is to serve as be a reference for the Simulated Data collector part of the full Data Collection Module documentation.
The Simulator collector is used to simulate samples (data points) as if they were collected from real equipment.
Data simulated
The Collector Simulated Data can generate data with these patterns:
- Counter
- Saw tooth
- Oscillator
- Sine wave
Configuration
The data collector configuration consist of the fields described below.
Main section
The top level of the data collector contains the following fields:
Function | Type | Importance | Description |
---|---|---|---|
CollectorName | string | mandatory | 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. |
CollectorDescription | string | optional | Description of this collector. (For your use, no system function). |
CollectorIPAddr | string | optional | Default IP address (or DNS name) for the device to be polled. The agent Target IP address will take precedence over this. |
CollectorPortno | integer > 0 and < 65535 | optional | 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. |
Alias | string | optional | This is the CollectorName of another collector, from which all the parameters (except CollectorName, CollectorDescription, CollectorIPAddr and CollectorPortno) are copied. An alias cannot refer to another alias. |
Protocol | string-enum | mandatory | The protocol used to collect data. The value must be Simulator to use the Simulated Data collector. |
ConnectRetryMin | integer > 0 | mandatory | The minimum number of seconds before trying to re-establish a connection to the device being sampled. An exponential backoff algorithm is used to retry connection establishment, starting after ConnectRetryMin and increasing to ConnectRetryMax. |
ConnectRetryMax | integer > 0 | mandatory | The maximum number of seconds before trying to re-establish a connection to the device being sampled. |
SamplePoints | Array of objects | mandatory | List of samples to be collected, possibly aggregated and stored in the Store and Forward database. |
SamplePoints object
The SamplePoints objects contains the following fields:
Function | Type | Importance | Description |
---|---|---|---|
SampleName | string | mandatory | Name of this sampled value. Follows the normal rules for names. |
SampleDescription | string | optional | A text description of this sample value. |
SampleUnit | string | optional | A description of the unit measurement for this sample. |
SampleGroup | string | optional | Group affiliation. All sample points in the same group (in some datasrvs) should be handled (displayed) together. The DCM system itself places no meaning on this group affiliation. |
SamplesSaved | integer > 0 | optional | The number of collected values that are saved in the Store and Forward database even after the values have been sent to all data servers. When 0 is specified, the value can be used in aggregators. but nothing will be sent via dataservers. If left unspecified, values are only saved in the Store and Forward database until they have been delivered to all data servers |
OnlySaveOnChanged | boolean | optional | Specifies if new sample values should be saved to the Store and Forward database only when the value is different from the last sample value. Default: false . |
ChangeLimit | integer/double | optional | Used if OnlySaveOnChanged is true . Specifies an amount which a sample must be greater than, to count as a changed value. This is a simple hysteresis to filter out inaccurate (jitter) measurements. Default: 0 |
SampleDataType | string-enum | mandatory | The 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 data up to 24575 bytes). |
SampleMaxVDataSize | integer > 0 and <= 24575 | optional | The max size of variable data allowed for this sample. This is only relevant for SampleDataType string or data . If not specified, the value is 1024 . |
SampleLowerLimit | integer/double | optional | The lower limit for the collected data. If the collected data value is less than SampleLowerLimit it is evaluated in accordance with SampleLimitDiscard and SampleLimitAlarm. |
SampleUpperLimit | integer/double | optional | The upper limit for the collected data. If the collected data value is more than SampleUpperLimit it is evaluated in accordance with SampleLimitDiscard and SampleLimitAlarm. |
SampleLimitDiscard | boolean | maybe-optional | Specifies whether samples that violates the sample limit should be discarded. Mandatory if either SampleLowerLimit or SampleUpperLimit is present. |
SampleLimitAlarm | boolean | maybe-optional | Specifies whether samples that violates the sample limits should generate an alarm. Mandatory if either SampleLowerLimit or SampleUpperLimit is present. |
SimulatorData | object | mandatory | Specification of the simulation behaviour of this sample point. Mandatory if the protocol type is Simulator . |
Simulatordata object
The SimulatorData object contains the following elements:
Function | Type | Importance | Description |
---|---|---|---|
SimulatorInitValue | double | mandatory | The initial value of the simulation data. |
SimulatorIncValue | double | mandatory | The value added to the simulation data every sample interval. |
SimulatorSampleInterval | integer >= 0 | mandatory | The number of seconds between each sample of this Simulator object. If the interval is 0 , only eventdriven polling is used. |
InternalFunction | string-enum | optional | This is the simulation function to be performed. The possible values are: counter , sawtooth , oscillator and sine . If none are specified, counter will be used. |
SimulatorTimescale | double | optional | The 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". |
Below is an example of a Internal Collector configuration:
{
"CollectorDescription": "DCM Collector Simulated Data",
"CollectorName": "SimulatedData",
"Protocol": "Simulator",
"SamplePoints" : [
{
"SampleName" : "counter",
"SampleDescription" : "DCM simulation of counter",
"SamplesSaved" : 300,
"SampleDataType" : "uint32",
"SimulatorData" : {
"SimulatorFunction" : "counter",
"SimulatorInitValue" : 20,
"SimulatorIncValue" : 2,
"SimulatorSampleInterval" : 1
}
},
{
"SampleName" : "sawtooth",
"SampleDescription" : "DCM simulation of sawtooth",
"SamplesSaved" : 300,
"SampleDataType" : "uint32",
"SimulatorData" : {
"SimulatorFunction" : "sawtooth",
"SimulatorInitValue" : 20,
"SimulatorIncValue" : 2,
"SimulatorSampleInterval" : 1
}
},
{
"SampleName" : "oscillator",
"SampleDescription" : "DCM simulation of oscillator",
"SamplesSaved" : 300,
"SampleDataType" : "uint32",
"SimulatorData" : {
"SimulatorFunction" : "oscillator",
"SimulatorInitValue" : 20,
"SimulatorIncValue" : 2,
"SimulatorSampleInterval" : 1
}
},
{
"SampleName" : "sine",
"SampleDescription" : "DCM simulation of sine curve",
"SamplesSaved" : 300,
"SampleDataType" : "double",
"SimulatorData" : {
"SimulatorFunction" : "sine",
"SimulatorInitValue" : 1000,
"SimulatorIncValue" : 100,
"SimulatorSampleInterval" : 1
}
}
]
}