Import data tags: CSV file structure

Activate Cloud Logging and set up a data source

This article assumes you’ve already 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 on the left 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-6 should look like this:

AddressNameLogging intervalRetention policyEdge aggregatorLog event

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

Trigger addressTrigger conditionTrigger 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 template

You can quickly and easily create a template by first creating a single data tag using the X4 remote interface and then exporting this data tag to a 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.

ProtocolExample address
SiemensD3.2.1
Modbus2.1
OPC-UAns=2;s=20001
BACnet/IP2.4.85
Ethernet/IPLine1.RunTime.ACC
SMTPSMTP::Keyw:High
Digital inputGPIO::

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)
IntervalLogging interval
Every 500 milliseconds500ms
Every 30 seconds30s
Every 15 minutes15m
Every hour1h

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)
IntervalLogging interval
Up to 20000 values per hour180ms
Up to 5000 values per hour720ms
Up to 1000 values per hour3600ms
Up to 500 values per hour7200ms
Up to 100 values per hour36s
Up to 50 values per hour72s
Up to 25 values per hour144s
Up to 10 values per hour6m
Up to 5 values per hour12m

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 the X4 remote completely. The available options are:

Online (X4 remote)Offline (CSV file)
Retention policyRetention policy
6 months26w
2 years104w
5 years260w
7 years364w

Edge aggregator

Information

This settings is only applicable when “log event” is set to “interval”.

To have reliable and accurate data the x500 IoT gateway 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)
FormulaEdge aggregatorDescription
MeanmeanAdd all values and divide the total by the number of values between every logging interval to get an average value.
MinminLog the lowest value between every interval.
MaxmaxLog the highest value between every interval.
LastlastLog 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 eventDescription
IntervalintervalLog every X seconds.
ChangechangeLog when its value changes.
(i.e. for data that doesn’t change often
or only has a few states like a bool/int)
TriggertriggerLog when a custom trigger happens.
(view “Configure triggers” for more info)

Trigger address

Information

This settings is only applicable when “log event” is set to “trigger”.

Information

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

Information

This settings is only applicable when “log event” is set to “trigger”.

Information

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)
ConditionCondition
Equal to==
Not equal to!=
Less than<
Less than or equal to<=
Greater than>
Greater than or equal to>=

Trigger threshold

Information

This settings is only applicable when “log event” is set to “trigger”.

Information

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.