Back

Topic

[KB840]How to import .HDS files

Tags: HDS

8 years ago
By RM
Options
Print
Applies to:PcVue 8.10 onwards

Summary:.hds files are generated by the HDS, during abnormal operation, as temporary storage for events. The HDS will attempt to recover the information in them when normal operation resumes but you can also manually import them using the following procedure. See also KB654 How .hds files work?.
Originator ACH

Details:The following example has this configuration.1 x SQL Server 2014 Standard instance : VMSQLSGBD\SQLSRV2014_DEV
1 x SQL3_DATABASE1 created by PcVue with a LOGTABLE and TRENDTABLE.

Note that using this method it is not possible to insert additional columns such as TS.

1. TRENDTABLE import

Add the following header to the TRENDTABLE .hds file.

20;Chrono;8;Name;5;Value;2;Quality;256;TS

image01

Using Microsoft SQL Server Management Studio select Import Data. This opens the SQL Server Import and Export Wizard.

image02

Select Flat File Source and the file to import.

image03

Using the Advanced node, select the DataType for each of the fields.

Chrono: DT_I8
Name: DT_STR
Value: DT_R8
Quality: DT_I2

image04

Choose the destination server and table.

image05

image06

The wizard generates an SSIS (SQL Server Integrated Services) package which you then run to complete the export.

image07

image08

image09

image10

If you have an error on the Value column it may be due to regional settings. Try changing the decimal seperator from a Comma to a Period (Full Stop).

image11

2. LOGTABLE import

The process is similar to the TRENDTABLE with the following differences.

The following header must be added to the LOGTABLE .hds file.

20;[Chrono];8;[LogList];1;[AssocLabel];20;[EvtNumber];8;[EvtTitle];8;[Name];17;[Value];1;[ValueT];3;[Quality];3;[AlarmLevel];3;[AlarmState];1;[UserComment];1;[Threshold];1;[NumParam];1;[TextParam]

The data types are.

Chrono: DT_I8
LogList: DT_STR
AssocLabel: DT_STR
EvtNumber: DT_R8
EvtTitle: DT_STR
Name: DT_STR
Value: DT_R8
ValueT:  DT_STR
Quality: DT_I2
AlarmLevel: DT_I2
AlarmState: DT_I2
UserComment: DT_STR
Threshold: DT_R8
NumParam: DT_R8
TextParam: DT_STR

3. If you have customised tables

If you are using a customised table, the corresponding data types can be found in the help.

Application Explorer.Archives.Configuring databases.Configuring the database tables.What properties can you record?


Created on: 10 Oct 2016 Last update: 26 Aug 2024