Skip to main content
Skip table of contents

Data Interface

Configuration File HAKOM.Config

All settings concerning the Data Interface in general are located in the HAKOM.Config file in the installation directory of the HAKOM Data Interface. 

Data Interface Settings

Settings

Setting
Description
Default Value
Possible Values
<HAKOMConfigConnectionName>Specifies which of the defined database connections will be used for importing or exporting data.
String, names of defined database connections
<HAKOMConfigConnectionNameProtocol>Specifies which of the defined database connections will be used for logging purposes.
String, names of defined database connections
<ConfigFilesPath>Path of directory where specific import and/or export configuration files are located.Installation folder of Data InterfaceString
<ImportMaxDegreeOfParallelism>Specifies how many parallel import processes are allowed to run. Requires licensing of parallel processing.
Integer

Example

XML
<HAKOMConfiguration>
	<products>
		<TimeSeriesDataInterfaceAssistent>
			<settings>
				<trace>0</trace>
				<HAKOMConfigConnectionName>TSM</HAKOMConfigConnectionName>
				<HAKOMConfigConnectionNameProtocol>TSM</HAKOMConfigConnectionNameProtocol>
				<ConfigFilesPath>.</ConfigFilesPath>
			</settings>
		</TimeSeriesDataInterfaceAssistent>
	</products>
</HAKOMConfiguration>

In addition to the settings listed here it is also necessary to configure the processing of import files and the creation of export files in order to use these features. It is possible to keep these import and/or export configurations in the HAKOM.Config file or create separate configuration files that correspond to specific import/export processes. For better clarity it is recommended to create separate configuration files.

If the import and export configuration is to be located in the HAKOM.Config the settings must be included as follows:

XML
<HAKOMConfiguration>
	<products>
		<ConfigName> <!-- Name of the configuration section -->
			<!-- Import/Export settings -->
		</ConfigName>
	</products>
</HAKOMConfiguration>

Dedicated Configuration Files

In case separate configuration files are prepared for specific import or export runs, the HAKOM.Config located in the Data Interface installation directory must contain the location of these configuration files in the setting "ConfigFilesPath" as described above.

These configuration files must be structured as follows:

XML
<HAKOMConfiguration>
	<products>
		<ConfigName> <!-- Name of the configuration file -->
			<!-- Import/Export settings -->
		</ConfigName>
	</products>
</HAKOMConfiguration>

CSV Import Configuration

The import configuration file has to be tailored to the import file it corresponds to. An import configuration file does not have to contain all settings but only settings needed to correctly process the contents of the import file and achieve the desired outcome.

Setting
Description
Example
Default Value
Possible Values
<Trace>

Specifies the log level of import processes.

XML
<Trace>0</Trace>

Following trace levels are available:

  • 0: Logs begin and end time, number of data packages to be imported and actual number of imported data packages.
  • 1: Additionally logs duration of reading and saving of data packages.
  • 2: Additionally logs information about the imported time series and its assigned categories as well as memory usage (Note: This may be time consuming)
  • 3: Additionally logs imported data points.
<ImportPath>Specifies the location of the files to be imported. Note: A path to a file directory must be provided, paths to specific files are not supported.
XML
<ImportPath>C:\Program Files (x86)\HAKOM\CSV\Imports</ImportPath>

String, path to a directory
<ArchivingPath>

Specifies the location where import files will be archived after the import. This settings defines the main archiving location, subfolders will be created for specific imports.

This directory will be created if it does not already exist.

XML
<ArchivingPath>C:\Program Files (x86)\HAKOM\CSV\Imports\Archive</ArchivingPath>

String, path to a directory
<ArchiveFileTimeStampFormat>Allows to add time stamps to the archived import files in the format provided via this setting. If this setting is not used, no time stamp will be added.
XML
<ArchiveFileTimeStampFormat>dd_MM_yyyy_HH_mm</ArchiveFileTimeStampFormat>
-

Date and time format string

  • yyyy: year
  • MM: month
  • dd: day
  • HH: hour
  • mm: minute
  • ss: second
