Introduction
============
Program CycleSvc can periodically (cyclically) launch Recon with proper command
line parameters containing information about task, desired date and time and
desired length of interval. All necessary information is stored in ini
(configuration) file.

Package
=======
Package consists of these files:
1. CycleSvc.exe (program)
2. CycleSvc.ini (sample configuration)
3. README.txt (this file)

Use modes
=========
Application can be used as program (interactively) or service (daemon, WinNT or
higher). Interactive use brings no advantage, user can only start or stop 
"looking the watch". Program mode is useful in only these cases:
1. User is not allowed install or controll services
2. Application will be used only temporarily
3. Application will launch Recon residing (or using) network drives and there
  is not possible to configure this program to run under some user's account.

Installation in program mode
===========================
Program needs no installation. It is only copied into some directory with its
config file (CycleSvc.ini). We prefere directory on local drive but it can be
on network, too.

Installation in service mode
===========================
Program should be placed in some directory on local drive, e.g. c:\recon\cycler.
Then it must be run with parameter -install (or /install). If recon.exe or some
recon task (some_file.BDT) is in network, service cannot run in Local System
account. In such cases must be Windows Service manager launched and service must
be configured to use account of some user with proper network permissions.
Service name is "ReconCycler".

Uninstallation in service mode
=============================
Service can be unintalled by running program with parameter -uninstall.

Configuration
=============
There is no configuration tool. The cyclesvc.ini file must be modified by 
means of text editor like Notepad. This file is an ordinary Windows ini file 
with several group (sections). It can be edited even when the application is 
running: the application read its content repeatedly at the beginning of each 
hour (within its first 10 seconds). If the file is not valid (some exename or 
taskname is not defined - it can be caused by inproper numbering of sections), 
the program stops itself a writes information about it into logfile. The user 
must read logs after he/she changes configuration.

Group "[program]"
-----------------
There is only one key "mod" of type string. Possible values are "riis" (default),
"phd" or "pi". Must be set if "runningtag" is used (see [task_i] below).

Group "[tasks]"
---------------
There is only one key "count" of type integer. It is number of Recon tasks that
will be cyclicaly solved. 
Example:
count=3

Groups "[task_i]"
-----------------
Each solved task has its own group, "i" is integer between 1 and "count"
In each group there are these keys:
"launchperiod", integer. How often (in minutes) will be Recon launched,
ususally 60.
"phase", integer. Phase (delay) in minutes when Recon is launched. Ensure that
data exist and no too many instances of Recon are running. Usually some small
number, e.g. 10.
"intervallength", integer. Length of time interval where data will be averaged,
usually same as "launchperiod".
"exename", string. Filename with full path, no quotas needed.
"taskname", string. Filename with full path, no quotas needed.
"exporttohistory", boolean (0/1). 1 if values should be written into history
table (MDB file). Used usually for task debugging.
"exporttoexternal", boolean (0/1). 1 if values should be exported into
external data source, usually historian.
"runningtag", string, no quotas needed. If not empty task is solved only when
its value is >0. Program must be in phd or pi mode.

Example:
[task_2]
launchperiod=60
phase=15
intervallength=60
exename=S:\Recon70\Recon.exe
taskname=S:\Recon70\TASK\AVD\AVD-EXCH.BDT
exporttohistory=0
exporttoexternal=1
runningtag=

Running as program
==================
There can be only one instance of program running (on one computer) but it can
launch several Recon instances. Program has simple menu with these items:
"Launch - Start" (Ctrl+S) starts work
"Launch - Pause" (Ctrl+P) pauses work
"Launch - Resume" (Ctrl+R) continues paused work
"Launch - Stop" (Ctrl+O) stops work
"Launch - ReRead ini" (no shortcut) forces reading of config file
"Exit" (Ctrl+Q) exits program
Status bar has three panels:
1. Text Enabled/Disabled is set after each reading and parsing config file.
2. Text Stopped/Paused/Running shows state of program.
3. Information about last Recon launch (date, time and number of task).

Note
----
If CycleSvc is installed as service (see Installation in service mode) it can not
be launched as program.

Commandline parameters
----------------------
If run without parameters, program after launch does nothing. There are two
possible parameters which can be used for "automation":
Parameter A:
Abbreviation of "automatic", program immediately starts work (if configuration
is O.K.)
Parameter H:
Abbreviation of "hidden", program immediately starts work (if configuration
is O.K.) AND hides its window. In this mode program is visible only in Task
Manager on Process tab.
Notes:
  Examples: cyclesvc.exe -a or cyclesvc.exe -h, delimiter can be - (minus) or
  / (slash), parameter is not case sensitive (-a is the same as /A).
  If configuration is not O.K. program behave like no parameter is used.

Running as service
==================
Properly installed and configured service (daemon) can be controlled via Service
manager or by use command net:
"net start ReconCycler",
"net pause ReconCycler",
"net continue ReconCycler",
and "net stop ReconCycler"
to start, pause, resume or stop repectively. In service mode is no possibility
to force reading of ini file, user must wait till service will do it itself
after the whole hour.

Log files
=========
Application writes its own log files in its directory. Their names are 
"cyclesvc.0dd.txt" where "dd" is day of the month. After midnight old file with
the same day is erased if exists. In logs is all usefull and much useless
information. We advice sometimes look into logs.
