Configuration of the alarm history

The alarm server maintains an alarm history database. The alarm history saves all alarm state changes. The Save (system module parameter) parameter of an alarm class definition determines which alarms are saved.

The alarm history configuration parameters can be found on the Common tab of the Property Pages.

Common

  • Logged alarm states

  • File Path

    • Sets the directory where the files will be saved. The directory will be created automatically if it does not exist. The file name is defined by the File name parameter. The directory can be indicated as an absolute path, e.g. C:\VisiWin\Projects\Project1. To select the directory, click the Ellipsis button button. The directory can also be indicated using placeholders. For more information on placeholders, see File path (system module parameter).

  • Filename

    • Specifies the file name. File names can be either automatic or manual:

      • Automatic

        • The file name consists of the date and time (if applicable) of file creation. The file name also depends on the File change event setting.

      • Manual

        • The file name can be indicated as plain text without file extension. This file name will be used with any File change event setting. As a consequence, the file will be overwritten every day if File change event was set to Days and if an alarm or logging event occurs. To prevent overwriting, you can include a process variable value in the file name, for example. The Ellipsis button button next to the input field opens the Edit Localizable Text dialog that allows to insert a dynamic process variable value, a date, etc.

          The file name can be indicated as plain text without file extension. The manual file name is only used if File change event was set to Never.

  • File change event

    • The file change event determines when a new file is created. Choose between the following options:

      • Days

        • A new log file is created when a new day begins.

      • Once per week

        • A new file is created when a new week begins.

      • Months

        • A new file is created when a new month begins.

      • Years

        • A new file is created when a new year begins.

      • Trigger

        • A new file is created when the trigger variable is set.

      • Never

        • The system does not create a new file automatically. You can implement a trigger in the program code using the functions within the VisiWin.Alarm or VisiWin.Logging namespace.

      • Timespan

        • A new file is generated at the specified interval. Set the desired interval in the day, hr and min boxes.

  • Trigger variable

    • Specifies the name of a binary variable that will trigger creation of a new log file. This option is only available if the parameter File change event was set to Trigger.

  • File Mode

    • Sets how data are saved.

      • Fast

        • The historical alarm or log file remains open until it is saved. This enhances file access performance. However, in the event of a system crash, correct file content cannot be guaranteed.

      • Secure

        • If this option is enabled, the alarm/logging server will close the alarm/log file after each write access. This setting increases data safety but may slow down the system’s performance.

  • Bypass Windows write cache

    • If this option is enabled, the files will be written to the hard disk directly without being held in the Windows write cache (disabled by default).

  • Max. files size

    • Sets the maximum memory size for historical alarm or log files on the hard disk. If the specified size (in kilobytes) is exceeded, the oldest files will be deleted. This is to prevent the hard disk from overflowing. If the File Mode parameter is set to Fast, the specified size may be exceeded. Size comparison is not executed until the data contained in the internal buffer are written to the file. If the size of the buffered content is very large, deleting several older files may become necessary in order to keep the max. files size. Setting the parameter to 0 (default setting) means that the number of files is unlimited.

  • Max. count per file

    • Sets the maximum number of entries per file.

      As soon as the specified number of entries is reached, a new file is created even if the specified file change event has not yet occurred. A value of 0 means that the number of entries is irrelevant.

      Example:

      Parameter

      Setting

      Max. count per file

      1000

      File change event

      Timespan, 1 day

      On March 6th at 2:00 pm the 1,000th entry is written to the existing file. According to the file change event setting, a new file should be created on March 7th at 0:00 am. However, a new file is created immediately after the 1000th entry.

  • Max. file count

    • Sets the maximum number of historical alarm or log files that can be stored on the hard disk. If the specified number is exceeded, the oldest files will be deleted. This is to prevent the hard disk from overflowing. Setting the parameter to 0 (default setting) means that the number of files is unlimited.

  • Flush time of cache

    • Sets after how many minutes the cache contents will be written to the file.

      The cache stores data temporarily before they are written to the file in one go. Tests have shown that writing a single entry takes as much time as writing 100 entries. Activating the cache reduces CPU load and improves performance. A downside of using the cache is the possibility of losing the cached data if an unforeseen event such as a power failure occurs between two write operations.

      The Flush time of cache and Max. size of cache parameters activate the cache for the file. If both parameters are set to 0, the cache will not be used. If the value of the Flush time of cache parameter is larger than 0, the cached data are written to the file after the specified time period passes even though the number of data sets (entries) specified in the Max. size of cache parameter was not reached.

  • Max. size of cache

    • Sets the maximum number of entries in the cache.

      The cache stores data temporarily before they are written to the file in one go. Tests have shown that writing a single entry takes as much time as writing 100 entries. Activating the cache reduces CPU load and improves performance. A downside of using the cache is the possibility of losing the cached data if an unforeseen event such as a power failure occurs between two write operations.

      The Max. size of cache and Flush time of cache parameters activate the cache for the file. If both parameters are set to 0, the cache will not be used. As soon as the cache contains the specified number of data sets (entries), they are written to the file even though the time specified in the Flush time of cache parameter has not yet elapsed.