# 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. SCADA) that have their 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 and 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 be set up, for instance, some of the information can be sent to an FTP server, while others could be transmitted to the HTTP server which can handle POST requests. ## Using WCC Lite for data export To configure WCC Lite to use a data export server a user can fill in the needed parameters in Excel configuration. These parameters are shown in the two tables below. Default values are shown in 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 | The time frame during which transmission to the 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 the 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 the logging mechanism | No | 100 | ||
logging\_period\_sec | integer | Describe how frequently the data buffer of records\_buffer\_size is saved to the file | No | 10 | 1 | 3600 |
log\_folder | string | A folder in the WCC Lite file system to save generated files (**”/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 the 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) |
The 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.
The data generation rate may be bigger than what the 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 the 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 a different Excel sheet called DataExport The parameters to be filled in the DataExport sheet are shown in the table below. *Data export (data-export) parameters for the 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 the 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 signal | Yes | |||
enable | boolean | Enabling/disabling of a measurement to be transmitted and logged | No | 1 | 0 | 1 |
attribute | string | An additional attribute to be attached to a signal | No |
The below-described parameters for debugging are accessible over the console (SSH).
`-h [--help] Display help information` `-c [--config] Configuration file location` `-V [ –version ] Show version` `-d