Example regular AP algorithm



next up previous contents
Next: BNF Productions Up: The MPS Algorithm Language Previous: Using the Preprocessor

Example regular AP algorithm

 

/*
 *      **MEMBER**=MPS_ALG_MPSL
 *
 * --------------------------------------------------------------------
 *
 *  Abs:  AP alg for ESA
 *
 *  AP:   AP01
 *
 *  Rem:  This alg is an example, as may be written for AP01.
 *
 *  Auth: 03-Sep-1993, N Evermore)
 *  Rev:  
 *
 * --------------------------------------------------------------------
 *
 *  Mod:
 *
 * --------------------------------------------------------------------
 */

/*
 * --------------------------------------------------------------------
 * Some A-Line definitions.  Note NONE of these expressions end with 
 * "&".  This is so they can be and'd together in the algorithm.
 * --------------------------------------------------------------------
 */
/*
 * These are the A-Line PIC's that must be okay in order for the 
 * A-Line to run.  AB01.208/209.
 */
#define ALINE_PIC_OK \
    MPS.AB01.20."40IC " == "OK" {"BSY_40B1_IC TRIPPED "} &            \
    MPS.AB01.20."IC1  " == "OK" {"BSY_IC TRIPPED      "} &            \
    MPS.AB01.20."IC108" == "OK" {"BSY_PC0_IC TRIPPED  "} &            \
    /* end of ALINE_PIC_OK macro */

/*
 * These are the A-Line BIR's that must be okay in order for the 
 * A-Line to run.  AB01.305/306.
 */
#define ALINE_BIR_OK \
    MPS.AB01.5."IV12    " == "OPEN"   {"ESA_IV12 NOT_OPEN      "} &   \
    MPS.AB01.5."FV11    " == "OPEN"   {"ESA_FV11 NOT_OPEN      "} &   \
    MPS.AB01.5."G14     " == "OK"     {"ESA_G14 FAULTED        "} &   \
    MPS.AB01.5."IC_PRESS" == "OK"     {"ESA_IONC_GAS FAULTED   "} &   \
    /* end of ALINE_BIR_OK macro */

/*
 * These are the A-Line RTD's that must be okay in order for the 
 * A-Line to run.  AB01.306.
 */
#define ALINE_RTD_OK \
    MPS.AB01.13."T23     " == "OK" {"A_P1_TMP TRIPPED    "} &         \
    MPS.AB01.13."52ST2_T1" == "OK" {"A_52ST2_TMP TRIPPED "} &         \
    /* end of ALINE_RTD_OK macro */                                   

/*
 * ===================================================================
 * AP and algorithm name.
 * ===================================================================
 */
AP = AP01
ALG = "september mps"

BEAM = "SLCSLD" | "BAS2"

    RATE = "FULLRATE" | /* Full rate everywhere */
           "LIMHI_FN" | /* E- beam in arcs/ff limited to 10 Hz */
           "LIMHI_FS" | /* E+ beam in arcs/ff limited to 10 Hz */
           "LIMHI_FF"   /* Both beams in arcs/ff limited to 10 Hz */

        STOPCNF = NONE  {"NONE"}

            NEWRATE = "ZERORATE"

                ALINE_PIC_OK &
                ALINE_BIR_OK &
                ALINE_RTD_OK &
                PICS.AB01.101."CABLE   " == "OK"
                ;

            NEWRATE = "LIMIT_HI"

                PICS.AB01.101."FULLRATE" == "OK"
                ;

	    NEWRATE = "FULLRATE"
                ; /* default */


    RATE = "LIMIT_HI"   /* Beam everywhere limited to 10 Hz. */

        STOPCNF = NONE  {"NONE"}

            NEWRATE = "ZERORATE"

                ALINE_PIC_OK &
                ALINE_BIR_OK &
                ALINE_RTD_OK &
                PICS.AB01.101."CABLE   " == "OK"
                ;

            NEWRATE = "LIMIT_LO"

                PICS.AB01.101."FULLRATE" == "OK"
                ;

            NEWRATE = "LIMIT_HI"

                PICS.AB01.101."LIMIT_LO" == "OK" &
                PICS.AB01.101."LIMIT_HI" == "OK"
                ;

	    NEWRATE = "FULLRATE"
                ; /* default */


    RATE = "LIMIT_LO"   /* Beam everywhere limited to 1 Hz. */

        STOPCNF = NONE  {"NONE"}

            NEWRATE = "ZERORATE"

                ALINE_PIC_OK &
                ALINE_BIR_OK &
                ALINE_RTD_OK &
                PICS.AB01.101."CABLE   " == "OK" &
                PICS.AB01.101."FULLRATE" == "OK" 
                ;

            NEWRATE = "LIMIT_LO"

                PICS.AB01.101."LIMIT_HI" == "OK"
                ;

            NEWRATE = "LIMIT_HI"

                PICS.AB01.101."LIMIT_LO" == "OK"
                ;

	    NEWRATE = "LIMIT_HI"
                ; /* default */

    RATE = "ZERORATE"   /* No beam at all. */

        STOPCNF = NONE  {"NONE"}

            NEWRATE = "ZERORATE"

                ALINE_PIC_OK &
                ALINE_BIR_OK &
                ALINE_RTD_OK &
                PICS.AB01.101."CABLE   " == "OK" &
                PICS.AB01.101."FULLRATE" == "OK" &
                PICS.AB01.101."LIMIT_HI" == "OK" &
                PICS.AB01.101."LIMIT_LO" == "OK"
                ;

	    NEWRATE = "LIMIT_LO"
                ; /* default */



SLAC Controls Software
Fri Nov 4 11:47:17 PST 1994