--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_LRCONEMC , !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 : J.B.B --+------------------------------------------------------------------------+ --+ 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 : --+ ------------- --+ This Control File is part of MDI_ON. --+ --+ History : --+ --------- --+ Issue SIC Note Time Date Name / Updates --+ +---+ +------+ +---+ +------++--------------------------------------+ --+ 1/00 609 17:20 18/05/95 J.B.B -- Creation. --+ --+------------------------------------------------------------------------+ 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 Cfile PLM_LOBT , PLM_BLOCK , MDI_HR_SEL 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_LRCONEMC , Unique Defarg Str(80) !Proc_s Str(3) !Print = "yes" End Defarg Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = "" Int !Get_Reg = 0 Int !NbErr = 0 Main @OpenWindow() Select !Proc_s Case "lrconemc" @lrconemc() 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 lrconemc ( ) --. --. This procedure powers up the Redundant Power Converters on the --. PLM BUS B. --. --. This procedure powers up the DEP, Application Electronics, --. and High Rate Telemetry for Primary side operations. --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Get_Dig = "" Int !Get_Reg = 0 Int !NbErr = 0 Str(80) !Question = "" Real !Temp_r = 0.0 Main !Title = "-EXECUTING PROCEDURE: lrconemc." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand( "KNMPWBFN" , "" ) -- PLM BUS B, Nominal OFF Cmd. @WaitTime( "00h00m45s" , *!S ) !Get_Dig = Get( "MSPWB" ) If !Get_Dig <> "OFF" Then !Title = "*PLM BUS B NOT OFF!" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) -- Beep Halt !Title = "*Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If !Title = "'POWER OFF' verified." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @PrintAna ( "MIPWB" , "Redundant Side Current" ) !Title = "~Switch all Power Converters to BUS A" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ("MCALLOFR" , "") @WaitTime ( "00h00m02s" , *!S ) @SendCommand ("MCPC1AR" , "") @SendCommand ("MCPC2AR" , "") @WaitTime ( "00h00m02s" , *!S ) @SendCommand ("MCRC1AR" , "") @SendCommand ("MCRC2AR" , "") @WaitTime ( "00h00m45s" , *!S ) Expect "MSPC1N" , "A" , 1 Expect "MSPC2N" , "A" , 1 Expect "MSRC1N" , "A" , 1 Expect "MSRC2N" , "A" , 1 Enable "MSPC1N" Enable "MSPC2N" Enable "MSRC1N" Enable "MSRC2N" @CheckDig( "MSPC1N" , "= A" , *!NbErr ) @CheckDig( "MSPC2N" , "= A" , *!NbErr ) @CheckDig( "MSRC1N" , "= A" , *!NbErr ) @CheckDig( "MSRC2N" , "= A" , *!NbErr ) @SendCommand ( "KNMPWBNN" , "" ) -- PLM BUS B, Nominal ON Cmd. @WaitTime ( "00h00m45s" , *!S ) Expect "MSPWB" , "ON" , 1 Enable "MSPWB" !Title = "~Sending ALL OFF command." @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MSPWDPN" Inhibit "MSPWAEN" @SendCommand ("MCALLOFN" , "") @WaitTime ( "00h00m45s" , *!S ) Enable "MSPWDPN" Enable "MSPWAEN" @PrintAna ( "MIPWA" , "Nominal Side Current" ) !Title = "Verify that DEP and AE are OFF" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @CheckDig( "MSPWDPN" , "= OFF" , *!NbErr ) @CheckDig( "MSPWAEN" , "= OFF" , *!NbErr ) !Title = "~Switch Redundant Power Converter 2 to BUS A" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MSRC2N" @SendCommand ("MCRC2BN" , "") @WaitTime ( "00h00m45s" , *!S ) Expect "MSRC2N" , "B" , 1 Enable "MSRC2N" @PrintAna ( "MIPWA" , "Nominal Side Current" ) @CheckDig ( "MSRC2N" , "= A" , *!NbErr ) !Title = "~Switching ON DEP" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MSPWDPN" @SendCommand ("MCDPONN" , "") @WaitTime ( "00h00m45s" , *!S ) Expect "MSPWDPN" , "ON" , 1 Enable "MSPWDPN" @PrintAna ( "MIPWA" , "Nominal Side Current" ) @CheckDig ( "MSPWDPN", "= ON" , *!NbErr ) !Title = "~Switch ON AE and PRIME 160k Telem" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MSPWAEN" @SendCommand ( "MBPWAEON" , "" ) @WaitTime ( "00h00m45s" , *!S ) Expect "MSPWAEN" , "ON" , 1 Enable "MSPWAEN" @SendCommand ("MCDPRSTN" , "") @WaitTime ( "00h00m15s" , *!S ) @SendCommand ( "MBPWAEON" , "" ) @SendCommand ( "MBPWTM1O" , "" ) @WaitTime ( "00h00m15s" , *!S ) PERFORM PLM_LOBT , "MDI" @WaitTime ( "00h00m15s" , *!S ) @SendCommand ( "MBSHRS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBM1RS" , "" ) @SendCommand ( "MBM2RS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBPARS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBC1RS" , "" ) @SendCommand ( "MBC2RS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBFDRS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBAM1RS" , "" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBAM2RS" , "" ) @WaitTime ( "00h00m02s" , *!S ) !Title = "~Switch Red Power Conv 1 to BUS A" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MSRC1N" @SendCommand ( "MCRC1BN" , "") @WaitTime ( "00h00m45s" , *!S ) Expect "MSRC1N" , "B" , 1 Enable "MSRC1N" @PrintAna ( "MIPWA" , "Nominal Side Current" ) !Get_Reg = Get ( "MKDPSWPN") If !Get_Reg = 21 then @varcmd ( "MBDPML" , "0x1000 , 0x289a , 0x400" ) !Title = "~Patch to Enable HOC set point commands" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If !Title = "Inform MDI, 160k Data available" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "*Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Expect "MKPWAE" , "ON" , 1 Expect "MSTMSELN" , "1" , 1 Expect "MKTMSEL" , "1" , 1 Enable "MKPWAE" Enable "MSTMSELN" Enable "MKTMSEL" Limits "M+5PC1N" , 2 Limits "M+15PC1N" , 2 Limits "M-15PC1N" , 2 Limits "M+5PC2N" , 2 Limits "M+15PC2N" , 2 Limits "M-15PC2N" , 2 Enable "M+5PC1N" Enable "M+15PC1N" Enable "M-15PC1N" Enable "M+5PC2N" Enable "M+15PC2N" Enable "M-15PC2N" Limits "M+5IP" , 2 Limits "M+5CM" , 2 Limits "M+15CM" , 2 Limits "M-15CM" , 2 Limits "M+30CM" , 2 Limits "M+5AE" , 2 Limits "M+15AE" , 2 Limits "M-15AE" , 2 Limits "M+15MTR" , 2 Limits "M+15HTR" , 2 Limits "M+75LT" , 2 Enable "M+5IP" Enable "M+5CM" Enable "M+15CM" Enable "M-15CM" Enable "M+30CM" Enable "M+5AE" Enable "M+15AE" Enable "M-15AE" Enable "M+15MTR" Enable "M+15HTR" Enable "M+75LT" @CheckDig( "MSRC1N" , "= A" , *!NbErr ) !Title = "~Verify AE and Telemetry Select" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @CheckDig( "MSPWAEN" , "= ON" , *!NbErr ) @CheckDig( "MKPWAE" , "= ON" , *!NbErr ) @CheckDig( "MSTMSELN", "= 1" , *!NbErr ) @CheckDig( "MKTMSEL" , "= 1" , *!NbErr ) !Title = "~PLM monitored PWR CONV outputs" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @CheckAna( "M+5PC1N" , "> 4.5 and < 6.0" , *!NbErr ) @CheckAna( "M+15PC1N" , "> 14.0 and < 17.5" , *!NbErr ) @CheckAna( "M-15PC1N" , "> -16.0 and < -14.0" , *!NbErr ) @CheckAna( "M+5PC2N" , "> 4.5 and < 7.0" , *!NbErr ) @CheckAna( "M+15PC2N" , "> 14.0 and < 17.0" , *!NbErr ) @CheckAna( "M-15PC2N" , "> -16.0 and < -14.0" , *!NbErr ) !Title = "~Instrument monitored PWR CONV Outputs" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @CheckAna( "M+5IP" , "> 4.5 and < 6.0" , *!NbErr ) @CheckAna( "M+5CM" , "> 4.5 and < 6.0" , *!NbErr ) @CheckAna( "M+15CM" , "> 14.0 and < 17.0" , *!NbErr ) @CheckAna( "M-15CM" , "> -16.0 and < -14.0" , *!NbErr ) @CheckAna( "M+30CM" , "> 27.0 and < 38.0" , *!NbErr ) @CheckAna( "M+5AE" , "> 4.5 and < 6.0" , *!NbErr ) @CheckAna( "M+15AE" , "> 14.0 and < 17.0" , *!NbErr ) @CheckAna( "M-15AE" , "> -16.0 and < -14.0" , *!NbErr ) @CheckAna( "M+15MTR" , "> 14.0 and < 19.0" , *!NbErr ) @CheckAna( "M+15HTR" , "> 14.0 and < 19.0" , *!NbErr ) @CheckAna( "M+75LT" , "> 70.0 and < 80.0" , *!NbErr ) Limits "MIPWA" , 1 Limits "MIPWB" , 1 Enable "MIPWA" Enable "MIPWB" !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lrconsca." @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 ----------------------------------------------------------------------------------< Procedure varcmd( Str(10) !Cmd_name , Str(80) !Cmd_data ) Var Str(1) !Expt_s Int !Code_i Int !Cmd_data_i(30) Int !No_of_cmds_i Int !Data_len_i Str(10) !Data_item_s Int !Commas_i Int !Count Int !Char_pos Str(1) !Char Str(49) !Title = " " Str(80) !Cmd_data_s Str(80) !S = &80s("") Main !Expt_s = Extract( !Cmd_name , 1 , 1 ) If !Expt_s <> "M" Then !Title = "*ERROR: Non-MDI Command " + !Cmd_name @Message( "DC", "time", "MDI", " ", !Title , *!S) -- Beep Halt !Title = "+Operator CONTinue " @Message( "DC", "time", "MDI", " ", !Title , *!S) End If Select !Cmd_name Case "MBIPCMD" !Code_i = 0x0E !No_of_cmds_i = 0 Case "MBIPLDIN" !Code_i = 0x12 !No_of_cmds_i = 1 !Cmd_data_i(0) = 4 Case "MBDPML" !Code_i = 0x0A !No_of_cmds_i = 0 Case "MBDPCONF" !Code_i = 0x1D !No_of_cmds_i = 0 Default !Title = "*ERROR: Unrecognised Command " + !Cmd_name @Message( "DC", "time", "MDI", " ", !Title , *!S) -- Beep Halt !Title = "+Operator CONTinue " @Message( "DC", "time", "MDI", " ", !Title , *!S) Return End Select !Cmd_data_s = !Cmd_data + "," !Data_len_i = Len( !Cmd_data_s ) !Commas_i = 0 For !Char_pos = 1 to !Data_len_i !Char = Extract( !Cmd_data_s , !Char_pos , 1 ) If !Char = "," Then !Commas_i = !Commas_i + 1 End If End For For !Count = 1 To !Commas_i !Data_item_s = Splitstr( !Cmd_data_s , "," , !Count ) !Cmd_data_i( !No_of_cmds_i ) = Int( Val( !Data_item_s ) ) !No_of_cmds_i = !No_of_cmds_i + 1 End For PERFORM/NO PLM_BLOCK , "MDI" , !Code_i , !Cmd_data_i() , !No_of_cmds_i @WaitTime ("00h00m02s", *!S) Return End Procedure