--+------------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ Name : MDI_EMI , !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 : Ph. IATRINO --+------------------------------------------------------------------------------+ --+ 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_EMC_ON must has been successfully performed. --+ --+ History : --+ ------- --+ Issue SIC Note Time Date Name/Updates --+ +---+ +------+ +---+ +------+ +-------------------------------------------+ --+ 1/00 597 19:29 10/05/95 Ph. IATRINO -- Creation for EMC. --+ 1/01 597 16:17 11/05/95 J.B.B. -- Updates for EMC. --+ 1/02 597 10:37 12/05/95 J.B.B. -- Updates for EMC. --+ 1/03 597 12:17 12/05/95 J.B.B. -- Updates for EMC. --+ 1/04 597 15:37 12/05/95 J.B.B. -- Updates for EMC. --+ 1/05 597 16:10 12/05/95 J.B.B. -- Updates for EMC. --+ --+------------------------------------------------------------------------------+ 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 End Common ---------------------------------------------------------------------------------+ Extern Cfile PLM_BLOCK Procedure PrintAna , PrintDig , PrintReg , PrintParam Procedure WaitAna , WaitDig , WaitReg , WaitTime Procedure DispMess , ExitCF , Message , OpenWindow Procedure CheckArgReal, CheckArgStr , CheckArgInt Procedure AskReal , AskStr , AskInt Procedure CheckAna , CheckDig , CheckReg Procedure ExConnect , ExDisconnect Procedure Lower , Upper Procedure SendCommand End Extern ---------------------------------------------------------------------------------+ Program MDI_EMI , Unique Defarg Str(80) !Proc_s Str(3) !Print = "yes" End Defarg Var Str( 3) !ExpName = "MDI" Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Main @OpenWindow() Select !Proc_s Case "compress" @compress() Case "emipict1" @emipict1() Case "emipict2" @emipict2() Case "emiextract" @emiextract() Case "moveemi1" @moveemi1() Case "moveemi2" @moveemi2() Case "stopemi1" @stopemi1() Case "stopemi2" @stopemi2() Default !Title = "*ERROR: UNKNOWN PROCEDURE: "+!Proc_s @Message ("DCL", "date", !ExpName, " ", !Title, *!S) Halt !Title = "*Operator CONTinue" @Message ("DC", "date", !ExpName, " ", !Title, *!S) Return !Rstat End Select @ExitCF (!NbErr) @PrintCF (!ExpName, !Print) Return !Rstat End Program ---------------------------------------------------------------------------------+ Procedure compress () --. Loads IP program which wiil downlink 10 images in compressed mode. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Main !Title = "-EXECUTING PROCEDURE: compress." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBIPCMD", "0x0091, 0x0100, 0x0140, 0x0FFF, 0x0800") @varcmd ("MBIPCMD", "0x0091, 0x0103, 0x0140, 0x00F0, 0x0514") @varcmd ("MBIPCMD", "0x0091, 0x0106, 0x0142, 0x00F1, 0x0FFE") @varcmd ("MBIPCMD", "0x0091, 0x0109, 0x0140, 0x00F2, 0x0226") @varcmd ("MBIPCMD", "0x0091, 0x010C, 0x0140, 0x00F3, 0x5000") @varcmd ("MBIPCMD", "0x0091, 0x010F, 0x0140, 0x00F4, 0x03FF") @varcmd ("MBIPCMD", "0x0091, 0x0112, 0x0140, 0x00F5, 0x0000") @WaitTime ("00h00m15s",*!S) @varcmd ("MBIPCMD", "0x0091, 0x0115, 0x0142, 0x00F0, 0x00F8") @varcmd ("MBIPCMD", "0x0091, 0x0118, 0x0142, 0x00F1, 0x00F9") @varcmd ("MBIPCMD", "0x0091, 0x011B, 0x0140, 0x00FA, 0x0000") @varcmd ("MBIPCMD", "0x0091, 0x011E, 0x0140, 0x00FB, 0x6000") @varcmd ("MBIPCMD", "0x0091, 0x0121, 0x0140, 0x00FC, 0x050B") @varcmd ("MBIPCMD", "0x0091, 0x0124, 0x0140, 0x00FD, 0x0000") @varcmd ("MBIPCMD", "0x0091, 0x0127, 0x0166, 0x00F8") @WaitTime ("00h00m15s",*!S) @varcmd ("MBIPCMD", "0x0091, 0x0129, 0x0140, 0x00FF, 0x0400") @varcmd ("MBIPCMD", "0x0091, 0x012C, 0x0140, 0x00FE, 0xFFFF") @varcmd ("MBIPCMD", "0x0091, 0x012F, 0x0140, 0x0104, 0x0010") @varcmd ("MBIPCMD", "0x0091, 0x0132, 0x0140, 0x0105, 0x0000") @varcmd ("MBIPCMD", "0x0091, 0x0135, 0x0140, 0x0100, 0x0000") @varcmd ("MBIPCMD", "0x0091, 0x0138, 0x0166, 0x00F0") @varcmd ("MBIPCMD", "0x0091, 0x013A, 0x0148, 0x00F0, 0x0104, 0x00F0") @WaitTime ("00h00m15s",*!S) @varcmd ("MBIPCMD", "0x0091, 0x013E, 0x0146, 0x00FF, 0x00FE, 0x00FF") @varcmd ("MBIPCMD", "0x0091, 0x0142, 0x015A, 0x00FF, 0x0148") @varcmd ("MBIPCMD", "0x0091, 0x0145, 0x015A, 0x0100, 0x0138") @varcmd ("MBIPCMD", "0x91,0x148,0x1B2,0x110,0x6," + \ "1,0x6000,0x5000,0xC4,0xFFFF,0xFF84") @varcmd ("MBIPCMD", "0x0091, 0x0151, 0x019C, 0x0110") @WaitTime ("00h00m15s",*!S) @varcmd ("MBIPCMD", "0x91 , 0x0153, 0x01B2, 0x0116, 0x0002, " + \ "0x0225, 0x0010") @varcmd ("MBIPCMD", "0x0091, 0x0158, 0x0174, 0x0021, 0x5000, 0x0116") @varcmd ("MBIPCMD", "0x0091, 0x015C, 0x0142, 0x0FFE, 0x00F1") @varcmd ("MBIPCMD", "0x0091, 0x015F, 0x0146, 0x00F1, 0x0FFF, 0x00F1") @varcmd ("MBIPCMD", "0x0091, 0x0163, 0x01FC") @varcmd ("MBIPLDIN", "0x0136") @WaitTime ("00h00m15s",*!S) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: compress." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure emipict1 () --. Takes shortest exposure images and downlinks 256 extract from first corner. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Response = " " Str(80) !Check = " " Int !NbErr = 0 Int !LM_I0 = 0 Main !Title = "-EXECUTING PROCEDURE: emipict1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @SendCommand ("MBCMSUMM", "1, 1") @emiextract () !Question = "MDI to Open Decom File (DONE/done)" !Check = "in DONE, done" @AskStr (!Question, !Check, *!Response, *!S, *!NbErr) @SendCommand ("MBCMHDR1" , "0x4040, 0x4040, 0, 1, 0") For !LM_I0 = 0 to 60 @SendCommand ("MBCMTP3" , "0, 40, 40") @WaitTime ("00h00m07s", *!S) End For !Question = "MDI to Close Decom File (DONE/done)" !Check = "in DONE, done" @AskStr (!Question, !Check, *!Response, *!S, *!NbErr) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: emipict1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure emipict2 () --. Takes shortest exposure images quickly 10 in a row and downlinks compressed. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Response = " " Str(80) !Check = " " Int !NbErr = 0 Int !LM_I0 = 0 Main !Title = "-EXECUTING PROCEDURE: emipict2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @SendCommand ("MBCMSUMM", "1, 1") @compress () !Title = "Take rapidly 10 full 1024^2 with shortest expo." @Message ("DC", "date", !ExpName, !Phase, !Title, *!S) !Question = "MDI to Open Decom File (DONE/done)" !Check = "in DONE, done" @AskStr (!Question, !Check, *!Response, *!S, *!NbErr) @SendCommand ("MBCMHDR1" , "0x4040, 0x4040, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4141, 0x4141, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4242, 0x4242, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4343, 0x4343, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4444, 0x4444, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4545, 0x4545, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4646, 0x4646, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4747, 0x4747, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4848, 0x4848, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) @SendCommand ("MBCMHDR1" , "0x4949, 0x4949, 0, 0, 0") @SendCommand ("MBCMTP3","0,40,40") @WaitTime ("00h00m10s", *!S) !Title = "Downlink the 10 images compressed" @Message ("DC", "date", !ExpName, !Phase, !Title, *!S) @WaitTime ("00h00m05s", *!S) @varcmd ("MBIPLDIN", "0x0140, 241, 0") For !LM_I0 = 0 to 10 @varcmd ("MBIPLDIN" , "0x0152, 0x0100") @WaitTime ("00h01m00s", *!S) End For !Question = "MDI to Close Decom File (DONE/done)" !Check = "in DONE, done" @AskStr (!Question, !Check, *!Response, *!S, *!NbErr) @SendCommand ("MBCMHDR1" , "0x4040, 0x4040, 0, 1, 0") !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: emipict2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure emiextract () --. Loads IP program to extract first octant 256^2 from full frame. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Main !Title = "-EXECUTING PROCEDURE: emiextract." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBIPLDIN", "0x0154") @varcmd ("MBIPCMD" , "0x0091, 0x0000, 0x0100") @varcmd ("MBIPCMD" , "0x0091, 0x0100, 0x01B2, 0x00A8, 0x0002, 0x0000, 0x0000") @varcmd ("MBIPCMD" , "0x91,0x105,0x1B2,0xB0,0x8,0x514," + \ "0x0,0x226,0x4000,0x100,0x100,0x410,0xA8") @WaitTime ("00h00m10s",*!S) @varcmd ("MBIPCMD" , "0x0091, 0x0110, 0x01B2, 0x00B8, 0x0002, 0x0000, 0x0001") @varcmd ("MBIPCMD" , "0x91,0x115,0x1B2,0xBA,0x6,0x0,0x0,0x4000,0x0,0xFFFF,0xFF16") @varcmd ("MBIPCMD" , "0x0091, 0x011E, 0x017A, 0x00B0") @WaitTime ("00h00m10s",*!S) @varcmd ("MBIPCMD" , "0x0091, 0x0120, 0x0186, 0x0134, 0x0000, 0x000C") @varcmd ("MBIPCMD" , "0x0091, 0x0124, 0x019C, 0x00BA") @varcmd ("MBIPCMD" , "0x0091, 0x0126, 0x0174, 0x0003, 0x4000, 0x00B8") @varcmd ("MBIPCMD" , "0x0091, 0x012A, 0x01FC") @varcmd ("MBIPLDIN", "0x0136") @WaitTime ("00h00m15s", *!S) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: emiextract." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure moveemi1 () --. Patches standard sequence to move PAW wheel again. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Main !Title = "-EXECUTING PROCEDURE: moveemi1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBDPML", "0x1000, 0x3EEE, 0x417F") !Title = "-FINISHED PROCEDURE: moveemi1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure moveemi2 () --. Patches the emi2 sequence to move PAW wheel again. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Main !Title = "-EXECUTING PROCEDURE: moveemi2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBDPML", "0x1000, 0x0C80, 0x36AA") @varcmd ("MBDPML", "0x1000, 0x0C84, 0x12AA") !Title = "-FINISHED PROCEDURE: moveemi2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure stopemi1 () --. Patches standard sequence to not move PAW wheel. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Main !Title = "-EXECUTING PROCEDURE: stopemi1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBDPML", "0x1000, 0x3EEE, 0x0000") !Title = "-FINISHED PROCEDURE: stopemi1." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) Return End Procedure ---------------------------------------------------------------------------------+ Procedure stopemi2 () --. Patches the emi2 sequence to not move PAW wheel. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Main !Title = "-EXECUTING PROCEDURE: stopemi2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) @varcmd ("MBDPML", "0x1000, 0x0C80, 0x36EA") @varcmd ("MBDPML", "0x1000, 0x0C84, 0x12EA") !Title = "-FINISHED PROCEDURE: stopemi2." @Message ("DCL", "date", !ExpName, !Phase, !Title, *!S) 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) Halt !Title = "+Operator CONTinue " @Message( "DC", "time", "MDI", " ", !Title , *!S) Return 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 Default !Title = "*ERROR: Unrecognised Command " + !Cmd_name @Message ("DC", "time", "MDI", " ", !Title , *!S) 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 ---------------------------------------------------------------------------------+ 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 ---------------------------------------------------------------------------------