Resize the trend file by changing the sample period

Anonymous
Anonymous

This tool will resize the existing trend file by changing the sample period, without losing the exisitng data.

Version
1.00

Requirements
Citect v6+

Description: 

To view the files, only trend files generated by Citect V6+ are supported.

To resize the trend files, only periodic trend files generated by Citect V6+ are supported.

Steps to use the tool :-

1. Take a backup of the configuration & the data folder. Restore these to another machine. We will run the tool on this machine & copy the output files back to the server, if the resize is OK.

2. Start the tool. When run for the first time, it will ask for the Citect.ini location. The selection is persisted to the applications’s folder inside %AppData%\Local\Microsoft. The 'Source Data Folder' should be automatically populated in the tool. If it is not correct or you want to see the files on a different path (e.g. trend archive), then select the new source data folder. The data files (.000, .001, etc.) should be in the same folder as the history files (.hst). This tool ignores the filepath programmed in the history files. The history & data files must be in Citect’s data folder as defined in Citect.ini.

3. The 'Master Files' listbox will list all the history files (.hst files) in the source data folder. Selecting any trend tag will populate the history info for this tag in the 'Master File Info' grid & also the list of data files in the 'Data Files' listbox. The sample period of the trend will be populated in the textbox.

4. Selecting any data file will populate the header of this file in the 'Data File Info' grid & also the records contained in the file in the 'Data' grid.

5. When resizing the trend by changing the sample period, or exporting the data file to CSV format, you must select a valid 'Destination Data Folder'.

6. To automatically create a new Trend.dbf database of the Citect project, check the checkbox on the dialog, & select the project from the listbox. The tool will read the database on selection. If the trend being resized is found in the project’s trend database, its record is edited as per the new sample period. If the trend is not found in the database, it will still be resized without any changes to the trend database.

7. To resize the trends, select all the trends you want to resize in the 'Master Files' listbox. Then change the Sample Period & click on 'Start'. It is your responsibility to check whether the sample period is valid for the trend tag or not. Check the Citect help files for guidelines to select the sample period. As a thumbrule, a sample period which allow seamless continuity from the end of one data file to the beginning of the next file, is OK. E.g. 0.2, 0.25, 0.5, 00:00:01, 00:01:00 are all OK, 0.3, 0.75, 00:00:03, 00:00:07 should be avoided. If time entered is more than one second, then the millisecond part is ignored. The tool will resize the trend files & recreate new history & data files in the destination data folder.

8. Copy the trend.dbf to the project folder. Copy the history & data files to the data folder.

9. Compile & Start Citect runtime on the test machine & verify that the trend is consistent with the trend on the server.

10. If the resize is OK, shutdown the servers & copy these files back to the servers, compile & start the runtime.

Note:
1. This tool was built with .NET 4.0 framework, as this is installed with Citect V7.40.
2. Citect KB articles Q4312, Q1201 referred to make this tool.

Author 
Balaji Tekkiam

Submitter 
Ruchi Manav

Attachments