PV phase script translated from complex IST phase script

Header's information

// $Id$
// Missionphase  : PACS PV Phase
//
//
// Version       : 0.1
//
//
// Purpose       : SFT in Open Loop Mode (warm conditions)
//                  
// Author        : Markus Nielbock
// CUS author    : MN
//
// Description   : SFT warm for FM1 chopper in open-loop mode. All 3 coils are
//                 operative. The chopper is commanded between -20 mA and +20mA
//                 in steps of 4 mA.
//                 The first part consists of chopper deflections equivalent to
//                 commanded chopper coil currents between 0 and +/-20 mA,
//                 alternating between positive and negative values. Absolute
//                 position commanding is used.
//                 The second part consists of a ramp of chopper deflections
//                 between -20 and +20 mA, commanded in relative steps of 4 mA.
//                 Finally, the chopper returns to its zero position.
//                  
// Dependencies  : 
//
// Preconditions : PACS switched-on in spectroscopy mode, chopper is switched
//                 off and disabled, diagnostic HK not running
//                 
// Comments      : Adapted from PACS_Chopper_SFT_Cold_OpenLoop_OBS.cus
//
// Version       : 1.0
// 
// History       : 1.0 12-03-07 creation by MN
//               : 2.0 13-02-08 Made into a proc to be called by 
//                 "obs" PacsEng_Chpper_SFT_Warm_OpenLoop

Declaration of script type as observation (i.e. inc. a pointing request

obs PacsEng_Chopper_SFT_Warm_OpenLoop {

/* Needed variables to call PacsEng_Chopper_SFT_Warm_OpenLoop                        */
/* string fltPOS = "POS A"; //Filter wheel position 0="POS A", 1="POS B" */
/* End of needed variables for PacsEng_Chopper_SFT_Warm_OpenLoop                     */
}{

// Four arguments needed for "no_pointing"
// 1. Execute the pointing request
  bool execute = true;
// 2. Initial hold
//    Write OBSID during initial hold
  int tih = duration(WriteOBSID($OBSID));
// 3. Final hold
//    Declare OBS finished during final hold
  int tfh = duration(WriteEndID());

Specific call for the new observation procedure

// 4. Duration of "stable" pointing
  int tp = imax(1,duration(PACS_Chopper_SFT_Warm_OpenLoop()));

Pointing request

// Issue PointReq
    int[] ts = no_pointing(execute,tih,tfh,tp);
}

Start of the State machine

{
// Start observation.
// STATE_MACHINE logic. 
// OBSID is handled during initial and final hold times. Otherwise, consider
// only stable pointing
  int[] state = [0];
   while(state[0] >= 0)
     {
      state = next_state();
      if(state[0] == 2)
        {
//        Declare start of OBS
          WriteOBSID($OBSID);
        }

      if(state[0] == 3)
        {
//        Call the required procedure

Calling the new observation procedure

          PACS_Chopper_SFT_Warm_OpenLoop();

        }
      if(state[0] == 5)
        {
//        Declare end of OBS
          WriteEndID();
        }
    }
// End of observation
}

Herschel: PacsEng_Chopper_SFT_Warm_OpenLoop (last edited 2009-07-15 14:32:37 by localhost)