# Data Export ### Introduction This article describes how to configure Wcc Lite to export data to external servers step by step.

Data export functionality is available since firmware version v1.5.0, of WCC Lite.

[![Data Export.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/gCcdata-export.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/gCcdata-export.png) Fig. 1 Wcc Lite's gathered data export to external server ### First step: Configuring the Devices sheet of excel configuration To fully configure the "Data Export" device and it's signals, user can use the tables provided in the manual of Wcc Lite -> [Data Export section](https://wiki.elseta.com/link/1215#bkmrk-data-export-%28data-ex) or use the tables below in this article. Important to notice that some parameters to declare the Data Export device and it's signals are required and some of them are optional. In this article we will mainly use the required ones and a few of the optional parameters, to reach the desired outcome of signals exporting. Also, some parameters has default values, even if the parameters are not required, so please make sure that the default value is the same as needed, otherwise change it to the correct one from the available choices and describe it in excel configuration. *Data export (data-export) parameters for Devices tab table:*
**Parameter** **Type** **Description** **Required **Default value** (when not specified) **Range**
Min Max
namestringUser-friendly device name Yes
device\_aliasstringDevice alias to be used in configuration Yes
enablebooleanEnabling/disabling of a device No101
protocolstringSelection of protocol Yes Data Export
timeoutintegerThe time frame during which transmission to the remote server has to be completed (**in seconds**) No5
typestringSelection of file format Nocsv-simplecvs-periodic csv-simple, json-simple, json-samples
hoststringA URL of the remote server where files should be sent Yes
upload\_rate\_sec integerFrequency of generated file uploads (**in seconds)** No60
records\_buffer\_size integerA maximum amount of data change entries to hold before initiating the logging mechanism No100
logging\_period\_sec integerDescribe how frequently the data buffer of records\_buffer\_size is saved to the file No
10
1
3600
log\_folder stringA folder in the WCC Lite file system to save generated files (**”/var/cache/data-export”**) No
timestamp stringSelection of time format Nounixtimestampunixtimestamp, iso8601
compress stringSelection of file compression mechanism Nononenone, gz, tar.gz
compress\_password stringEnable the feature of file password protection No yes, true
csv\_field\_separator stringColumns separator in .csv file format No"," - (comma)"," - (comma) ";" - (semicolon) "." - (dot) " " - whitespace) "|" - (pipe)
csv\_decimal\_separator stringDecimal 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 going to 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. For this example configuration, the Wcc Lite's template configuration for IOMod 8AI Modbus RTU protocol is being used. Simply in Devices sheet add the information required for Data Export service. As it can be seen in **Fig. 2** to declare the Data Export device in Devices sheet a few parameters were used: ***name**, **description**, **device\_alias**, **enable**, **protocol**, **type**, **upload\_rate\_sec**, **record\_buffer\_size**, **timestamp*** and ***host***. [![image-1727685097922.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/image-1727685097922.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/image-1727685097922.png) Fig. 2 Describing the Data Export service in Devices sheet of excel configuration #### Host URL format rules The parameter host is highly configurable and might contain a considerable amount of information: • *Protocol* - FTP or HTTP (encrypted and encrypted); • *URL address* - both resolved and non-resolved; • *Authentication* - pair of users and/or passwords; • *Port* - useful when non-standard value is used; • *Endpoint* - a place in the server to which a call is made The format for the host parameter can be summarized as: `[ h t t p ( s ) / f t p ( s ) ] : / / [ [ u s e r ] : [ p a s s w o r d ]@] [ URL ] [ : p o r t ] / [ e n d p o i n t ]` Options are printed in square brackets. A protocol has to be selected, otherwise HTTP will be used as a default. The user and password pair is optional, but if the user: password pair is used, it should proceed with the @ sign. HTTP and FTP use default or user-assigned ports. By default HTTP uses port 80, while HTTPS uses port 443, FTP sends data over port 21, FTPS - over port 990. Make sure that these ports are open in the firewall on both the server and client side, otherwise, data will not be sent successfully. Finally, a POST request (for HTTP) or upload (for FTP) can be made to a specific place (endpoint). This endpoint should be described after a URL and port (if used). ### Second step: Configuring the DataExport sheet of excel configuration 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 stringDevice alias to be used in configuration Yes Yes
device\_name stringUser-friendly device name as in the Device sheet Yes
tag\_namestringUser-friendly signal name Yes
source\_device\_aliasstringdevice\_alias of a source device Yes
source\_signal\_aliasstringsource\_alias of a source signal Yes
enablebooleanEnabling/disabling of a measurement to be transmitted and logged No101
attributestringAn additional attribute to be attached to a signal No
To configure Wcc Lite to export data to an external server user must declare the signals for every measurement that needs to be exported, as well as describe the device (Data Export) in Devices sheet. This is done simply by linking signals from other protocols to the signals declared for exporting data. In **Fig. 3** it is shown how measurements from IOMod 8AI (Signals\_IOMod sheet ***device\_alias*** and ***signal\_alias***) are linked to the signals (DataExport sheet ***source\_device\_alias*** and ***source\_signal\_alias***) that will be exported to the server, which is declared as "Host" parameter in Devices sheet of excel configuration. [![image-1727679471995.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/image-1727679471995.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/image-1727679471995.png) Fig. 3 Linking of the measurements from IOMod 8AI to Data Export signals ### Data representation in HTTP(S) server First thing to mention, that if user wants to export the data to an external server, the Wcc Lite should have access to the internet. This is done simply by connecting Wcc Lite's ETH1 port to the Ethernet port of the internet router. [![image-1727692655347.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/image-1727692655347.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/image-1727692655347.png) Fig. 4 Wcc Lite's ETH1 port connected to the internet router for internet access For the representation of data in HTTP(S) or FTP(S) servers, user can use one of the available servers that can be found online. In this specific example Pipedream.com online HTTP server was used. When registered to the site, generate the URL for the server. This URL can be seen in example configuration Devices tab "host" parameter for Data Export device (*https://eo1167h7o8m7ur6.m.pipedream.net).* When the communication between Wcc Lite and IOMod is normal, and Wcc Lite is gathering measurements through Modbus RTU protocol, these measurement, as described before, are linked to Data Export signals. These signal values then are exported to the predefined HTTP(S) server in a defined file format. On the Pipedream.com online server a POST request (for HTTP) is being done and the data has been exported to it. As it can be seen in the **Fig. 5**, first URL is the same as the one declared in "Host" parameter for the Data Export service. Then the File and it's name, where the gathered data is being put and the URL on the bottom to download this file. How these measurements are represented in json\_samples format can be seen in **Fig. 6** and in the *tag-log-1727347342174741-322120016.json* file on the bottom of this article. Also to see other file formats for exported data please check [Data Export](https://wiki.elseta.com/link/1215#bkmrk-format-of-exported-d) article in Wcc Lite manual. [![image-1727694123312.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/image-1727694123312.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/image-1727694123312.png) Fig. 5 Information in Pipedream.com HTTP server about the data packet exported from Wcc Lite [![image-1727695036056.png](https://wiki.elseta.com/uploads/images/gallery/2024-09/scaled-1680-/image-1727695036056.png)](https://wiki.elseta.com/uploads/images/gallery/2024-09/image-1727695036056.png) Fig. 6 Measurements exported in json-samples format ##### Files used in this article: 1\. [IOMod8AI\_data\_export.xlsx](https://wiki.elseta.com/attachments/621) [2. tag-log-1727347342174741-322120016.json](https://wiki.elseta.com/attachments/620)