Creating a Historical Data Import File
To successfully merge historical data in Data Historian, you need to create a .csv file with the following specifications.
- Leave an empty line between each type and each point/value block. The delimiter character is configurable in the CSV plugin specific configuration; by default, it is “,”.
-
Enter the correct data point (the point name that is used to identify the data).
- If you need to process the data before it is merged by Data Historian Importer, the data point must be the input point name in the Data Historian Importer tag configuration.
- If no processing is needed, and you do not want to configure any Data Historian Importer tags, the data point must be the full browse path of the Data Historian tag that the data belongs to. Data Historian Importer will not map the names.
-
(Optional) Define the timestamp kind for the following lines in the .csv file, always before the header definition line:
[ TimestampKind, kind_value ]
The kind value can be: Unspecified, UTC, Local, or 0, 1, 2. If the kind is not specified or is defined as Unspecified (for the current block of data), the Assume timestamps as server local settings from the plugin configuration decides the kind. Otherwise, the kind defined in the file is used since it has higher priority.
-
(Optional) Define the timestamp format and culture for the following lines in the .csv file, always before header definition line:
TimestampFormat, format_value, culture_name ]
- Format_value: see C# DateTime format specification ( http://msdn.microsoft.com/en-us/library/8kb3ddd4(v=vs.110).aspx )
- Culture_name: see C# CultureInfo Names ( http://msdn.microsoft.com/en-us/library/system.globalization.cultureinfo(vs.71).aspx )
When TimestampFormat is present, both format_value and culture_name must be specified. The Datetime.TryParseExact method is then used with the specified culture. If parsing failes, the plugin behaves like it was not defined at all. If the timestamp format is not defined, the Datetime.TryParse method is used.
The following table shows an example of the .csv file content.
|
TimestampKind |
Utc |
|
|
|
|---|---|---|---|---|
|
TimestampFormat |
yyyy/MM/dd HH:mm:ss.fff |
cs-CZ |
|
|
|
DataPoint |
Timestamp |
Quality |
Value |
ValueType |
|
\Sensors.Temperature |
2025.01.01 13:00:00.256 |
0 |
10 |
Int32 |
|
\Sensors.Pressure |
2025.01.01 13:00:00.256 |
0 |
1000 |
Int32 |
|
|
|
|
|
|
|
TimestampKind |
Local |
|
|
|
|
DataPoint |
Timestamp |
Quality |
Value |
ValueType |
|
\Sensors.Temperature |
2025.01.01 14:00:00.256 |
0 |
20 |
Int32 |
What's Next?