c
c -- Definition of fixed portion of file header
c
	integer*4 FileHdrLen
	   parameter (FileHdrLen = 512)		! Length of this header in bytes
!   	parameter FileHdrVer = 1		! Version of this file header
 
      structure /FileHeader/
	     integer*4		 Len		   ! Length of this header in bytes = 512
        integer*4		 Version		! Version number of file = 1
	     integer*4		 FilterFlag ! This data has been filtered; 0 = No, 1 = Yes
	     integer*4		 SyncPtr 	! Starting byte of sync headers
	     integer*4		 NumSync  	! Number of sync channels
	     integer*4		 FrcPtr   	! Starting byte of force plate headers
	     integer*4		 NumPlt  	! Number of force plates
	     integer*4		 EMGPtr  	! Starting byte of EMG headers
	     integer*4		 NumEMG  	! Number of EMG channels
	     integer*4		 Session		! Session number
	     integer*4		 Run		   ! Run Number
	     integer*4		 Seconds		! Seconds to take data
	     real*4		    LfLegLen	! Patient's left leg length in Inches
	     real*4		    RtLegLen	! Patient's right leg length in Inches
	     integer*4		 Age	   	! Patient's Age in years
	     real*4		    Weight     ! Patient's Weight in pounds
	     character*20	 DateTime	! Time in 'dd-mmm-yyyy hh:mm:ss' format
 	     character*40	 Name		   ! Patient's name
	     character*40	 Diag	   	! Patient's Diagnosis
	     character*40  Comments  	! Comments
	     integer*4		 Trigger		! Trigger Flag 1 = Triggered and 0 = Not Triggered
	     character*304 Filler		! Filler (For future expansion)
	    end structure
c                             
c -- Structure of Sync Channel header record (one per sync channel)
c
	integer*4 SyncHdrLen
	    parameter (SyncHdrLen = 256)		! Length of this header in bytes
 
	    structure /SyncHeader/
	     integer*4		 Len	    	! Length of this header in bytes = 256
	     integer*4		 Type	   	! Type of header = 20 = Sync channel)
	     integer*4		 SampleRate	! Sampling rate for this channel
	     integer*4	    NumSample  ! Number of samples taken
	     character*16	 Name	   	! Name of sync channel
	     integer*4	    Data   		! Byte # of start of data (First byte in file = 1)
	     integer*4		 PhysChan	! Number of physical A/D channel
	     character*40  Comments  	! Comments
	     character*176 Filler		! Filler (For future expansion)
	    end structure             
c
c -- Definition of 6 Channel Force Plate header record (one for each Force plate)
c            
	integer*4 FrcHdrLen
	    parameter (FrcHdrLen = 256)		! Length of this header in bytes
 
	    structure /FrcHeader/ 
	     integer*4		Len		   ! Length of this header in bytes = 256
	     integer*4		Type	   	! Type of header = 30 norm, 31 processed
	     integer*4		SampleRate	! Sampling rate for this Force plate
	     integer*4		NumSample   ! Number of samples taken per chan
	     character*40 Name	    	! Name of plate
        union
          map
            real*4 PltPos(3)
          end map
          map
	         real*4	   	XPos     	! X_location of plate
 	         real*4	     	YPos        ! Y_location of plate
	         real*4	     	ZPos        ! Z_location of plate
          end map
        end union
	     integer*4		NumChnl	   ! Number of channels
        union
          map                                   
            integer*4    DataPtr(6) 
          end map
          map
            integer*4		FxPtr 		! Byte # of start of FX data (First byte in file = 1)
	         integer*4		FyPtr 	  	! Byte # of start of FY data
	         integer*4		FzPtr 		! Byte # of start of FZ data
	         integer*4		MxPtr 		! Byte # of start of MX data
	         integer*4		MyPtr 		! Byte # of start of MY data
	         integer*4		MzPtr 		! Byte # of start of MZ data
          end map
        end union
        union
          map
            integer*4 PhysChnl(6)
          end map
          map
  	         integer*4		FxPhysChnl	! Number of physical A/D channel
	         integer*4		FyPhysChnl	! Number of physical A/D channel
	         integer*4		FzPhysChnl	! Number of physical A/D channel
	         integer*4		MxPhysChnl	! Number of physical A/D channel
	         integer*4		MyPhysChnl	! Number of physical A/D channel
	         integer*4		MzPhysChnl	! Number of physical A/D channel
          end map
        end union
        union
          map
            real*4 ConvFactor(6)
          end map
          map
	         real*4		FxConvFactor	! Simple Conversion factor from A/D units to lbs
	         real*4		FyConvFactor	! " Conversion factor from A/D units to lbs
	         real*4		FzConvFactor	! " Conversion factor from A/D units to lbs
	         real*4		MxConvFactor	! " Conversion factor from A/D units to inlb
   	      real*4 		MyConvFactor	! " Conversion factor from A/D units to inlb
	         real*4		MzConvFactor	! " Conversion factor from A/D units to inlb
          end map
        end union
        union
          map
            integer*4 Zero(6)
          end map
          map
	         integer*4		FxZero		! Zero point in A/D units
	         integer*4		FyZero		! Zero point in A/D units
	         integer*4		FzZero		! Zero point in A/D units
	         integer*4		MxZero		! Zero point in A/D units
	         integer*4		MyZero		! Zero point in A/D units
	         integer*4		MzZero		! Zero point in A/D units
          end map
        end union  
	     character*40	Comments	   ! Comments
	     character*48	Filler		! Filler (For future expansion)
	    end structure
c
c -- Definition of EMG Channel header record  (one for each EMG channel)
c                    
	integer*4 EMGHdrLen       
	    parameter (EMGHdrLen = 256)		! Length of this header in bytes
 
	    structure /EMGHeader/
	     integer*4		 Len	   	! Length of this header in bytes = 256
	     integer*4		 Type   		! Type of header = 40 norm, 41 processed
	     integer*4		 SampleRate	! Sampling rate for this channel
	     integer*4		 NumSample  ! Number of samples taken
	     character*40	 Name	   	! Name of Muscle
	     integer*4		 DataPtr	  	! Byte # of start of data  (First byte in file = 1)
	     integer*4		 PhysChnl  	! Number of physical A/D channel
	     integer*4		 ElecType	! 1 = Wire or 2 = Surface
	     character*40	 Filter		! Input filter type
	     character*40  Comments   ! Comments
	     character*108 Filler     ! Filler (For future expansion)
	    end structure                          
                        
