Applies to:
PcVue 15 onwards
Summary:
This article proposes different ways to diagnose proper functioning of HDS.
Warning 1: Modifying manually these files can cause irreversible damage.
Warning 2: This article is only for internal usage, see with the referent before recommending any modification of these files.
You can refer to other articles to find more information about HSD files (HDS Files list, HDS Files format PcVue 15).
Details:
1-How to read the trace file?
The traces are recorded in the HDS.log file in [InstallDir]\Bin\Log Files directory, a line in this file is composed as follows:
Time stamp, server name, machine name, HDS, Status, Information
Example:
2021/08/19,19:59:37.880,DESKTOP-I9EP85V,Desktop,HDS,I,0,0,Project loading
- Status: three states are possible
- I : Information
- E : Error
- W : Warning
To display more information in the traces, properties can be set to the HDS.
There are two possibilities to display these traces:
– Files Trace: located in [InstallDir]\Bin\Log Files\HDS.log” file,
– Screen Trace: display the information in the HDS dialog box.
-> Prefer Files Trace because it consumes less memory. But disable traces as soon as you don’t need to track anymore, because it consumes a lot of disk resources and hard drive space.
2- Backup files
- WatchDog.dat:
This file is located in [ProjectDir]\HDS directory.
It is a temporary file deleted when HDS stops.
The HDS periodically stores in this file the last trend timestamp written. When the HDS restarts, if it didn’t stop properly (i.e. the “WatchDog.dat” file has not been deleted), a new file is created in the Database directory with .inv extension, and an invalid point is recorded for each trend with the last timestamp.
- .inv:
The Last Recorded Value file has the name <Project Name>.inv and is located in [InstallDir]\Databases folder.
It starts with a header containing the version number of the file:
<FILE VERSION>
Then, for each trend recorded variable, there is a record with the following format:
<TREND VAR NAME>;<ARCHIVE UNIT NAME>;<LAST CHRONO>;<VAR TYPE>;<LAST VALUE>;<LAST QUALITY>
More information in KB849 (Trend recording – New invalid point management on shut-down)
- HDS.log:
This file is located in [InstallDir]\Bin\Log Files directory.
The HDS records error messages and other operational information in log files. In the event of a malfunction, these files may be used as an aid to diagnose the cause of the problem. Refer to KB1131.
3- System variables
Looking at the Application Explorer, in the System Variables tree, the HDS branch is concerned only with the execution state of the HDS (the executable), another sub-branch containing name of the database (if a database is declared) gives information about the state of that database.
3.1- HDS variables
- NoResponseCount : Incremented when a request between PcVue and the HDS is not completed because of a timeout (5 minutes for trend data and 8 minutes for log data).
- ErrorCount: Incremented each time there is an error or warning from the HDS. If recorded allows the user to see a history of any errors with the HDS. Can be reset by the application.
ErrorCount examples: Incorrect path / Connection string changed / Service not started (or paused) / Could not connect
- Overflow: If the maximum number of pendingrecords is reached, the variable is set to 1.
- PendingRecords: The number of records queued in the buffer and waiting to be written.
The max value can be modified via the HDSConf file, with the MaxBufferedEvents parameter (can be increased either for all bases, or for a single base).
- MaxBufferedEvents default value is 20 000.
For example, at a given time, 50,000 points must be archived at once. In this case, 20,000 points are put in the PendingRecords buffer (no need to go through the .HDS file because the connection is always good with the database) and the 30,000 other ones are lost.
In this case OverFlow system variable is set to 1.
NB: on average, HDS can process 200 records per second. If we have more, the others are put in the PendingRecords buffer, and if we exceed 20,000 records, the others are lost.
- Maximum value is 200 000 (don’t forget it consumes RAM so don’t increase it too much)
- Started: Set to 1 when the HDS is running. Set to 0 when it is stopped. Note that the HDS stops automatically if no more storage space is available to it.
- HDS Started: Even if HDS is starting properly, we strongly recommend you to check each database status at startup (see Database status check at startup).
- If HDS status in the taskbar is Green: HDS is working properly
- If HDS status in the taskbar is Red: HDS not started
- If HDS status in the taskbar is Orange: HDS is shutting down but something is blocking it, the most common cases :
- Writing .inv or .HDS points to the database
- The HDS empties its Buffer memory (pending records): If the database is reachable, it archives in the database, otherwise it writes to the .HDS file
- A maintenance plan is being executed
3.2- Database variables
- Current maintenance task:
- Compact
- Custom
- Defrag
- Export
- Purge
- DelayProc: If set to 1, indicates that the processing of purges, shrinking or export has been blocked using VBA.
- Disconn: Base is no longer connected
- DiskFull: Hard disk is full
- Full: Database is full
- NoResponseCount: Incremented when a request between PcVue and the HDS is not completed because of a timeout (5 minutes for trend data and 8 minutes for log data) for a given database.
- Paused: The database was paused because of OverFlow or Disk Full
- SpaceAlloc: The amount of space the database takes up on the disk
- SpaceUsed: Percentage of space that the database takes on the disk, if spaceUsed =100% then DiskFull= 1
- EmergencyPurge: The emergency purge has been triggered
- Synchro: Deprecated – Do not use.
Created on: 10 Sep 2024