-------------------------------------------------------------------------
File: xdphys-data-pipeline.txt
Title: Details on how data moves through xdphys
Author: cmalek@placodermi.org (Chris Malek)
Scope: Xdphys developers
Audience: developers
Expiration Date: Nov 1, 2002
RCSid: $Id: xdphys-data-pipeline.txt,v 1.1 2002/07/15 04:29:56 cmalek Exp $
-------------------------------------------------------------------------

Abstract:

	This document describes the call structure

Executive summary:


Details:

xdphys.c:ModuleStartCB calls xdphys.c:ModuleStartFn
xdphys.c:ModuleStartFn calls xdphys.c:appRun

appRun:
	1: Figures out what the data file name will be
	2: Determines whether to use a ramdisk or not.
	3: Enables the external clock on the TG6, if necessary
	4: Calls fopen2.c:fopen2 to open the file
	5: Writes comments, and the entire header
	6: Calls the data gathering function.  This is stored in the
       RunData *info struct as the scan_fn field.  

       scan_fn is defined on a per module basis by
       xdphys.c:make_module_info, which is in turn called by the setupFoo
       function of the appropriate module.  This function is always
       called runScan within the module.

       The data gathering function is expected to write complete 
       rasters, one at a time.  

mod_gen.c:runScan

	runScan writes each stimulus as a separate record to the data file
    as it gathers the data.

	stimulus is synthesized directly into the iserver buffers.

	data is written to the file with both raster.c:writeRaster and 
	analogfns.c:writeAnalog.c


