Configuring the archives of the PcVue project when using the Database Import Tool
The Database Import Tool imports data into a specific database and table selected either by the wizard or, if using express mode, the configuration file. If the data is imported into a database and table that is also being used by PcVueto record real-time data there are issues that must be considered.
- The accidental creation of doubloons. A doubloon occurs when there are two or more records for the same variable with an identical timestamp.
- The import process has the option to purge all records before the import process starts. If used in error it could delete all existing records in the table without any way to recover them.
- Over-filling the database thereby stopping recording and/or triggering an unexpected purge (emergency purge).
To overcome these issues it is recommended that you import the data into a table specifically configured for that purpose.
How to configure the archives when importing Trend data
The following explanation assumes that you have already made the minimum configuration to record trend data. That is:
- A database with a trend table.
- An archive unit.
- Variables have been added to the archive unit's Trends folder with the Primary option selected.
Show picture.
The Primary option determines from which table a Trend Viewer will get its data by default. You can force a Trend Viewer to get its data from an alternative table using the SCADA Basic instruction, HISTORY.
To configure archives when importing Trend data:
- Add a trend table to the database. This table will be used as the destination for the Database Import Tool. Do not select the Set as default property.
- Add an archive unit to the Archive Units folder and select the Read only property. This will inhibit recording via this unit.
- Add the variables, which are to have imported trend records, to the Trends folder of the archive unit you have just created. Configure each entry so that it uses the trend table you have set up for imported records and do not select the Primary option. Each variable should now appear in two Trend folders, one that is attached to the Archive unit in which PcVue is recording, and the other in the Archive unit that is configured as read only.
Show picture
How to configure archives when importing Log data
The following explanation assumes that you have already made the minimum configuration to record log data. That is:
- A database with a log table.
- An archive unit and log list with its destination pointing to the log table.
To configure archives when importing Log data:
- Add a Log Table to the database. This table will be used as the destination for the Log List that will be used for the Database Import Tool. Do not select the Set as default property.
- Add an archive unit to the Archive Units folder and select the Read only property. This will inhibit recording via this unit. If you have already added an archive unit with the Read only property set for importing trend data you can use this.
- Add a log list to the Log Lists folder of the archive unit you have just created. The log list should have the same name as the log list that was the source of the records to be imported but with a suffix (_IMP is suggested). For example if you want to import records previously exported from the log list LOGLIST1 you should create a Log List called LOGLIST1_IMP. Configure the Destination tab for the Log List so that it points to the Log Table you have just created.
The name of the Log List is included in each log data record.
In order to differentiate imported data, when log data is imported the Log List name can be automatically changed by adding a suffix. The imported data can then be accessed from a Log Viewer by associating it with a Log List of that name.
How to display imported trend records
By default, a Trend Viewer will display records from the trend table that has been selected as Primary. In order to force a Trend Viewer to display records from another table (in this case the one into which records have been imported) you must develop and run a small SCADA Basic program using the instruction HISTORY, mode TREND, sub-mode SETPRIMARY_UNIT. See the SCADA Basic help for detailed information.
How to display imported log data
To display imported log records, create a Log Viewer that is attached to the log list that was created for the imported records, for example LOGLIST1_IMP. You can dynamically change the Log List used by a Log Viewer using the SCADA Basic instruction LOGDISPLAY, mode LOGLIST.
There is the possibility of over-filling the database when importing records thereby stopping recording and/or triggering an emergency purge. To avoid this a separate database should be created, containing only the Trend Table and Log Tables used for import.