<ArchiveFolderTimeStampFormat>Allows to add time stamps to the automatically created archiving folders in the format provided via this setting. If this setting is not used, no time stamps will be added
XML
<ArchiveFolderTimeStampFormat>dd_MM_yyyy_HH_mm</ArchiveFolderTimeStampFormat>
-

Date and time format string

  • yyyy: year
  • MM: month
  • dd: day
  • HH: hour
  • mm: minute
  • ss: second
<TimeSeriesNameFromFileName>Read the name of time series created when importing from the import file name. Index and length of the desired name must be provided comma separated.
XML
<TimeSeriesNameFromFileName>0,4</TimeSeriesNameFromFileName>

Will read four characters from the file name starting with the first character.

-Comma separated integers
<SuffixTimeSeriesNameFromFileName>Read a string from the import file name and add it as a suffix to the name of the time series created when importing. Negative values are allowed, if the index is provided as a negative integer, the index will start at the end of the file name.
XML
<SuffixTimeSeriesNameFromFileName>4,-2</SuffixTimeSeriesNameFromFileName>

Will read the two characters in front of the character at position four from the file name.

-Comma separated integers, negative values allowed
<TimeSeriesNameSeparator>Defines which character is used to separate prefixes, postfixes and suffixes from the time series name.
XML
<TimeSeriesNameSeparator>_</TimeSeriesNameSeparator>

String
<PrefixTimeSeriesName>Allows to define a fixed string to be prefixed to the time series name.
XML
<PrefixTimeSeriesName>ABC.</PrefixTimeSeriesName>
-String
<PostfixTimeSeriesName>Allows to define a fixed string to be postfixed to the time series name.
XML
<PostfixTimeSeriesName>.XYZ</PostfixTimeSeriesName>
-String
<ColumnIndexTimeSeriesName>The column index of the import file where the time series name is provided.
XML
<ColumnIndexTimeSeriesName>1</ColumnIndexTimeSeriesName>
-Integer
<ColumnIndexTimeSeriesID>The column index of the import file where the time series ID is provided.
XML
<ColumnIndexTimeSeriesID>2</ColumnIndexTimeSeriesID>
-Integer
<ColumnIndexFrom>The column index of the import file where the from date of a data point is provided.
XML
<ColumnIndexFrom>1</ColumnIndexFrom>
-Integer
<ColumnIndexTo>The column index of the import file where the to date of a data point is provided.
XML
<ColumnIndexTo>2</ColumnIndexTo>
-Integer
<ColumnIndexDate>The column index of the import file where the date of a data point is provided.
XML
<ColumnIndexDate>1</ColumnIndexDate>
-Integer
<ColumnIndexTime>The column index of the import file where the time of a data point is provided.
XML
<ColumnIndexTime>2</ColumnIndexTime>
-Integer
<ColumnIndexFlag>The column index of the import file where the flag of a data point is provided.
XML
<ColumnIndexFlag>3</ColumnIndexFlag>
-Integer
<ColumnIndexValue>The column index of the import file where the value of a data point is provided.
XML
<ColumnIndexValue>4</ColumnIndexValue>
-Integer
<ColumnIndexDataSource>

The column index of the import file where the data source of a data point is provided.

Dedicated time series will be created for each data source and values will only be stored on the corresponding time series.

XML
<ColumnIndexDataSource>5</ColumnIndexDataSource>
-Integer
<HeadersIndexTimeSeriesName>The column index of the header row where the time series name is provided.
XML
<HeadersIndexTimeSeriesName>1</HeadersIndexTimeSeriesName>
-Integer
<HeadersIndexUnit>The column index of the header row where the unit is provided.
XML
<HeadersIndexUnit>2</HeadersIndexUnit>
-Integer
<MinValue>The minimum value to be imported. Any values contained in the import file that are lower than the specified value will not be imported.
XML
<MinValue>5</MinValue>
-Integer
<MaxValue>The maximum value to be imported. Any values contained in the import file that are higher than the specified value will not be imported.
XML
<MaxValue>50</MaxValue>
-Integer
<DataUnit>Specifies the unit of the import data. If an unknown unit is provided it will be created in the database.
XML
<DataUnit>MW</DataUnit>

String
<TimeFormatString>Specifies the format of time stamps contained in the import file.
XML
<TimeFormatString>HH:mm:ss</TimeFormatString>
According to the regional settings of the machine.

