# 23 Data Export ## General Various protocols are made to transmit data points as they are generated. This is enough for a lot of systems (e.g. SCADAs) that have their own databases and devices only have to buffer fairly recent messages in case of connection or transmission errors. However, there is frequently a need to save and keep the data in files, grouped in batches, and later transmit these batches to a remote server via HTTP(S) or FTP(S). For this purpose a dedicated protocol has been created and called **Data export.**
Data export functionality is available since firmware version v1.5.0, of WCC Lite.
## Overview Data export service gathers information from other protocols, puts it into files (optionally compressing them) after a timeout or when data buffers fill up; eventually periodically sending them to a server. HTTP(S) and FTP(S) servers with optional authentication are supported. A user can optionally choose between ISO8601 and UNIX timestamp time formats (the latter being the default value). More than one instance can set up, for instance, some of the information can be sent to an FTP server, while other could be transmitted to the HTTP server which is able to handle POST requests. ## Using WCC Lite for data export To configure WCC Lite to use data export server a user can fill in the needed parameters in Excel configuration. These parameters are shown in two tables below. Default values are shown in a bold font. *Data export (data-export) parameters for Devices tab table:***Parameter** | **Type** | **Description** | **Required | **Default value** (when not specified) | **Range** | |
Min | Max | |||||
name | string | User-friendly device name | Yes | |||
device\_alias | string | Device alias to be used in configuration | Yes | |||
enable | boolean | Enabling/disabling of a device | No | 1 | 0 | 1 |
protocol | string | Selection of protocol | Yes | Data Export | ||
timeout | integer | Time frame during which transmission to remote server has to be completed (**in seconds**) | No | 5 | ||
type | string | Selection of file format | No | csv-simple | cvs-periodic csv-simple, json-simple, json-samples | |
host | string | A URL of remote server where files should be sent | Yes | |||
upload\_rate\_sec | integer | Frequency of generated file uploads (**in seconds)** | No | 60 | ||
records\_buffer\_size | integer | A maximum amount of data change entries to hold before initiating logging mechanism | No | 100 | ||
logging\_period\_sec | integer | Describes how frequently data buffer of records\_buffer\_size is saved to file | No | 10 | 1 | 3600 |
log\_folder | string | A folder in WCC Lite file system to save generated file (**”/var/cache/data-export”**) | No | |||
timestamp | string | Selection of time format | No | unixtimestamp | unixtimestamp, iso8601 | |
compress | string | Selection of file compression mechanism | No | none | none, gz, tar.gz | |
compress\_password | string | Enable feature of file password protection | No | yes, true | ||
csv\_field\_separator | string | Columns separator in .csv file format | No | "," - (comma) | "," - (comma) ";" - (semicolon) "." - (dot) " " - whitespace) "|" - (pipe) | |
csv\_decimal\_separator | string | Decimal separator in values | No | "." - (dot) | "." - (dot) "," - (comma) |
Same symbols cannot be selected for both csv\_field\_separator and csv\_decimal\_separator. In such case both of them will be set to default values ”.” and ”,” respectively.
It is possible that data generation rate is going to be bigger than what data buffer can hold (controlled by *records\_buffer\_size* and *logging\_period\_sec*). To make sure that no data loss occurs there’s an additional data logging call made in case data buffer reaches a *records\_buffer\_size* value. Signals to be sent are configured differently than signals for most other protocols. As data export service only transmits signals and does no data processing, usual signal logic is not used for them. That means that: • Signals for data export service are not seen in the *Imported Signals* tab; • Signals for data export service are configured in different Excel sheet called DataExport Parameters to be filled in the DataExport sheet are shown in a table below. *Data export (data-export) parameters for DataExport tab***Parameter** | **Type** | **Description** | **Required | **Default value** (when not specified) | **Range** | |
Min | Max | |||||
device\_alias | string | Device alias to be used in configuration Yes | Yes | |||
device\_name | string | User friendly device name as in Device sheet | Yes | |||
tag\_name | string | User friendly signal name | Yes | |||
source\_device\_alias | string | device\_alias of a source device | Yes | |||
source\_signal\_alias | string | source\_alias of a source signa | Yes | |||
enable | boolean | Enabling/disabling of a measurement to be transmitted and logged | No | 1 | 0 | 1 |
attribute | string | Additional attribute to be attached to a signal | No |
The below-described parameters for debugging are accessible over console (SSH).
`-h [--help] Display help information` `-c [--config] Configuration file location` `-V [ –version ] Show version` `-d