The import function in the data source configurator is, together with the export function, built to easily and effortlessly copy variables from one device to another. Additionally, you can use the import function to prepare variables in a CSV file and load them all at once into your configurator.
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.
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:
Each column represents a different setting and these are all explained below. Easily navigate to the desired section by pressing the corresponding header above.
Name
You can name the variables freely. It is advised to enter a very brief description of the variable (i.e. weight, temperature zone #1, emergency stop section B5).
Address
The address is protocol specific, since every protocol has its own structure, and is explained separately for the following protocols:
Siemens
On the X4 remote you can enter your variable’s region (DB, I, M, or Q) and address. If you have selected DB as region, you will see an additional field named “Data block“. The example table below shows how to list the addresses in the CSV file.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Region | Data block | Address | Address |
DB | 3 | 2.1 | 3.2.1 |
I | 2.1 | I2.1 | |
M | 2.1 | M2.1 | |
Q | 2.1 | Q2.1 |
Modbus TCP/IP
On the X4 remote you can enter your variable’s function code (coils, discrete input, holding registers, or input registers) and address. The example table below shows how to list the addresses in the CSV file.
Online (X4 remote) | Offline (CSV file) | |
---|---|---|
Function code | Address | Address |
1 – Coils | 1 | 1.1 |
2 – Discrete input | 1 | 2.1 |
3 – Holding registers | 1 | 3.1 |
4 – Input registers | 1 | 4.1 |
OPC-UA
On the X4 remote you can enter your variable’s address, consisting of an identifier type, a namespace index, and an identifier. Both identifier types (string and numeric) require a different address when used in Cloud Logging and Alarming. The example table below shows how to list the addresses in the CSV file.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Identifier type | Namespace index | Identifier | Address |
String | 2 | 20001 | ns=2;s=20001 |
Numeric | 2 | 20001 | ns=2;i=20001 |
BACnet/IP
On the X4 remote you can enter the variable’s object type, instance, and a property. The object type and property also have a numeric identifier. For example, object type “analog_value” corresponds with numeric identifier “2”. These are determined by the BACnet/IP protocol itself, but can also have custom identifiers that are configured by the user. The example table below shows how to list the addresses in the CSV file.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Object type | Object identifier | Object property | Address |
analog_value | 4 | present_value | 2.4.85 |
SMTP
On the X4 remote you can enter the data type, action, and keywords. The table below shows examples of all possible actions.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Data type | Action | Keywords | Address |
String | Return e-mail subject | High | SMTP::Keyw:High Ptrn:Subject: |
String | Return e-mail body | Medium | SMTP::Keyw:Medium |
String | Search for text pattern: “Description” | Low | SMTP::Keyw:Low Ptrn:Description |
Digital input
On the X4 remote you can enter the data type and communication protocol. The example below shows how to list the x500 IoT gateway’s digital input in the CSV file.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Type | Protocol | Type | Address |
Boolean | GPIO | bool | GPIO:: |
Data type (type, width & signed)
In the CSV file a variable’s data type is divided into 3 separate settings:
- Type: bool, int, float, or string.
- Width: is required when the type is an int or float. Available widths are 8, 16, 32, and 64 bits.
- Signed: “TRUE” for data types that can be positive and negative (signed). “FALSE” for data types that can only be positive (unsigned).
This table explains the available data types and their corresponding notation in the CSV file.
Online (X4 remote) | Offline (CSV file) | ||
---|---|---|---|
Data type | Type | Width | Signed |
BOOL | bool | ||
SINT | int | 8 | TRUE |
INT | int | 16 | TRUE |
DINT | int | 32 | TRUE |
LINT | int | 64 | TRUE |
USINT | int | 8 | FALSE |
UINT | int | 16 | FALSE |
UDINT | int | 32 | FALSE |
ULINT | int | 64 | FALSE |
REAL | float | 32 | |
LREAL | float | 64 | |
STRING | str |
Max string length
A string data type requires its maximum amount of characters to be specified in the “Max string length” column. Leave this column empty when the data type is not a string.
Factor
You can multiply the value. This can be useful when you would like to measure grams in kilograms, for example. In this example you would set the factor to 0.001.
Unit
The unit of measurement (i.e. kg, liter, °C, bar) will be visible in dashboards to the right of each value.