Time format string

  • HH: hours
  • mm: minutes
  • ss: seconds
<DateFormatString>Specifies the format of dates contained in the import file.
XML
<DateFormatString>dd.MM.yyyy</DateFormatString>
According to regional settings of the machine.

Date format string

  • dd: day
  • MM: month
  • yyyy: year
<DataSourceHeaders>Allows to define a number of rows as header rows to be skipped during import.
XML
<DataSourceHeaders>1</DataSourceHeaders>
-Integer
<DataSourceTimeZone>Specifies the time zone relevant to time stamps contained in the import file.
XML
<DataSourceTimeZone>LT</DataSourceTimeZone>
According to time stamp format.
  • LT (local time)
  • UTC
<DataSourceTimeSeriesType>Defines the type of time series that will be created during the import.
XML
<DataSourceTimeSeriesType>A</DataSourceTimeSeriesType>
A
  • A: Begin time series
  • E: End time series
  • S: Spontaneous time series
<DataSourceTimeSeriesInterval>

Defines the interval of the time series that will be created during the import. The interval may be provided in seconds (positive values) or as a HAKOM interval enumerator (negative values).

Enumerator
Interval
-1Second
-2Minute
-3Hour
-4Day
-5Week
-6Month
-7Quarter
-8Year

An interval must be provided for time series of type A and E.

XML
<DataSourceTimeSeriesInterval>60</DataSourceTimeSeriesInterval>
-
  • Positive integer: Interval in seconds
  • Negative integer: HAKOM interval enumerator
<DataSourceTimeOffset>Allows to set an offset in seconds for all imported data points.
XML
<DataSourceTimeOffset>3600</DataSourceTimeOffset>
-Integer
<CreationTime>Sets the creation date and time for the import data.
XML
<CreationTime>2021-01-01T00:00:00Z</CreationTime>
-Date and time stamp
<CreationTimeFromFileName>Allows to extract the creation date and time for the import data from the import file name. Index and format must be provided.
XML
<CreationTimeFromFileName>8,yyyMMdd_HHmm</CreationTimeFromFileName>

Will read the time stamp from the file name "Source1_20210101_1400"

-See description
<CreationTimeFromHeader>Allows to extract the creation date and time for the import data from a header row in the import file. The header column, the index and formant must be provided.
XML
<CreationTimeFromFileHeader>2,4,yyyMMdd_HHmm</CreationTimeFromFileHeader>

Will read the time stamp from the header "K1; K2_20120101_1400"

-See description
<CreationTimeAsQuotationTime>Allows to use the creation time as a quotation time stamp.
XML
<CreationTimeAsQuotationTime>true</CreationTimeAsQuotationTime>
falseBoolean
<FlagMapping>Allows to map content from the import file to HAKOM TSM flags. The numerical flag ID references must be used when mapping flags.
XML
<FlagMapping>220,9;67,9;ZZZ,19</FlagMapping>

Will map values from the import file as shown below:

Value in CSV Import File
HAKOM TSM Flag
220valid
67missing
-See description
<DataSeparator>Defines the column separator used in the CSV import file.
XML
<DataSeparator>,</DataSeparator>
;String
<FileFilter>Allows to filter the files that will be imported. File names, file format extensions and placeholders may be used.
XML
<FileFilter>*.txt</FileFilter>
-String, wildcards are available
<NumberDecimalSeparator>Defines the character used as a decimal separator.
XML
<NumberDecimalSeparator>.</NumberDecimalSeparator>
According to regional settings of the machine.String
<NumberGroupSeparator>Defines the character used as a thousands separator.
XML
<NumberGroupSeparator>,<NumberGroupSeparator>
According to regional settings of the machine.String
<SortCriteria>Specifies the criteria used for sorting the import files.
XML
<SortCriteria>filedate</SortCriteria>

Sort by

  • File name: name
  • File creation date: filedate
  • File modification date: modificationtime
<SortDirection>Specifies the sorting order.
XML
<SortDirection>ascending</SortDirection>
descending
  • ascending
  • descending
<Encoding>Specifies the character encoding.
XML
<Encoding>windows-1250</Encoding>

List of available options can be found here: Encoding table for imports

