Archive Engine Usage

The ArchiveEngine program is run from the command line. It requires a configuration file to run. While running, you can view the configuration and status information via a web server that is built into the ArchiveEngine. The ArchiveEngine should be stopped via that web server.

Configuration File

You have to create an ASCII configuration file that lists the channels which you want to archive and specifies how this should be done. The name of this configuration file is passed to the ArchiveEngine on start.
The basic layout of this file is:
  # Comment. Empty lines are also allowed
  <ChannelName>  <Period> [Monitor] [Disable]
A simple example would be this one, it could be called "excas.grp":
  # Channels from excas
  fred 5
  freddy 5
  jane 1
  janet 0.1 Monitor
  
The channel names used in here (fred, ... janet) are served by excas, the example ChannelAccess server which is part of EPICS R3.13.3. You will of course use the names of process variables which are specific to your system.

Start the ArchiveEngine

When called, the ArchiveEngine displays usage information similar to this:
  Version 1.8.2, built Jul 18 2001, 15:09:09

  USAGE:  ArchiveEngine [Options] <config-file> [<directory-file>]

  Options:
        -port <port>                   WWW server's TCP port (default 4812)
        -description <text>            description for HTTP display
        -log <filename>                write logfile
        -nocfg                               disable online configuration

        Default directory-file: 'freq_directory'         
  
Minimally, the engine is therefore started by simply naming the configuration file: ArchiveEngine excas.grp
After collecting some data, the ArchiveEngine will create a "directory file", per default called "freq_directory", as well as data files. See how to use this directory file when retrieving data. Some sites prefer to use another name for this by specifying
ArchiveEngine excas.grp dir.
Now "dir" will be the name of the directory file.
You might get a "cannot create cfg" warning that we can ignore for now, see persistent configuration in the Web Status section. Details on the remaining options: The HTTP display options configure the ArchiveEngine's built-in web server. It is described in more detail in the Web Status section.

The archive_active.lck File

You can only run one ArchiveEngine per directory because it creates the directory file and data files in there. When running, this lock file is created. The ArchiveEngine will refuse to run if this file already exists. After shutdown, the ArchiveEngine will remove this lock file. If the ArchiveEngine crashes or is not stopped gracefully by the operating system, this lock file will be left behind. You cannot start the ArchiveEngine again until you remove the lock file, this is a reminder for you to check the cause of the improper shutdown and maybe check the data files for corruption.

More than one ArchiveEngine

Note that you can run multiple ArchiveEngines on the same computer. But they must be
  1. be in separate directories, see archive_active.lck
  2. use a different TCP port number for the built-in web server
In practice this means that you have to create different directories on the disk, one per ArchiveEngine, and in there run the ArchiveEngines with different "-p <port>" options.

Stop the ArchiveEngine

While the ArchiveEngine can be stopped by pressing "CTRL-C" or using the equivalent "kill" command in Unix. But the preferred method is via the built-in web server.: Use any web browser and point it to

http://<host where engine is running>:<port>/stop

e.g. http://localhost:4812. The port number defaults to 4812 or can be changed with the "-p" option of the ArchiveEngine.

More Options for the Configuration File

The following options are more advanced. You do not have to use them, they can cause more confision than good if you are not careful.
ChannelArchiver Manual