Using CitectSCADA > Using Devices > Using Device History Files

Using Device History Files

To makes the long-term storage of logged data easier to organize and more accessible, CitectSCADA uses a system of rotational history files to store historical data. To use this system, you need to specify how many device history files you want to keep. For example, if you want to keep 10 history files, they would be saved rotationally as illustrated below:

  1. When CitectSCADA begins logging, data is written to a file called <filename>.txt or <filename>.dbf, depending on the type of device.
  2. At midnight the following Sunday, the file <filename>.txt is renamed to <filename>.001 and a new <filename>.txt is created.
  3. At midnight the following Sunday, the file <filename>.001 is renamed to <filename>.002, <filename>.txt is renamed to <filename>.001, and then a new <filename>.txt is created.
  4. After week 10, the first file is overwritten (week 11 in the first cycle).

Note: The 10 history files are in addition to the default data file that is saved for each device.

By default, CitectSCADA uses 10 files (if history files are specified). You can change the default by specifying the number of files to use, for example:

No. Files

20

Comment

CitectSCADA uses twenty files for the data

The maximum number of files you can specify is 999.

You can also specify the period between files, i.e., when a new history file is used, for example:

Period Comment
1:00:00 Use a new file each hour
6:00:00 Use a new file every six hours
72:00:00 Use a new file every three days
Monday Use a new file each week beginning on Monday
15th Use a new file every month beginning on the 15th of each month
25th June Use a new file every year beginning on the 25th of June

Note: Marked improvement in system performance is observed when a period of one week or more is specified.

You can also specify the time of day to synchronize the beginning of the history file, for example:

Time Comment
6:00:00 Synchronize the file at 6:00 am
12:00:00 Synchronize the file at 12:00 midday
18:30:00 Synchronize the file at 6:30 pm

The first file does not actually begin at this time: the first file begins when you start your runtime system. The time and period together determine when new history files are created, for example:

Time Period
6:00:00 Monday

In the above example, CitectSCADA creates a new file each Monday at 6:00am. If you start your runtime system at 7:30am on Sunday, your first file only contains 22.5 hours of data. If you leave your system running, subsequent files start each Monday at 6:00am, and contain one full week of data.