Import data tags: CSV file structure

Activate Cloud Logging and set up a data source

This article assumes you've already activated Cloud Logging (or started the 30 day free trial) and have set up a data source (including variables). View our corresponding guides if you haven't yet.

The import function in the Cloud Logging configurator is, together with the export function, built to easily and effortlessly copy data tags from one device to another. Additionally, you can use the import function to prepare data tags in a CSV file and load them all at once into your cloud logger.

This article explains the structure of the CSV file and the syntax of the corresponding settings. Despite the fact that every protocol is structured in it’s own way (i.e. Siemens S7 works with Data Blocks and OPC-UA doesn’t) a uniform file structure is applied for all protocols.

How to: export and import data tags

View the "Configure data tags"-guide about the actual steps of exporting and importing a CSV file.

CSV file structure

The structure of the CSV file needs to be correct for the import function to work properly. The headers (first row) of column 1-8 should look like this:

Identifier Address Name Logging interval Retention policy Edge aggregator Log event

The headers of column 9-11, only applicable when setting “log event” to “trigger”, should look like this:

Trigger address Trigger condition Trigger threshold

Each column represents a different setting and all are explained below. You can easily navigate to the desired section by pressing the corresponding header above.

Tip: an easy templateYou can quickly and easily create a template by first creating a single data tag using X4 Remote interface and then exporting this data tag to a CSV file, or download an empty template here: CSV Template.

Identifier

This variable ensures that every data source and variable in the your company remains unique, even when you give multiple variables the same name. An identifier only has to be unique for a certain data-source. Two different data-sources in the same company can have the same identifiers and can therefore import the same CSV-file.

Address

Every data tag needs to be linked to a variable. You do this by entering the address of the concerning variable. The address is fully explained in the “Import variables” article. Below you will find several examples.

Protocol Example address
Siemens D3.2.1
Modbus 2.1
OPC-UA ns=2;s=20001
BACnet/IP 2.4.85
Ethernet/IP Line1.RunTime.ACC
SMTP SMTP::Keyw:High
Digital input GPIO::

Name

You can name the data tags freely. It is advised to enter a very brief description of the variable (i.e. weight, temperature zone #1, emergency stop section B5).

Logging interval

This setting’s function depends on what you set as the type of log event.

Log on interval

Log on interval means the variable is logged every X seconds.

This setting determines the logging interval, which can be configured anywhere between 100ms – 1h, using milliseconds, seconds, minutes, or hour. Examples are listed in the table below.

Online (X4 Remote) Offline (CSV file)
Interval Logging interval
Every 500 milliseconds 500ms
Every 30 seconds 30s
Every 15 minutes 15m
Every hour 1h

Log on change or on trigger

Log on change means the variable is logged when its value changes, while log on trigger means the variable is logged when a custom trigger happens (view “Configure triggers” for more info).

This setting now determines the maximum amount of logged values per hour. If you have this set to “up to 100 values per hour” and the variable changes/triggers 101 times in an hour, then the 101th time won’t be logged. Don’t worry, the logging will continue when the next hour begins. All available options are listed in the table below.

Online (X4 Remote) Offline (CSV file)
Interval Logging interval
Up to 20000 values per hour 180ms
Up to 5000 values per hour 720ms
Up to 1000 values per hour 3600ms
Up to 500 values per hour 7200ms
Up to 100 values per hour 36s
Up to 50 values per hour 72s
Up to 25 values per hour 144s
Up to 10 values per hour 6m
Up to 5 values per hour 12m

Retention policy

The data storage duration is indicated in weeks with four options to choose from. Data older then the retention policy will be deleted from X4 Remote completely. The available options are:

Online (X4 Remote) Offline (CSV file)
Retention policy Retention policy
6 months 26w
2 years 104w
5 years 260w
7 years 364w

Edge aggregator

Note
This settings is only applicable when "log event" is set to "interval".

Supported hardware and firmware

Edge aggregator is supported on the x500 in firmware 3.7 and up. Please upgrade your firmware if you are running an older version.

To have reliable and accurate data the x500 is constantly requesting the variables’ value. The edge aggregator processes this data between logging intervals. There are four formulas to choose from.

Online (X4 Remote) Offline (CSV file)  
Formula Edge aggregator Description
Mean mean Add all values and divides the total by the number of values between every logging interval to get an average value.
Min min Log the lowest value between every interval.
Max max Log the highest value between every interval.
Last last Log the latest recorded value between every interval.

Log event

This setting, together with the “logging interval“-setting, determines when the variable will be logged. All options are listed in the table below.

Online (X4 Remote) Offline (CSV file)  
Log on … Log event Description
Interval interval Log every X seconds.
Change change Log when its value changes.
(i.e. for data that doesn’t change often
or only has a few states like a bool/int)
Trigger trigger Log when a custom trigger happens.
(view “Configure triggers” for more info)

Trigger address

Note
This settings is only applicable when "log event" is set to "trigger".

Note
This setting is the same as the "address" field in the triggers CSV file.

Here you enter the address corresponding with the variable you’d like to use as trigger. For example, when using Modbus and the variable is a holding register with address 7, you enter a 7 here. If you’re unsure you can best export an existing trigger first.

Trigger condition

Note
This settings is only applicable when "log event" is set to "trigger".

Note
This setting is the same as the "condition" field in the triggers CSV file.

A trigger happens if the outcome of <variable><condition><threshold> is true. For example, if variable “Temperature” is “greater than or equal to” “60” degrees celsius. The available options for the condition are:

Online (X4 Remote) Offline (CSV file)
Condition Condition
Equal to ==
Not equal to !=
Less than <
Less than or equal to <=
Greater than >
Greater than or equal to >=

Trigger threshold

Note
This settings is only applicable when "log event" is set to "trigger".

Note
This setting is the same as the "threshold" field in the triggers CSV file.

The threshold is the last part of the equation that determines if a trigger happens or not. The available options depend on the variable’s data type. For example, if the variable’s data type is boolean, then you can choose either TRUE or FALSE.

 

Contact form