avatar  


Recently viewed tickets

Log out

Simulator Dataserver

The purpose of this article is as a reference guide for the use of the Simulator Dataserver.
This is not a real cloud service, but just a test service that throws away data instead of sending them to a Cloud service. It still maintains all statistics counters and can be used during testing of collectors.

Prerequisite:

A Starter package (SiteManager + accounts) 
Eventually a device to collect data from (PLC, HMI, Controller)
Other sections in DCM:




The DataServers (array of objects, mandatory) list elements contains the following fields:
FunctionTypeImportanceDescription
DatasrvNamestringmandatoryUnique (within this configuration file) name for each dataserver, this SiteManager delivers data to. Follows the normal rules for names.
DatasrvDesriptionstringoptionalA description of this data server. For your future reference
SampleListarray of stringsoptional This array contains the list of sampleref, this dataserver will deliver data for. If it is not present, all sample values in this configuration will be delivered. Since this object is not a Collectors object, the CollectorName part of the sampleref field is mandatory. If the SampleName part of the sampleref is left blank, all samples from that collector are delivered.
IOPinbooleanoptionalIf set to true, the Output I/O pins configured to follow DCM dataloss, will be controlled by this datasrv. If multiple dataservers are controlling the I/O pins, then the value will be the logical OR of all dataservers data loss state. (I.e. If any dataserver is in dataloss, the I/O pins will be in logical high). If not set, the value is false.
DatasrvProtocolstring-enummandatoryDesignates the protocol used to deliver data from the Store'n'Forward database to data servers, aka Cloud Systems. For Simulator use "SIMULATOR/NONE".
Currently 6 possible values exists: "AWS/MQTT", "AZURE/IOTHUB", "SCI/SPD", "C8Y/REST", "SEMA/REST" or "SIMULATOR/NONE".
ConnectRetryMininteger > 0mandatoryMinimum number of seconds before trying to reestablish a connection to the dataserver for data delivery. 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 dataserver for data delivery.
SimulatorParamsobjectmandatory
for Simulator Cloud
Contains all the parameters needed to deliver (publish) data to a simulated Cloud. Mandatory if DatasrvProtocol has the value "SIMULATOR/NONE". This is not a real cloud service, but just a test service that throws away data instead of sending them to a Cloud service. It still maintains all statistics counters and can be used during testing of collectors.

The SimulatorParams object contains the following fields:
FunctionTypeImportanceDescription
PushIntervalinteger >= 0mandatoryTThe interval in seconds between each delivery of new data from the store'n'forward database. The value 0 means that data is delivered as fast as possible.
PayloadFormatstringoptional This string describes the format of the payload reported to Sema. The format is as for the MQTTAWSParams PayloadFormat field. If not specified the format is %jd:%js,%jv,%T.
BulkElementFormatstringoptionalThis string describes the format of the element used by the "%b" format used in the PayloadFormat. The format is the same as for MQTTAWSParams PayloadFormat. If not specified this bulk element format is not used.
MaxFrameSizeinteger > 0optionalThis integer specifies the maximum frame size used, if the BulkElementFormat is used to buffer up payloads. If not specified, the value is 4096.
DropNthFrameinteger >= 0optionalThis value makes the Simulated Cloud Service drop 1 in DropNthFrame frames and thus force the Store'n'Forward database to re-transmit all the values contained in that dropped frame.

'm' - SiteManager Unique address. (This is NOT the MAC address, but the EdgeID )
'M' - SiteManager Unique MAC address.
'N' - SiteManager Name. (GateManager Appliance Name).
'V' - Configuration version ID.
'd' - Collector name.
's' - Sample name.
'u' - Sample unit. If undefined, an empty string.
'g' - Sample group name. If undefined, the sample name will be used.
't' - Timestamp value as an integer. (64bit 100ns resolution)
'T' - Timestamp as ISO-8601 time string. (2018-11-12T14:04:46.114)
'e' - Timestamp as an integer. (32bit Unix Epoch).
'E' - Timestamp as an integer. (64bit Unix Epoch in millisecond resolution).
'v' - Sample value as a string. (binary data as hex byte string)
'b' - Multiple values are delivered (in bulk) as an array, described in the BulkElementFormat .
'%' - A percent character. The format can be prefixed with 'j', which will perform escape sequence to data according to the RFC 7159 (JSON) standard. If not specified, the format is { "v" : [ %jb ] } .



{
 "DatasrvName":"Simulated cloud",
 "DatasrvProtocol":"SIMULATOR/NONE",
 "ConnectRetryMin":2,
 "ConnectRetryMax":240,
 "SimulatorParams":{
   "PublishInterval":0,
   "PayloadFormat":"{ \"%js\" : %jv, \"timestamp\" : %t }"
   }
 }
Creation date: 21/08/2020 15:30 (tvo@secomea.com)      Updated: 02/09/2020 13:38 (tvo@secomea.com)