CSV Export Configuration

Setting
Description
Example
Default Value
Possible Values
<Trace>Specifies the log level of import processes.
XML
<Trace>0</Trace>

Following trace levels are available:

  • 0: Logs begin, end, number of data packages to be exported and actual number of exported data packages.
  • 1: Additionally logs duration of reading and exporting of data packages.
  • 2: Additionally logs information about the exported time series and its assigned categories as well as memory usage (Note: This may be time consuming)
  • 3: Additionally logs exported data points.
<ExportPath>Specifies the path where exported files will be placed. This path will be created if it does not already exist.
XML
<ExportPath>C:\Program Files (x86)\HAKOM\CSV\Exports</ExportPath>

String
<ExportFileName>

Specifies the file nname format of exported files. The following placeholders may be used:

Placeholder
Description
##DATE##The current date will be filled in according to the specified format.
##TIME##The current time will be filled in according to the specified format.
##TS-NAME##The time series name will be filled in.
##TS-ID##The time series ID will be filled in.
XML
<ExportFilename>##TS-ID## ##DATE##.csv</ExportFilename>

String, placeholders available
<ExportFileNameDateFormat>Specifies the date format of the placeholder "##DATE##" mentioned above.
XML
<ExportFileNameDateFormat>yyyyMMdd</ExportFileNameDateFormat>

Date format string
<ExportFileNameTimeFormat>Specifies the format of the placeholder "##TIME##" mentioned above.
XML
<ExportFileNameTimeFormat>HHmmss</ExportFileNameTimeFormat>

Time format string
<CSVHeader>

Allows to define a header row for the export file. The following placeholders may be used:

Placeholder
Description
##EXPORTILENAME##File name of the export file.
##FROMDATE##The time series from date.
##TODATE##The time series to date.
##UNIT##If a unit is provided all values will be converted accordingly.

##TS-NAME##

The name of the time series.

##TS-ID##

The time series ID.
##TS-DESCRIPTION##The time series description.
XML
<CSVHeader>Data from ##FROMDATE## to ##TODATE##</CSVHeader>
-String, placeholders are available
<CSVHeaderDateFormat>Specifies the format of dates in the header row of the export file.
XML
<CSVHeaderDateFormat>dd.MM.yyyy</CSVHeaderDateFormat>

Date format string
<ExportPeriod>Defines the period relevant for the data export.
XML
<ExportPeriod>month</ExportPeriod>
-
  • all
  • month
  • week
  • day
<ExportPeriodSeparator>

Specifies the start of the export period:

  • ExportPeriod: week
    • Weekday must be provided, eg. "wednesday".
  • ExportPeriod: month
    • Day of the month must be provided, eg. "25".
XML
<ExportPeriodSeparator>15</ExportPeriodSeparator>

String/Integer depending on <ExportPeriod> setting
<SkipMissingData>Specifies if missing data should be skipped.
XML
<SkipMissingData>true</SkipMissingData>
falseBoolean
<Interval>

Defines the interval relevant for the export. Positive integers will be interpreted as seconds, negative values will be interpreted as enumerators.

Enumerator
Interval
-2Minute
-3Hour
-4Day
-5Week
-6Month
-7Quarter
-8Year
XML
<Interval>-4</Interval>

Integer or HAKOM interval enumerator
<ExportCalculationFormula>

Allows to apply an ad hoc formula during the data export. 

XML
<ExportCalculationFormula>[this]+2</ExportCalculationFormula>

HAKOM formula syntax applies
<ExportCalculationInterval>

Defines the calculation interval for the ad hoc formula. Positive integers will be interpreted as seconds, negative values will be interpreted as enumerators.

Enumerator
Interval
-2Minute
-3Hour
-4Day
-5Week
-6Month
-7Quarter
-8Year
XML
<ExportCalculationInterval>-3</ExportCalculationInterval

Integer or HAKOM interval enumerator
<CSVSeparator>The character used for separating the columns in the export file.
XML
<CSVSeparator>,</CSVSeparator>
;String
<ExportColumns>Specifies the columns that will be exported.
Setting
Exported Value
XML
<ExportColumns>
	<Field Name ="FromDate" Format ="yyyyMMdd hh:mm"/>
