--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_TB_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 : FR --+ Author : O. MICHEL --+------------------------------------------------------------------------+ --+ 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 495 12:34 16/11/94 Olivier MICHEL / First issue --+ --+------------------------------------------------------------------------+ 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 cfile MDI_LT 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_TB_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() Case "lhcmspt" @lhcmspt() 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: lhcmon." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lhcmspt ( ) --. --. This Procedure establishes the set points for the four --. CCD Camera Decontamination Heaters --. 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) !Check = "" Str(80) !Get_dig = "" Str(80) !LM_S1 = "" Str(80) !LM_S2 = "" Str(80) !LM_S3 = "" Int !LM_I1 = 0 Int !LM_I2 = 0 Main !Title = "-EXECUTING PROCEDURE: lhcmspt." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LT , "ltemps", "no" Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select !Title = "Establish CCD Heater set point" @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Question = "Enter HCM set point" !Check = ">= 0 and <= 15" @AskInt ( !Question, !Check, *!LM_I1, *!S, *!NbErr ) !Title = "~HCM set point" + &d(!LM_I1) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) If !LM_I1 >= 8 Then !LM_I2 = !LM_I1 - 8 ELSE !LM_I2 = !LM_I1 End If !LM_S2 = Get ("MKPWHOP") If !LM_I2 >= 0 Then If !LM_S2 <> "ON" Then !Title = "~Switch ON Optics Package/CCD Heater" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBPWHOPN" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWHOP" , "ON" , 1 Enable "MKPWHOP" !Title = "~Switch ON to set point 0" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBHOPSPT" , "0" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKHOPSPT" , 0 , 1 Expect "MKHOPH2" , "OFF" , 1 Expect "MKHOPH3" , "OFF" , 1 Enable "MKHOPSPT" Enable "MKHOPH2" Enable "MKHOPH3" !LM_S2 = "ON" End If End If If !LM_I1 > 8 Then @lhcmon() !LM_S1 = "ON" ELSE @lhcmoff() !LM_S1 = "OFF" End If If !LM_I2 > 0 Then Inhibit "MKHCMSPT" @SendCommand ( "MBHCMSPT" , &d(!LM_I2) ) @WaitTime ( "00h00m45s" , *!S ) Expect "MKHCMSPT" , !LM_I2 , 1 Enable "MKHCMSPT" End If Select !GM_Conf Case 1 @PrintAna ( "MIPWA" , "Nominal Side Current" ) Case 2 @PrintAna ( "MIPWB" , "Redundant Side Current" ) Default End Select !LM_S3 = "= "+ &s(!LM_S1) @CheckDig( "MKPWHCM" , *!LM_S3 , *!NbErr ) !LM_S3 = "= "+ &s(!LM_S2) @CheckDig( "MKPWHOP" , *!LM_S3 , *!NbErr ) !LM_S3 = "= "+ &d(!LM_I1) @CheckReg( "MKHCMSPT" , *!LM_S3 , *!NbErr ) @PrintParam( "M+15HTR" , "ANA" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lhcmspt." @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 -------------------------------------------------------------------------------<