How to install MIDAS under Windows NT
-------------------------------------

The MIDAS archive for Windows NT contains additionally to the
source code all pre-compiled executables.

Follow these steps to do an installation:

1) Unpack midas-x.xx.exe (where x.xx is the current version) to a
directory of your choice (usually c:\) by executing it.

Following directory structure is created:

c:\midas-x.xx             MIDAS root for version x.xx
.\doc                     Documentation
.\src                     Source files
.\include                 Include files
.\drivers                 Device drivers
.\examples                Example programs
.\examples/experiment     Sample experiment
.\nt                      NT makefiles for Visual C++
.\nt\bin                  Executables for Windows NT
.\nt\lib                  Libraries for Windows NT

2) Copy the MIDAS library to the NT system directory, usually
c:\winnt\system32:

  cd \midas-x.xx\nt\lib
  copy midas.dll \winnt\system32

3) Install to MIDAS binaries and libraries. Copy following
directories:
  
  \midas-x.xx\nt\lib   ->  \midas\nt\lib
  \midas-x.xx\nt\bin   ->  \midas\nt\bin
  \midas-x.xx\src      ->  \midas\src
  \midas-x.xx\include  ->  \midas\include

4) Set the path environment variable to the MIDAS executables at
c:\midas\nt\bin. To do so, right-click on the "My Computer"
icon on the desktop. Select "Properties" from the menue. On the
dialog box, click on the "environment" tab. Under "System
variables", search and select "Path". On the "value" field, go
to the end of the path and add the MIDAS executable direcotry.
The path should then look somehow like:

  %SystemRoot%\system32;%SystemRoot%;c:\midas\nt\bin;

Press the "Set" and "OK" button.

5) Make sure the CERN library is installed properly. The MIDAS
analyzer needs libpacklib.a which is usually installed under
\cern\lib.

6) Create a working directory which hosts the frontend and analyzer
program of your experiment (in the following example called "online"). 
Copy the example experiment as a starting point: 

  mkdir c:\online
  cd \online
  copy \midas-x.xx\examples\experiment\* .

7) Set the environment variable MIDAS to point to your directory.
Open the "environment" dialog box as under 3). Then enter "MIDAS"
in the "Variable" box and "c:\online" in the "Value" box (without
quotation marks). Press the "Set" and "OK" button.

8) Build the example experiment. Load the workspace frontend.mdp 
into Visual C++ (File/Open Workspace/"c:\online\frontend.mdp). and
compile it. Do the same for analyzer.mdp. This procedure creates
a sample frontend and analyzer program, which can be used with
the mlogger program to do DAQ. In case the PC is connected directly
to the hardware, all three program can be run in the same process
which avoids overhead through inter-process communication. In that
case, load and compile fal.mdp (Frontend-Analyzer-Logger). Run only
fal.exe together with odbedit to do the experiment.

9) Test the system by running a fake experiment with a frontend which
produces random data:

  cd c:\online\debug
  start frontend
  start analyzer
  start mlogger

  odbedit
  [local]/> start
  ...
  [local]/> stop

Or alternatively, if FAL has been build

  cd c:\online\debug
  start fal
  
  odbedit
  [local]/> start
  ...
  [local]/> stop

The frontend should produce trigger and scaler events. The analyzer
gets those events and histogramms them. Now you can run PAW and look
at the N-tuples and histos:

  pawnt
  PAW> hi/hio/gl onln
  PAW> hi/list
  PAW> hi/pl 1000

10) If everything workes sucesfully, you can edit the frontend and
analyzer to suit your experiment.

11) If the frontend runs on another computer, the MIDAS server program
has to be installed. You can either start mserver manually or as a
NT service. To start mserver as a service, execute 

  c:\midas\nt\service\install.bat

and follow the instructions printed by this batch file.

12) If you want to access hardware directly under Windows NT, you have
to install the DirectIO driver. Using this driver it is possible for
example to access a PC-CAMAC interface in the frontend program running
directly on the Windows NT machine.