</ExportColumns>
From date in the specified format.
XML
<ExportColumns>
	<Field Name ="ToDate" Format ="yyyyMMdd hh:mm"/>
</ExportColumns>
To date in the specified format.
XML
<ExportColumns>
	<Field Name ="Flag"/>
</ExportColumns>
Flag of a value.
XML
<ExportColumns>
	<Field Name ="Value" Format ="0:0.00"/>
</ExportColumns>

Value with the specified precision.

  • 0:0.00: Two decimal places
  • 0:0.##: Two decimal places maximum
  • 0:0,0.0 = Thousand separator (1234.56 → 1,234.6)
XML
<ExportColumns>
	<Field Name ="TimeZoneFrom"/>
</ExportColumns>
Time zone of a time stamp in the database.
XML
<ExportColumns>
	<Field Name ="TimeZoneTo"/>
</ExportColumns>
Time zone of a time stamp in the export file
XML
<ExportColumns>
	<Field Name ="DaylightSavingHourFrom"/>
</ExportColumns>
Indicates the time shift due to summer / winter time of the values from the database
XML
<ExportColumns>
	<Field Name ="DaylightSavingHourTo"/>
</ExportColumns>
Indicates the time difference due to summer / winter time of the values exported to the CSV.

See examples
<Unit>Specifies the unit of the values for the export file.
XML
<Unit>MW</Unit>
-String
<UseDayLightSaving>

Controls whether day light saving will be considered.

  • True: 24 hours will be exported for every day.
  • False: Day light saving hours will be respected.
XML
<UseDayLighSaving>True</UseDayLightSaving>
FalseBoolean
<MapFlag>Allows to export custom values instead of the HAKOM TSM Flag IDs.
XML
<MapFlag>
	<Flag HAKOMFlag="19" TargetValue="xyz">
	<Flag HAKOMFlag="9" TargetValue="100">
</MapFlag>
-See examples
<DayNames>Allows to export data only for characteristic days. Multiple day types may be provided, separated by a semicolon ";".
XML
<DayNames>MON;SAT</DayNames>
-
  • MON - Monday
  • TUE - Tuesday
  • WED - Wednesday
  • THU - Thursday
  • FRI - Friday
  • SAT - Saturday
  • SUN - Sunday and Holiday
  • TWT - Tuesday, Wednesday, Thursday
  • WKD - Weekday, Monday - Friday

Encoding

For CSV exports only UTF-8 character encoding is supported.

Export of Multiple Time Series

It is possible to export multiple time series in one export file. The following configuration settings may be extended for this purpose:

Value Format

In the export configuration file multiple formats for values can be defined:

XML
<Field Name="Value" Format="0.0" DecimalSeparator="," GroupSeparator=""/>
<Field Name="Value1" Format="0.000" DecimalSeparator="," GroupSeparator=""/>
<Field Name="Value2" Format="0.0000000" DecimalSeparator="," GroupSeparator=""/>

For all exported time series a value format should be provided, for all additional time series without a specific configuration the format of "Value" will be applied. In case no "Value" entry exists only time series with an applicable format will be exported.

Interval

In the export configuration file multiple intervals can be defined:

XML
<Interval>900</Interval>
<Interval1>3600</Interval1>

For all exported time series an interval should be provided, for all additional time series without a specific configuration the interval of the setting "Interval" will be applied. In case no "Interval" entry exists only time series with an applicable interval will be exported.

Individual Import/Export Parameters

For both import and export configuration files it is also possible to define placeholders for certain configuration settings and provide the values for these settings when starting the import or export process with the console command.

The relevant settings need to be configured as follows in the import or export onfiguration file:

XML
<HAKOMConfiguration>
	<products>
		<ConfigName>
			<Setting>##Placeholder##</Setting>
		</ConfigName>
	</products>
</HAKOMConfiguration>

The string used as a placeholder (in this example "Placeholder") may be freely chosen, the leading and trailing "##" must be present in order to use this functionality.

When starting an import or export run the value for the setting can be provided as shown here using the example of an import command:

CODE
HAKOM.Framework.DataInterface.Console.exe import csv -c {Name_of_configuration_file} -p Placeholder=3
JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.