Availability:
       Level H    , 'b'

    Quick Help:
       Contact Detect, b[Flags],[Revs],[BaselineRevs],[StartWedge],[A],[B],[C],[D],[E],[StartHt],[HtInc],

[FixedPESThresh],[FilterDelta],[RangeStart],[RangePts],[AdjThreshSigmaLimit],[VarContactThreshBackup]
  
    Description:
      This commmand exercises a simple method of Delta PES contact detection.  The methodology is
      heavily leveraged from Self Test FW Test 35.
  
    Input Parameters:

      0 - Flags.
      
          Bit 0 - Search Mode.
                  0 = Heater Only
                  1 = Write+Heat
      
          Bit 1 - Adjusted Fixed Threshold.
                  0 = Disabled
                  1 = Enabled
      
          Bit 2 - Variable Contact Threshold.
                  0 = Disabled
                  1 = Enabled
      
            Type:    Unsigned 32-bit value
      
            Range:   0 to 0xFFFFFFFF
      
            Default: 0x6 indicates Heater only search, Adjusted Fixed Threshold,
                     Variable Contact Threshold
      
      1 - Number of iterations.
      
          If entered, this parameter contains the number of Fast IO iterations (almost analogous to
          revolutions) to measure for contact detect measurement point.
      
            Type:    Unsigned 8-bit value
      
            Range:   0 to 0xFF
      
            Default: 50
      
      2 - Baseline iterations.
      
          If entered, this parameter contains the number of Fast IO iterations (almost analogous to
          revolutions) to measure for contact detect baseline measurement.
      
            Type:    Unsigned 8-bit value
      
            Range:   0 to 0xFF
      
            Default: 50
      
      3 - Starting wedge.
      
          This number is the starting wedge from Index.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFF
      
            Default: 0
      
      4 - Fast IO "A" wedges.
        
          This parameter specifies the "A" pre write/read number of wedges for Fast IO.
      
          NOTE! There is a memory limitation on this value, this # wedges directly impacts memory
          set aside for Fast IO.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFE
      
            Default: Scales with number of Servo wedges/track.
      
      5 - Fast IO "B" wedges.
        
          This parameter specifies the "B" write/read number of wedges for Fast IO.
      
          NOTE! There is a memory limitation on this value, this # wedges directly impacts memory
          set aside for Fast IO.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFE
      
            Default: Scales with number of Servo wedges/track.
      
      6 - Fast IO "C" wedges.
        
          This parameter specifies the "C" post write/read number of wedges for Fast IO.
      
          NOTE! There is a memory limitation on this value, this # wedges directly impacts memory
          set aside for Fast IO.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFE
      
            Default: Scales with number of Servo wedges/track.
      
      7 - Fast IO "D" wedges.
        
          This parameter specifies the "D" secondary write/read number of wedges for Fast IO.
      
          NOTE! There is a memory limitation on this value, this # wedges directly impacts memory
          set aside for Fast IO.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFE
      
            Default: 0
      
      8 - Fast IO "E" wedges.
        
          This parameter specifies the "E" post secondary write/read number of wedges for Fast IO.
      
          NOTE! There is a memory limitation on this value, this # wedges directly impacts memory
          set aside for Fast IO.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFE
      
            Default: 0
      
      9 - Starting heater DAC.
      
          This number is the starting heater DAC.
      
            Type:    Unsigned 8-bit value
      
            Range:   0x00 to 0xFF
      
            Default: 0
      
      10 - Heater DAC coarse increment.
      
           This number is the coarse heater DAC increment.
      
            Type:    Unsigned 8-bit value
      
            Range:   0x00 to 0xFF
      
            Default: 1
      
      11 - Fixed PES Threshold.
      
           This number is the fixed PES threshold.
      
            Type:    Decimal float
      
            Range:   14 character entry
      
            Default: 0.05
      
      12 - Filter Delta.
      
           This number is the filter delta for sample averaging.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x00 to 0xFFFF
      
            Default: 70
      
      13 - Range Start Point.
      
           This number is the range starting point for the dPES variance calculation.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFF
      
            Default: Scales with Servo wedges
      
      14 - Range Number of Points.
      
           This number is the range number of points for the dPES variance calculation.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFF
      
            Default: Scales with Servo wedges
      
      15 - Adjusted Threshold Sigma Limit.
      
           This number is the Adjusted Fixed Threshold standard deviation lower limit.
      
            Type:    Decimal float
      
            Range:   14 character entry
      
            Default: 0.01
      
      16 - Variable Contact Threshold Backup.
      
           This number is the Variable Contact Threshold backup DAC value.
      
            Type:    Unsigned 16-bit value
      
            Range:   0x0000 to 0xFFFF
      
            Default: 6
      
    Output Data:

      If an error occurred, the following information will be displayed.
      
            "DiagError aaaaaaaa R/W Status c R/W Error dddddddd"
      
         where
      
            aaaaaaaa is the Diagnostic Error Code
      
            c is the status returned by the R/W subsystem
      
            dddddddd is the error code returned by the R/W subsystem
      
      If the Verbose Formatted ASCII Data Output Mode is selected, the following will be displayed.
      
               Bit 0:      Displays a legthy list of parameter initialization.
           Bits 31-1:      NA
      
            Standard display:
      
               Parameter setup
      
                Flags oo
                 Heater Only Search
                 Adjusted Fixed Threshold enabled
                 Variable Contact Threshold enabled
                Revs aa
                BaselineRevs bb
                APreWrNumSvoWedges cccc
                BWrNumSvoWedges dddd
                CPostWrNumSvoWedges eeee
                DRdNumSvoWedges ffff
                ETrailingNumSvoWedges gggg
                HeaterStart hh
                HeaterIncr ii
                PesThreshold +j.jjjjjjE+j
                FilterDelta kk
                StartPt ll
                NumPt mm
                DpesVarStdevMinLimitfloat +n.nnnnnnE+n
                VarthreshbackupDACstep pppp
      
         where
         
            oo Flags setup.
      
            aa, bb number of iterations of Fast IO measurements.
      
            cccc Fast IO "A" parameter.
      
            dddd Fast IO "B" parameter.
      
            eeee Fast IO "C" parameter.
      
            ffff Fast IO "D" parameter.
      
            gggg Fast IO "E" parameter.
      
            hh heater start parameter.
      
            ii heater increment parameter.
      
            +j.jjjjjjE+j Fixed PES Threshold parameter.
      
            kk filter delta window parameter.
      
            ll range starting point parameter.
      
            mm range number of points parameter.
      
            +n.nnnnnnE+n Adjusted Fixed Threshold lower limit parameter.
      
            pppp Variable Contact Threshold backup DAC value.
      
      The following will also be displayed.
      
            Contact Detect loop
      
             State DAC dPESSigma
             a,    bb, c
             a,    bb, c
             a,    bb, c
             a,    bb, c
             a,    bb, c
             a,    bb, c
             a,    bb, c
      
         where
         
            a Contact Detect loop state, defined as:
               S searching
               DC contact detected
               DV contact verified
      
            bb Current heater DAC.
      
            c dPES variance, displayed as Scientific Notation floating point value.
         
      The following will also be displayed.
      
            Test Summary kkkk
      
             AdjFixedThresh +l.lllllE-l
             VarContactThresh +m.mmmmmmE-m
             Contact Heat nn
      
             L,
             Zone aa
             Cyl bbbbbbbb
             Hd cc
             Freq dddd
             IW ee
             Ovs ee
             Dur ee
             ContactVar f
             ContactThresh g
             Clearance h
             Temp ii
      
             M,
             IW ee
             OVS ee
             OSD ee
             Read Heat jj
             Preheat jj
             Write Heat jj
      
         where
      
            kkkk Test summary defined as
      
               Shared Test API error codes
      
                  11D7: DAC Maxed Out Error
                  2855: Missed Fast IO Samples Error
                  293F: Unsafe Limit Error
                  2BA9: Percent difference Exceeded Error
                  2B7D: Delta PES Exceeded Error
      
               Diagnostic error codes
                  A000: Fast IO Initialization Error
                  A001: Baseline PES collection Error
                  A002: Delta PES collection Error
      
            +l.lllllE-l Adjusted Fixed Threshold
            +m.mmmmmmE-m Variable Contact Threshold
            nn Contact DAC, potentially different from search contact verified
      
            aa Target zone.
      
            bbbbbbbb Target cylinder.
      
            cc Target head.
      
            dddd Frequency in MHz.
              
            ee Write powers.
        
            f Variance at contact.
      
            g Threshold of contact.
         
            h Calculated clearance at contact DAC.
      
            ii Current drive temperature.
      
            jj Heater values.
      
    Revision History:

      0001.0000   Initial revision.
      0001.0001   Added new parameters:
                     Starting Heat
                     Coarse Heater Increment
                     Fixed PES Threshold
                     Filter Delta
      0002.0000   Added new parameter Baseline Iterations.
                  This addition lines up naturally with the Iterations parameter, hence all
                  other parameters shifted down.
      0011.0000   Combined the PSG Diagnostic Error Codes (PSGDEC) and the Diagnostic External
                  Test Service Error Codes (DETSEC) into a single set of Diagnostic Error Codes
                  (DiagError).
      0012.0000   Added new parameters:
                     Flags:  Adjusted Fixed Threshold and Variable Contact Threshold.
                     Range Start and Number of points for averaging.
                     Adjusted Fixed Threshold Sigma Limit.
                     Variable Contact Threshold backup DAC value.
                  Ammended the "Test Summary" and parameters display information.
      0013.0000   Added new parameter defaults for test time reduction and accuracy:
                     A_PRE_NUM_SVO_WEDGES_DEFAULT        ( 0 )
                     B_WR_NUM_SVO_WEDGES_DEFAULT       	( NUM_SERVO_FRAMES_PER_TRK + NUM_SERVO_FRAMES_PER_TRK / 8 )
                     C_POST_WR_NUM_SVO_WEDGES_DEFAULT  	( NUM_SERVO_FRAMES_PER_TRK / 4 )
                     FILTER_DELTA_DEFAULT           	    NUM_SERVO_FRAMES_PER_TRK
                     RANGE_START_POINT_DEFAULT      	    A_PRE_NUM_SVO_WEDGES_DEFAULT
                     RANGE_NUM_POINTS_DEFAULT       	    ( B_WR_NUM_SVO_WEDGES_DEFAULT +  C_POST_WR_NUM_SVO_WEDGES_DEFAULT )
                  Param 12 (Filter Delta) increased from uint8 to uint16