/*       Contents of format file  "PTOLEMY_EV.FMT"     */
/*      Ptolemy Event    (Normal Progress and Warning Anomalous)  */

OBJECT               = COLUMN
  NAME               = "TIME CODE"
  DATA_TYPE          = CHARACTER
  START_BYTE         = 2
  BYTES              = 17
  FORMAT             = "A17"
  DESCRIPTION        = "On board time represented as :
                        Reset number (integer starting at 1) / seconds.
                        Reset number 1 starts at 2003-01-01T00:00:00 UTC
                        The time resolution is 1/65536 s"
END_OBJECT           = COLUMN


OBJECT         = COLUMN
  NAME         = "UTC_TIME"
  DATA_TYPE    = TIME
  START_BYTE   = 21
  BYTES        = 23
  DESCRIPTION  = "This column represents the UTC Time in PDS standard format
                  YYYY-MM-DDThh:mm:ss.sss"
END_OBJECT     = COLUMN

OBJECT               = COLUMN
  NAME               = "EVENT_ID"
  DATA_TYPE          = ASCII_INTEGER
  START_BYTE         = 45
  BYTES              = 5
  FORMAT             = "I5"
  DESCRIPTION        = "Each Ptolemy event has one 16 bits word ID 
                         and a maximum of 22 words (16 bits) parameters
                         described below in EVENT_PARAMS field"
END_OBJECT           = COLUMN

