--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_LMT , !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 17:38 06/01/94 A.J. TURK -- Conversion from MDI language. --+ 1/01 289 17:20 07/02/94 A.J. TURK -- During debug phase. --+ 1/02 360 10:51 29/04/94 Ed COBB -- Rationalization --+ 1/07 443 16:54 17/06/94 Ed COBB/Ph IATRINO -- MDI Updates --+ --+------------------------------------------------------------------------+ 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_LMT , Unique Defarg Str(80) !Proc_s Str(3) !Print = "yes" End Defarg Var Str( 3) !ExpName = "MDI" Str(49) !Title = " " Int !NbErr = 0 Str(80) !S = &80s(" ") Main @OpenWindow() Select !Proc_s Case "lmtm1com" @lmtm1com() Case "lmtm2com" @lmtm2com() 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 lmtm1com ( ) --. --. This procedure performs the commissioning for the --. Michelson Tuning Motor 1 (MTM1) --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_int = 0 Main !Title = "-EXECUTING PROCEDURE: lmtm1com." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Set MTM1 to position 30; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MKM1POS" @SendCommand ( "MBM1SP" , "30" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 29 and <= 30" , *!NbErr ) !Title = "~Set MTM1 to position 75; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "75" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 74 and <= 75" , *!NbErr ) !Title = "~Set MTM1 to position 120; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "120" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 119 and <= 120" , *!NbErr ) !Title = "~Set MTM1 to position 165; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "165" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 164 and <= 165" , *!NbErr ) !Title = "~Set MTM1 to position 150; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "150" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 149 and <= 150" , *!NbErr ) !Title = "~Set MTM1 to position 105; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "105" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 104 and <= 105" , *!NbErr ) !Title = "~Set MTM1 to position 60; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "60" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 59 and <= 60" , *!NbErr ) !Title = "~Set MTM1 to position 15; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM1SP" , "15" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM1POS" , ">= 14 and <= 15" , *!NbErr ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lmtm1com." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lmtm2com ( ) --. --. This procedure performs the commissioning for the --. Michelson Tuning Motor 2 (MTM2) --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_int = 0 Main !Title = "-EXECUTING PROCEDURE: lmtm2com." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Set MTM2 to position 30; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MKM2POS" @SendCommand ( "MBM2SP" , "30" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 29 and <= 30" , *!NbErr ) !Title = "~Set MTM2 to position 75; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "75" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 74 and <= 75" , *!NbErr ) !Title = "~Set MTM2 to position 120; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "120" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 119 and <= 120" , *!NbErr ) !Title = "~Set MTM2 to position 165; CW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "165" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 164 and <= 165" , *!NbErr ) !Title = "~Set MTM2 to position 150; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "150" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 149 and <= 150" , *!NbErr ) !Title = "~Set MTM2 to position 105; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "105" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 104 and <= 105" , *!NbErr ) !Title = "~Set MTM2 to position 60; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "60" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 59 and <= 60" , *!NbErr ) !Title = "~Set MTM2 to position 15; CCW move." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBM2SP" , "15" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM2CCW" , "" ) @WaitTime ( "00h00m45s" , *!S ) @CheckReg( "MKM2POS" , ">= 14 and <= 15" , *!NbErr ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lmtm2com." @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 -----------------------------------------------------------------------