== Example of PV phase script translated from its IST phase structure == ''' Header's information {{{ // $Id$ // Missionphase : PACS PV Phase // // // Version : 0.1 // // Purpose : Schedule the associated CUS procedure // // CUS author : DAC // // Input arguments // type name description // // Return values // Type Name Description // // Description : Set/resets OBSID, calls associated procedure // // Dependencies : see associated procedure // // Preconditions : see associated procedure // // Comments : // // History : 0.1 22-mar-2006 // History : 0.1 11-feb-2008 Converted into Eng OBS by VDP // }}} Declaration of script typre as observation (e.g. inc. a pointing request) and X-HSPOT readable variables {{{ obs PacsEng_Spec_Gra_Diaghk_Setup { /* No variables to call PacsEng_Spec_Gra_Diaghk_Setup */ int diag_hk_period = 5; // 5 msec diag hk period /* string fltPOS = "POS A"; //Filter wheel position 0="POS A", 1="POS B" */ /* End of needed variables for PacsEng_Spec_Gra_Diaghk_Setup */ } }}} Internal variables declaration, and timing computation {{{ { // 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()); // 4. Duration of "stable" pointing int tp = imax(1,duration(PACS_Spec_Gra_Diaghk_Setup(diag_hk_period))); }}} Pointing request: this is a `PacsEng` script so a `no_pointing` request is necessary, because the system expects a pointing request of some sort nontheless {{{ // Issue PointReq int[] ts = no_pointing(execute,tih,tfh,tp); } }}} State machine: even though there is no actual pointing, the observation made during the tests require the telescope to be "On SRC" {{{ { // 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 PACS_Spec_Gra_Diaghk_Setup(diag_hk_period); } if(state[0] == 5) { // Declare end of OBS WriteEndID(); } } // End of observation }