Availability:
     Level E    , 'G'

  Quick Help:
     HeadDegradation, G[OperationControlOptions],[MeasurementControlOptions]

  Description:
    This command performs all sort of operations related to the Head Degradation feature
    in the code. These operations include running any or all of the current Head Degradation
    measurements, logging results, and reading the existing logs.

  Input Parameters:

    
    0 - Operation Control options.
    
        This parameter specifies the operation(s) which the diagnostic is to perform.

         Bits marked NYI are Not Yet Implemented
         
           Bit 15-4:  Reserved
         
           Bit 3, 0x0008: NYI If this bit is set, output the log results to the serial port.
         
           Bit 2, 0x0004: NYI If this bit is set, output measurement results to the log.
           (Bit 0 must be set)
         
           Bit 1, 0x0002: If this bit is set, output measurement results to the serial port.
           (Bit 0 must be set; some measurements will output results regardless)
         
           Bit 0, 0x0001: If this bit is set, perform the indicated measurements.
    
          Type:    unsigned 16-bit hex number
    
          Range:   0 to 0xffff
    
          Default: 0 (Do nothing)
    
    1 - Measurement options.
    
        This parameter specifies the measurements that this call of the diagnostic will
        operate on.

         Bits marked NYI are Not Yet Implemented: they may perform some operation, but
         the test and its results are not finalized
         
           Bit 15, 0x8000: Initialize tracks for nominally read-only tests performed
         
           Bits 14-9: not used
         
           Bit 8,  0x0100: NYI Head stability test, read only
         
           Bit 7,  0x0080: NYI Head stability test, write/read
         
           Bit 6,  0x0040: Harmonic detector test, read only
         
           Bit 5,  0x0020: Harmonic detector test, write/read
         
           Bit 4,  0x0010: Channel statistics test (MSE, VGAR, VGAS), read only
         
           Bit 3,  0x0008: Channel statistics test (MSE, VGAR, VGAS), write/read
         
           Bit 2,  0x0004: ECC usage test, read only
         
           Bit 1,  0x0002: ECC usage test, write/read
         
           Bit 0,  0x0001: Head resistance test
    
          Type:    unsigned 16-bit hex number
    
          Range:   0 to 0xffff
    
          Default: 0 (Do nothing)
    
  Output Data:

    If an error occurred, the following information will be displayed.
    
          "DiagError aaaaaaaa"
    
       where
    
          aaaaaaaa is the Diagnostic Error Code
    

    
        If serial port output is requested, it is formatted as follows for each measurement point.
    
        "C cccccccc H hh"
    
           where
    
              cccccccc is the base cylinder for this measurement set. No measurements are actually
              taken at this cylinder, but rather at fixed offsets from the base cylinder.
    
              hh is the head for this measurement set.
    
        "Temp ttt C"
    
           where
    
              ttt is the temperature in degrees Celsius. If an error occurred during the test, this
              will read -300.
    
        If "Initialize Tracks" bit is set, the following information will be displayed:
    
              "Read-only tests initialized"
    
        If "Head Resistance Measurement" bit is set, the following information will be displayed:
    
              "Head resistance rrr ohm"
    
           where
    
              rrr is the resistance of the head in ohms.
    
        If "ECC usage, read-only" bit is set, the following information will be displayed:
    
              "Read only ECC results"
              "T xx Good yyyyy Total zzzzz" (five times)
    
           where
    
              xx is the ECC correction T-level for this data point.
              yyyyy is the number of good sectors measured (correction at or below the given T level)
              zzzzz is the total number of sectors measured at the given T level
    
        If "ECC usage, write/read" bit is set, the following information will be displayed:
    
              "Write-read ECC results"
              then as for "ECC usage, read-only" above
    
        If "Channel statistics, read-only" bit is set, the following information will be displayed:
    
              "Read only channel statistics results"
              "MSE Mean mmmmmmmm Stdev ss.sssEss"
              "VGAR Mean mmmmmmmm Stdev ss.sssEss"
              "VGAS Mean mmmmmmmm Stdev ss.sssEss"
    
           where
    
              mmmmmmmmm is the trimmed mean measurement of the given parameter.
              ss.sssEss is the trimmed standard deviation of the given parameter, in the format
              (sign)#.###E(sign)#.
    
        If "Channel statistics, write/read" bit is set, the following information will be displayed:
    
              "Write-read channel statistics results"
              then as for "Channel statistics, read-only" above
    
        If "Harmonic detector, read-only" bit is set, the following information will be displayed:
    
              "Read only harmonic detector results"
              "Harmonic Detector mean xxxxxxxx"
    
           where
    
              xxxxxxxxx is the trimmed mean measurement of the harmonic detector.
    
        If "Harmonic detector, write/read" bit is set, the following information will be displayed:
    
              "Write-read harmonic detector results"
              then as for "Harmonic detector, read-only" above
    
        Head stability is not yet fully implemented, and so may produce unspecified output if those
        bits are set.
    
    

  Examples:

    Example #1:
    Perform head resistance and read-only harmonic detector tests. Output results to serial port.

       F3 E>G3,41

    Example #2:
    Initialize the read-only harmonic detector test tracks. Perform write/read and read-only
    harmonic detector tests. Output results to serial port.

       F3 E>G3,8060

    Example #3:
    Perform all tests, including those under development. Output results to serial port.

       F3 E>G3,7fff

    Example #4:
    Perform all tests, including those under development. Initialize all read-only
    tests before running them.Output results to serial port.

       F3 E>G3,ffff

  Revision History:

    0001.0000   Initial revision.