--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_LHCM , !Proc_s , !Print --+ Purpose : (See Procedure headers) --+ --+ Sub_system : PLM --+ Drawing No : 3137-ZA042-SCB Issue : A/00 --+ Project No : SH-MAR-SW-70224 --+ Origin : UK --+ Author : Jon B. CARTER --+------------------------------------------------------------------------+ --+ Principle : --+ --------- --+ Holding CF for a group of related Procedures, originally written in --+ MDI's own Control File language. --+ --+ Passed parameters : --+ ----------------- --+ !Proc_s : Name of required Procedure. --+ !Print : CF Log print indicator ( "yes" (default) | "no" ). --+ --+ Prerequisites : --+ ------------- --+ Control File MDI_ON must have been successfully performed. --+ --+ History : --+ ------- --+ Issue SIC Note Time Date Name/Updates --+ +---+ +------+ +---+ +------+ +-------------------------------------+ --+ 1/00 211 16:53 30/11/93 A.J. TURTK -- Conversion from MDI language. --+ 1/01 289 13:13 02/02/94 Ph. IATRINO -- During debug phase. --+ 1/02 360 10:53 05/05/94 Ed COBB/Ph. IATRINO -- Rationalization --+ 1/07 443 16:33 17/06/94 Ed COBB/Ph. IATRINO -- CF Errors. --+ --+------------------------------------------------------------------------+ Common Var Bool !GZ_Window -- Open window flag (on CF start) Bool !GZ_Spool -- Automatic Spool (at End of CF exec) Bool !GZ_Halt -- Check Error flag (to halt if error) Bool !GZ_Test -- Execution test flag (to not send TC) Int !GZ_Trace -- Level of Trace (TBD) Int !GM_NbErr -- MDI Global Error Count Int !GM_Conf -- MDI Configuration End Common -------------------------------------------------------------------------------< Extern Group MWTM , PWP12TM Procedure AskReal , AskStr , AskInt Procedure CheckAna , CheckDig , CheckReg Procedure CheckArgReal , CheckArgStr , CheckArgInt Procedure DispMess Procedure ExConnect , ExDisconnect Procedure ExitCF Procedure Message Procedure OpenWindow Procedure PrintAna , PrintDig , PrintReg , PrintParam Procedure SendCommand Procedure Lower , Upper Procedure WaitAna , WaitDig , WaitReg , WaitTime End Extern -------------------------------------------------------------------------------< Program MDI_LHCM , Unique Defarg Str(80) !Proc_s Str(3) !Print = "yes" End Defarg Var Str( 3) !ExpName = "MDI" Int !NbErr = 0 Str(49) !Title = " " Str(80) !S = &80s(" ") Main @OpenWindow() Select !Proc_s Case "lhcmcom" @lhcmcom() Case "lhcmoff" @lhcmoff() Case "lhcmon" @lhcmon() Default !Title = "*ERROR: UNKNOWN PROCEDURE: "+!Proc_s @Message("DCL" , "date" , !ExpName , " " , !Title , *!S) -- Beep Halt !Title = "*Operator CONTinue" @Message("DC" , "date" , !ExpName , " " , !Title , *!S) Return !Rstat End Select @ExitCF (!NbErr) @PrintCF ( !ExpName , !Print ) Return !Rstat End Program ----------------------------------------------------------------------------------< Procedure lhcmcom ( ) --. --. This Procedure performs the CCD Camera Heater commissioning --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Question = "" Real !Get_real = 0.0 Str(80) !LM_S1 = "" Main !Title = "-EXECUTING PROCEDURE: lhcmcom." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~CCD Camera Heater Commissioning" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @PrintParam( "MTOPTS6" , "ANA" ) -- @PrintParam( "MTCMTM1" , "ANA" ) Inhibit "MKPWHCM" @SendCommand ( "MBPWHCMN" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWHCM" , "ON" , 1 Enable "MKPWHCM" !Title = "~Camera heater switched on" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select @PrintParam( "MKPWHCM" , "DIG" ) @PrintParam( "MTOPTS6" , "ANA" ) Inhibit "MKPWHCM" @SendCommand ( "MBPWHCMF" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWHCM" , "OFF" , 1 Enable "MKPWHCM" !Title = "~Camera heater switched off" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select @PrintParam( "MKPWHCM" , "DIG" ) @PrintParam( "MTOPTS6" , "ANA" ) -- @PrintParam( "MTCMTM1" , "ANA" ) Inhibit "MKPWHCM" !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lhcmcom." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lhcmoff ( ) --. --. This procedure file powers OFF the CCD Camera Heater: --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Question = "" Str(80) !LM_S1 = "" Main !Title = "-EXECUTING PROCEDURE: lhcmoff." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Switching OFF CCD camera heater." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MKPWHCM" @SendCommand ( "MBPWHCMF" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWHCM" , "OFF" , 1 Enable "MKPWHCM" Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select @PrintParam( "MKPWHCM" , "DIG" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lhcmoff." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lhcmon ( ) --. --. This Procedure powers ON the CCD Camera Heater. --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !ErrCount = 0 Str(80) !Question = "" Str(80) !Get_dig = "" Str(80) !LM_S1 = "" Main !Title = "-EXECUTING PROCEDURE: lhcmon." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Switching ON CCD camera heater" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MKPWHCM" @SendCommand ( "MBPWHCMN" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWHCM" , "ON" , 1 Enable "MKPWHCM" Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select !Get_dig = Get( "MKPWHCM" ) If !Get_dig <> "ON" Then !Title = "*CCD camera heater is NOT ON" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "*Operator CONTinue" @Message("DC" , "time" , !ExpName , " " , !Title , *!S) End If @PrintParam( "MKPWHCM" , "DIG" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lhcmoff." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure PrintCF( str(3) !ExpName, str(8) !Print) --. Print the control file log file if required by !Print ; --. - using the 'Spool' statement if the variable !GZ_Spool is TRUE, --. - using the dialog box window if the variable !GZ_Spool is FALSE. --. Var str(80) !S = &80s(" ") Main If !Print = "yes" Then If !GZ_Spool = TRUE Then Spool CF Else Cflog @Message( "DC", "date", !ExpName, " ", \ "++++Print the CFLog, then type CONT+++", *!S) Halt @Message( "DC", "date", !ExpName, " ", \ "+Operator continue.", *!S) End If End If Return End Procedure -------------------------------------------------------------------------------<