Intouch export trends in csv?
How can I export trends of Intouch 8 (archive files * .LGH, * .IDX) in csv format to open them in Exel?
I have read that for this purpose there is a utility histdata.ehe, but how to use it is not clear?
Maybe there is a program or exel document with a macro that makes exports?
----------
Intouch экспорт трендов в csv?
Как я могу экспортировать тренды из Intouch 8 (архивные файлы *.LGH, *.IDX) в формат csv чтобы открыть их в Exel?
Я читал что для этих целей есть утилита histdata.ехе, но как ей пользоваться не понятно?
Может быть есть программа или exel документ с макросом, который делает экспорт?
Intouch export trends in csv?
-
- Site Admin
- Posts: 1122
- Joined: Wed Sep 06, 2006 12:03 pm
- Location: CIS
Re: Intouch export trends in csv?
For your version you should follow this technote
For newer versions of InTouch you could follow these steps from manual:
For newer versions of InTouch you could follow these steps from manual:
Using the HistData Wizard to Extract Log Data
You can create an output file containing log data that appears in a historical trend. InTouch includes the HistData Wizard to automate the steps to extract data from a log file. Because the HistData output file writes log data shown in a historical trend, the file can only contain data from the tags currently assigned to the pens of the historical trend.
To use the HistData Wizard to extract log data
1 Start WindowMaker.
2 Open a window that includes a historical trend.
3 Click the Wizards tool from the menu bar. The Wizard Selection dialog box appears.
4 Select the Trends group from the left pane.
5 Select the HistData Wizard icon from the right pane and click OK.
6 Move your mouse pointer over an area of the trend window where you want to place the HistData object.
7 Click to place the HistData object in the trend window.
The HistData Wizard creates a window object consisting of a button and the Filename box that shows the path where the output file will be created.
8 Double-click the HistData Wizard object placed in the trend window. The HistData Panel Wizard dialog box appears.
9 In the Hist Trend box, type a name for the HistTrend tag.
10 In the Number of Records to Write per CSV File box, type the number of records to write to an output file.
11 Click OK. The HistData Wizard creates a set of tags that are identified with a HDW prefix.
The HistData Wizard creates the tags. The HistData Wizard assigns the tags to the HisDataViewSt Access Name.
12 Run the historical trend window with WindowViewer.
13 Click Save to File that is part of the HistData window object. HistData creates the output file in the folder location shown in the window object.
-
- Posts: 104
- Joined: Thu Jan 01, 2015 9:02 am
Re: Intouch export trends in csv?
I would not want to make changes in the project Intouch.
whether there is a ready-made tool, exel documents that connect to the database intouch and make export CVS?
whether there is a ready-made tool, exel documents that connect to the database intouch and make export CVS?
-
- Posts: 104
- Joined: Thu Jan 01, 2015 9:02 am
-
- Posts: 60
- Joined: Mon Sep 24, 2007 1:03 pm
- Location: Somewhere in Europe
Re: Intouch export trends in csv?
There is a button in scada that does it;
It is as follows, hope it helps;
(Where HistTrendvga is page name)
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6) <>"" THEN
HDWDuration =Text( HistTrendvga.ChartLength, "#" ) + "s";
HDWInterval = Text(Int(HistTrendvga.ChartLength / 60000)+1, "#") + "s";
HDWStartDate = StringFromTime( HistTrendvga.ChartStart, 1 );
HDWStartTime = StringFromTime( HistTrendvga.ChartStart, 2 );
{ ---- Path to the trend log files ---- }
HDWDataDir = "D:\HistLog";
{ ---- Path to the InTouch application (database) ---- }
HDWDBDir = "C:\Program Files\SCADAApplication";
{ ---- Path and name of the CSV file to be written ---- }
HDWFilename = HDWDataDir + "\ChartData.csv";
HDWTags ="$DATE,$TIME";
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6);
ENDIF;
HDWTagsTemp = HDWTags;
HDWWriteFile = 1;
ENDIF;
-------
Also add this to the condition as a new one;
{---------- Trend data to .csv file ----------}
IF HDWStatus == 1 THEN
ZipSource = HDWFilename;
ZipDestination = "a:" + "\"+ StringReplace( HDWStartDate, "/", "", 0, -1, 0 ) +" "+ StringReplace( HDWStartTime, ":", "", 0, -1, 0 ) +", "+ StringReplace( HDWTagsTemp, "$DATE,$TIME,", "", 0, -1, 0 ) +".zip";
W_Zip(ZipSource, ZipDestination, "ZipStatus", "ZipDone");
IF SecLanguage == 0 THEN
{ English }
MessageBoxText = "File " + ZipDestination + " saved";
ELSE
{ Second language }
MessageBoxText = "File " + ZipDestination + " saved";
ENDIF;
MessageBox( MessageBoxText, "Information", 40 );
ENDIF;
Good Luck.....
It is as follows, hope it helps;
(Where HistTrendvga is page name)
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5) <>""
OR HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6) <>"" THEN
HDWDuration =Text( HistTrendvga.ChartLength, "#" ) + "s";
HDWInterval = Text(Int(HistTrendvga.ChartLength / 60000)+1, "#") + "s";
HDWStartDate = StringFromTime( HistTrendvga.ChartStart, 1 );
HDWStartTime = StringFromTime( HistTrendvga.ChartStart, 2 );
{ ---- Path to the trend log files ---- }
HDWDataDir = "D:\HistLog";
{ ---- Path to the InTouch application (database) ---- }
HDWDBDir = "C:\Program Files\SCADAApplication";
{ ---- Path and name of the CSV file to be written ---- }
HDWFilename = HDWDataDir + "\ChartData.csv";
HDWTags ="$DATE,$TIME";
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 1);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 2);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 3);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 4);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 5);
ENDIF;
IF HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6) <>"" THEN
HDWTags = HDWTags + "," + HTGetPenName("HistTrendvga",HistTrendvga.UpdateCount, 6);
ENDIF;
HDWTagsTemp = HDWTags;
HDWWriteFile = 1;
ENDIF;
-------
Also add this to the condition as a new one;
{---------- Trend data to .csv file ----------}
IF HDWStatus == 1 THEN
ZipSource = HDWFilename;
ZipDestination = "a:" + "\"+ StringReplace( HDWStartDate, "/", "", 0, -1, 0 ) +" "+ StringReplace( HDWStartTime, ":", "", 0, -1, 0 ) +", "+ StringReplace( HDWTagsTemp, "$DATE,$TIME,", "", 0, -1, 0 ) +".zip";
W_Zip(ZipSource, ZipDestination, "ZipStatus", "ZipDone");
IF SecLanguage == 0 THEN
{ English }
MessageBoxText = "File " + ZipDestination + " saved";
ELSE
{ Second language }
MessageBoxText = "File " + ZipDestination + " saved";
ENDIF;
MessageBox( MessageBoxText, "Information", 40 );
ENDIF;
Good Luck.....