--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_MODE , !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/01 289 17:53 07/02/94 A.J. TURK -- Conversion from MDI language. --+ 1/02 360 13:13 05/05/94 Ed COBB/Ph. IATRINO -- Rationalization. --+ 1/03 393 16:28 11/05/94 Ed COBB/Ph. IATRINO -- MDI Updates. --+ 1/07 443 18:06 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 Str(80) !GM_S0 Str(80) !GM_S6 End Common -------------------------------------------------------------------------------< Extern Cfile MDI_LMCH , PLM_BLOCK 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_MODE , 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 "lcalmode" @lcalmode() Case "lobsmode" @lobsmode() 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 lcalmode ( ) --. --. This procedure puts MDI into nominal Calibration Mode --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_Int = 0 Str(50) !Question = " " Str(50) !Check = " " Int !Cmd_data_i(30) Main !Title = "-EXECUTING PROCEDURE: lcalmode." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBDPFLGS" , "0 , 0X20 , 1" ) !Title = "OBSERVING Mode & Continuum for AIR" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Cmd_data_i(0) = 0x0100 !Cmd_data_i(1) = 0x0100 !Cmd_data_i(2) = 0x0200 !Cmd_data_i(3) = 0x0200 !Cmd_data_i(4) = 0x0200 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 !Cmd_data_i(0) = 26 !Cmd_data_i(1) = 78 !Cmd_data_i(2) = 125 !Cmd_data_i(3) = 19 !Cmd_data_i(4) = 125 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 @WaitTime ( "00h00m45s" , *!S ) @PrintParam( "MKM1POS" , "REG" ) @PrintParam( "MKM2POS" , "REG" ) @PrintParam( "MKPAPOS" , "REG" ) @PrintParam( "MKC1POS" , "REG" ) @PrintParam( "MKC2POS" , "REG" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lcalmode." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lobsmode ( ) Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_Int = 0 Str(50) !Question = " " Str(50) !Check = " " Int !Cmd_data_i(30) Main !Title = "-EXECUTING PROCEDURE: lobsmode." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBDPFLGS" , "0 , 0X20 , 1" ) !Title = "OBSERVING Mode & Continuum for AIR" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Cmd_data_i(0) = 0x0100 !Cmd_data_i(1) = 0x0100 !Cmd_data_i(2) = 0x0200 !Cmd_data_i(3) = 0x0200 !Cmd_data_i(4) = 0x0200 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 !Cmd_data_i(0) = 26 !Cmd_data_i(1) = 78 !Cmd_data_i(2) = 125 !Cmd_data_i(3) = 91 !Cmd_data_i(4) = 89 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 @WaitTime ( "00h00m45s" , *!S ) @PrintParam( "MKM1POS" , "REG" ) @PrintParam( "MKM2POS" , "REG" ) @PrintParam( "MKPAPOS" , "REG" ) @PrintParam( "MKC1POS" , "REG" ) @PrintParam( "MKC2POS" , "REG" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lobsmode." @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 ------------------------------------------------------------------------------<