Applies To:
  • CitectSCADA x.x

Summary:
Question: When I move trend history files to another directory Citect will not access those files. Is there any work around to access those history files?

Solution:
Unfortunately there is not a work around for this problem if your Citect is prior to version 5. Citect provides a partial solution to this problem in version 5, and a complete solution in 5.31 and later.

The problem is due to the following:
The trend system uses the path configured in the 'File Name' field of the 'Trend Tags (SPC Tags)' form. (With the standard Trend Tags form File Name field is hidden and it defaults to the substitute path [data]:trend name (8 characters of the trend name prior to version 5; version 5 supports long trend file names as long as the operating system supports long file names)). The trend system accesses the trend master history file (.HST) by using the path defined in the Trend Tags form. The master file stores the list of trend history files; this provides a very quick access to those files as the master file is read into the memory and the list is scanned to find the appropriate trend history file to access to. However, this list in the master file stores the absolute path to the trend history files, in other words, if the history files are moved the master file will think that they still reside in their original place and fail to find those files.

Citect 5.31 and later only use the path shown on the Trend Tags form and ignore the path recorded in the HST file. So, moving a trend in 5.31+ just requires that the HST and data files both reside in the new path specified in the Trend Tags form. For previous Citect 5 releases, see below.

I will give an example as to what is happening:
Standard Trend tag form

Trend tag name: trend1

will use the File Name [data]:trend1 as default.

Let us assume that the substitute path [data] in the Citect ini file is:

[CTEDIT]
DATA = c:\citect\data

Then the following trend files will be created in the c:\citect\data directory.

trend1.hst
trend1.000
trend1.001

trend1.hst file will store the following list:

trend1.000 c:\citect\data\trend1.000
trend1.001 c:\citect\data\trend1.001

If you copy the files to a new directory, say c:\citect\new and change the substitute path [data] to

[CTEDIT]
DATA = c:\citect\new

then the trend system will be able to open and read the master file trend1.hst to find that the paths to the trend1.000 and trend1.001 are still c:\citect\data. So, the trend system will fail to access to the tend history files.

Extended Trend tags form:

Trend Name: trend1
File Name [user1]:trend1

where [user1] is a user defined substitute path. The problem is exactly the same as in the first example. Citect has now a fix for this problem in version 5.

case 1: Substitute path is used (since most users use the standard form the default will be substitute path)

You can copy your trend files to another directory as long as you change the substitute path to point to the new directory. Example :

Original

[CTEDIT]
DATA = c:\citect\data

and trend files are [data]:xxxx If you copy the files to c:\citect\new then you are expected to change

[CTEDIT]
DATA = c:\citect\new.

This applies to user defined substitute paths as well:

[MYTRENDS]
TREND1 = h:\trend1
TREND2 = h:\trend2

If you copy the files from h:\trend1 to m:\new1 then t=you should change

[MYTRENDS]
TREND1 = m:\new1

case 2 : Absolute path is used:

Trend Name trend1
File Name c:\citect\trends\trend1

Since the solution is not as easy as case 1 I have introduced a new parameter : [TREND] DataPath. If this parameter, DataPath is blank then the trend system uses the original directory, ie. c:\citect\trends to access the trend files. If DataPath is pointing to a new directory then all trend files will be expected to be in this directory.

For the above Trend tags form if you have

[TREND]
DataPath = m:\trends

then the trend1.hst, trend1.000.... are expected to be in m:\trends not in c:\citect\trends. There is no work around for this problem. The problem is fixed in version 5.

Note: A Trend Renamer utility is available from the Citect.com Toolbox for editing the paths and trend names in HST files for Citect v5.xx trends. This allows the files to be moved regardless of path substitutions. This also allows for large systems where the trend data must be split into multiple directories for better performance. This utility is not needed in Citect 5.31 and later unless you want to rename the trend tags (which Citect still does not support).

 

Keywords:
 

Attachments