OBJECT               = COLUMN
  NAME               = "EVENT_PARAMS"
  DATA_TYPE          = CHARACTER
  START_BYTE         = 52
  BYTES              = 109 
  FORMAT             = "A109"
  DESCRIPTION        = "twenty two 16 bits words in hexadecimal format 
                        separated by a space :

      ---------------------   Normal Progress Events  ---------------------

    Event ID(decimal) :  55103    

                   Event description : WGA memory check status as produced
                                       by WGA memory check Mode Event 
                   Parameters : 
                       3 words: Spacecraft time when the check was started
                       1 word : number of memory locations with DEU
                                corruption;  Special values for this are : 
              FFFF : All table start addresses are corrupt  
              FFFE : All or all but one wave start/stop address
                     combinations are corrupt   
              FFFD : All but 2 or more of table RAM addresses are corrupt
              FFFC : All but 7 or more wave RAM addresses are corrupt.        
                      
                     If none of the above values, the following parameters
                     are   also included:    
                        - 1 word containing the number of locations 
                          in the memory that are SEU corrupted    
                        - 18 words or fewer containing a part of the 
                          WGA Error Memory Map (this is 192 words long) 
                          Each 2 bit field represents the state
                          of a memory location :  
                               0 : Error free      
                               1 : SEU corrupted      
                               2 : DEU corrupted
                     11 of these packets make up a WGA memory report.

    Event ID(decimal) :   55107    

                     Event description : Mode Execution Completed
                                         memory check Mode Event 
                     Parameters : 1 word containing the operating mode 
                                  just completed

    Event ID(decimal) :    55101    

                     Event description : Ptolemy Power-on Start
                                         
                     Parameters        : 1 word containing the operating 
                                         mode just completed
     
                      1    (MSB) Startup Type = Start (AAh) 
                      1    (LSB) Startup Cause = Power-On (00H)
                      2    DAC control register
                      3    PWM control register
                      4    Valve control register
                      5    Critical functions control register
                      6    Data bus test result lower RAM devices (1)
                      7    Address bus test result lower RAM devices (1)
                      8    Memory locations test result, first page
                      9,10,11  Memory locations test result, remaining pages
                      12   Data bus test result, upper RAM devices (1)
                      13   Address bus test result, lower RAM devices (1)
                      14,15,16,17  Memory locations test result, 
                                   upper RAM devices
                      18    Upper RAM device
                      18 (MSB)     Page 3 test results
                      18 (15:14)       00 : all test passed 
                                       01 : failed memory locations test
                                       10 : failed address bus test
                                       11 : failed data bus test
                                    Results for remaining pages as for page 3
                      18 (13:08)  Lower RAM device : results as for upper RAM 
                      18 (LSB)    device
                      19          Selected RAM code page
                      20
    
    Event ID(decimal) :    55005    

                     Event description : Operating Mode Selection
                                         
                     Parameters : 
                                   1 :  Current Operating Mode
                                   2 :  Selected Operating mode
                                   3 :  Mode Selection TC parameter 1
                                   4 :  Mode Selection TC parameter 2
                                   5 :  Mode Selection TC parameter 3
    
    Event ID(decimal) :    55010    

                     Event description : SD2 Backup RAM Received
                                         
                     Parameters : 
                                   1 :  SD2 Status
                                   2 :  SD2 Drill Depth
                                   3 :  SD2 Carousel Position
                                   4 :  SD2 Oven Number
    Event ID(decimal) :    55011    

                     Event description : Ptolemy Backup RAM received
                                         
                     Parameters : 
                                  1 :  Carousel Use State
                                  2 :  RF Calibration Word
                                  3 :  Docking station motor upper position
                                  4 :  Docking station motor lower position
                                  5 :  Docking station undocked sensor value
                                  6 :  Docking station docked sensor value

    Event ID(decimal) :    55013    

                     Event description : RF Frequency Calibration Report
                          
                     Parameters :        RF calibration word


    Event ID(decimal) :    55014    

                     Event description : Docking Station Sensor Data
                          
                     Parameters :   1-23 words of docking station 
                                    potentiometer readings used for docking
                                    station calibration. 
                                    Unused (trailing) words filled with zeros


    Event ID(decimal) :    55015    

                     Event description : Docking Station Calibration Data
                          
                     Parameters :   
                                   1 :  Lowest sensor value
                                   2 :  Highest sensor value
                                   3 :  Docking station motor upper position
                                   4 :  Docking station motor lower position
                                   5 :  DAC Maximum value recorded during 
                                        calibration
                                   6 :  ADC Maximum value recorded during 
                                        calibration
 
 (1) Set bit indicates bus failure for that line

        ---------------------    Anomalous  Events  ------------------------

    Event ID(decimal) :  55101    

                     Event description : Monitor Mode Event Timed out

                     Parameters :       6 byte field describing mode event
                                        that has timed out 1 word containing
                                        the sensor value at timeout

    Event ID(decimal) :  55102    

                     Event description : WGA communication error
                     Parameters :       6 byte field describing the mode 
                                        event in which this occurred


    Event ID(decimal) :  55104    

                     Event description : Scan function in WGA does not match
                                         that written
                     Parameters :       6 byte field describing the mode
                                        event in which this occurred


    Event ID(decimal) :  55105    

                     Event description : HT did not ramp to required value
                                         within timeout period
                                         
                     Parameters :    6 byte field describing the mode event
                                     in which this occurred1 word containing
                                     the reading of the HT voltage sensor
                                     at timeout


    Event ID(decimal) :  55106    

                     Event description : Docking station failed to
                                         dock/undock within timeout period
                                         
                     Parameters :     
                                 1 : Last potentiometer value at timeout
                                 2 : Target potentiometer value
                                 3 : Tolerance on target potentiometer value


    Event ID(decimal) :  55108    

                   Event description : Parameters for a mode event
                                        are incorrect
                   Parameters :     
                                1 word containing the current operating mode
                                1 word containing the line number of the 
                                  current mode event in the mode event
                                  sequence up to 6 bytes describing
                                  the mode event in question


    Event ID(decimal) :  55109    

                     Event description : No RAM page available for 
                                        Science Spectra storage
                     Parameters :     
                                    6 byte field describing the mode event
                                    in which this occurred

    Event ID(decimal) :  55110    

                     Event description : Spectra storage data page is full

                     Parameters :     
                                   6 byte field describing the mode event
                                   in which this occurred

    Event ID(decimal) :  55111  

                     Event description : Science data packets buffer is full

                     Parameters :     
                                   6 byte field describing the mode event
                                   in which this occurred


    Event ID(decimal) :  55112    

                     Event description : No RAM page available for Science 
                                         data packet storage
                     Parameters :     
                                   6 byte field describing the mode event
                                   in which this occurred

    Event ID(decimal) :  55002    

                     Event description : Ptolemy Failure

                     Parameters :     
                                   1 (MSB) : Startup Type = Restart (55H)
                                   1 (LSB) : Startup Cause = Failure (20H)
                                   2 :  DAC control register             
                                   3 :  PWM control register
                                   4 :  Valve control register
                                   5 :  Critical functions control register


    Event ID(decimal) :  55003    

                     Event description : Ptolemy Timeout

                     Parameters :     
                                   1 (MSB) : Startup Type = Restart (55H)
                                   1 (LSB) : Startup Cause = Timeout (04H)
                                   2  : DAC control register             
                                   3  : PWM control register
                                   4  : Valve control register     
                                   5  : Critical functions control register
                                   6  : DPR (Data page register)
                                   7  : UPR (User page register)
                                   8  : UBR (User base register)
                                   9  : SPR (Stack pointer register)
                                   10 : SVR (Stack overflow limits register
                                   11 : IVR  (Interrupt vector register)
                                   12 : IBC  (Interrupt base/control register)
                                   12 : IMR (Interrupt mask register)
                                   14 : CR  (Configuration register)
                                   15-23 : first 9 words from return stack 

    Event ID(decimal) :  55004    

                    Event description : RSST checksum failure

                    Parameters :     
                                 1-22 : First 22 words of the Receive 
                                        Service System Status command Message
                                 23   : Calculated checksum

    Event ID(decimal) :  55006    

                    Event description : Memory check failure

                    Parameters :     
                                   1 : Start address of memory test 
                                   2 : End address of memory test
                                   3 : Checksum accumulated during memory test
                                   4 : Checksum expected for memory test

    Event ID(decimal) :  55007    

                    Event description : Safe limit violation

                    Parameters :     
                                   1 :  TM channel         
                                   2 :  Value from ADC
                                   3 :  Upper safe limit for this channel
                                   4 :  Lower safe limit for this channel


    Event ID(decimal) :  55008    

                    Event description : Operating Limit Excursion
                    Parameters :     
                                   1 : TM channel         
                                   2 : Value from ADC
                                   3 : Upper operating  limit for this channel
                                   4 : Lower operating  limit for this channel


    Event ID(decimal) :  55009    

                    Event description : Operating Limit Return
                    Parameters :     
                                 1 :  TM channel         
                                 2 :  Value from ADC
                                 3 :  Upper operating  limit for this channel
                                 4 :  Lower operating  limit for this channel"
END_OBJECT           = COLUMN