--+------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_IMAGE , !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 : Alan TURK --+------------------------------------------------------------------------+ --+ 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 18:21 08/02/94 A.J. TURK -- Conversion from MDI language --+ 1/02 360 15:49 20/04/94 Ed COBB -- Rationalization --+ 1/03 393 15:02 16/05/94 Ed COBB -- MDI Updates --+ 2/01 479 20:01 20/09/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_Conf -- MDI Configuration Int !GM_NbErr -- MDI Global Error Count Int !GM_I0 Int !GM_I9 End Common -------------------------------------------------------------------------------< Extern Cfile MDI_MODE , PLM_BLOCK , MDI_LLT , MDI_DIST , MDI_LIP 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_IMAGE , 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() !GM_I0 = 16000 !GM_I9 = 20 Select !Proc_s Case "mdipict" @mdipict() Case "mdiltc" @mdiltc() Case "mdiiss" @mdiiss() 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 mdipict ( ) --. --. Takes pictures in all modes for contamination monitoring --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s("") Int !NbErr = 0 Str(80) !Question = "" Str(80) !Check = "" Str(80) !RS = "" Int !LMR_I = 0 Main !Title = "-EXECUTING PROCEDURE: mdipict" @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMSUMM" , "1 , 1" ) @SendCommand ( "MBIPLBIC" , "3 , 3" ) If !GM_Conf = 2 Then PERFORM/NO MDI_LIP , "liptlm2" , "no" End If @WaitTime ("00h00m15s",*!S) @SendCommand ( "MBCMHDR1" , "0X4040 , 0X4040 , 0 , 1 , 0" ) !Title = "~1024x1024 in FD & HR; OBS & CAL modes" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMAADC" , "3" ) !Title = "~CCD amplifier A, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !GM_I9 = 150 !GM_I0 = 32000 !Title = "Exposure time (ticks) = " + &d( !GM_I0 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Title = "Wait time (seconds) = " + &d( !GM_I9 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_MODE , "lobsmode" , "no" !Question = "MDI to Open Decom File" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) @SendCommand ( "MBCMTP1" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~OBS FD" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~OBS HR" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_MODE , "lcalmode" , "no" @SendCommand ( "MBCMTP1" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~CAL FD" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~CAL HR" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMDRK" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~Soft DARK" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMBADC" , "3" ) @WaitTime ( "00h00m02s" , *!S ) !Title = "~CCD amplifier B, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMDRK" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~Soft DARK" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 )) @WaitTime ( "00h02m30s" , *!S ) !Title = "~CAL HR" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMAADC" , "3" ) !Title = "~Set CCD amplifier back to A, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !GM_NbErr = !GM_NbErr + !NbErr !Question = "MDI to Close Decom File" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) !Title = "-FINISHED PROCEDURE: mdipict" @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure mdiltc ( ) --. --. Performs a light transfer set in HR CAL mode --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s("") Str(80) !Question = "" Str(80) !Check = "" Str(80) !RS = "" Int !LMR_I = 0 Int !NbErr = 0 Int !RI = 0 Int !LM_I0 = 0 Int !LM_I1 = 0 Int !LM_I2 = 0 Int !LM_I7 = 0 Main !Title = "-EXECUTING PROCEDURE: mdiltc." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMSUMM" , "1 , 1" ) @SendCommand ( "MBIPLBIC" , "4 , 4" ) If !GM_Conf = 2 Then PERFORM/NO MDI_LIP , "liptlm2" , "no" End If @WaitTime ("00h00m15s",*!S) @SendCommand ( "MBCMHDR1" , "0X4040 , 0X4040 , 0 , 1 , 0" ) !Title = "Central 256x256, exp.time + 4 secs in HR CAL" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !LM_I0 = 120 !LM_I1 = 60000 !LM_I2 = !LM_I1 - !LM_I0 @SendCommand ( "MBCMAADC" , "3" ) !Title = "CCD amplifier A, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_MODE , "lcalmode" , "no" !Question = "MDI to Open Decom File" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) For !LM_I7 = 0 to 1 If !LM_I7 > 0 Then @SendCommand ( "MBCMBADC" , "3" ) !Title = "CCD amplifier B, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If !GM_I0 = !LM_I0 !Title = "Exposure pairs (ticks) = " + &d( !GM_I0 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) !GM_I0 = !LM_I2 / 4 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) !GM_I0 = !LM_I2 / 8 !GM_I0 = !GM_I0 * 3 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) !GM_I0 = !LM_I2 / 2 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) !GM_I0 = !LM_I2 / 3 !GM_I0 = !GM_I0 * 2 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m15s" , *!S ) !GM_I0 = !LM_I2 / 4 !GM_I0 = !GM_I0 * 3 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) !GM_I0 = !LM_I2 / 20 !GM_I0 = !GM_I0 * 17 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) !GM_I0 = !LM_I2 / 10 !GM_I0 = !GM_I0 * 9 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) !GM_I0 = !LM_I2 / 20 !GM_I0 = !GM_I0 * 19 !GM_I0 = !LM_I0 + !GM_I0 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) !GM_I0 = !LM_I1 @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) @SendCommand ("MBCMTP3", "0 , " + &d(!GM_I0) + " , " + &d(!GM_I0)) @WaitTime ("00h00m25s" , *!S ) !Title = "SOFT dark pairs (ticks) = 120" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMDRK" , "0 , 120 , 120" ) @WaitTime ( "00h00m15s" , *!S ) @SendCommand ( "MBCMDRK" , "0 , 120 , 120" ) @WaitTime ( "00h00m15s" , *!S ) !Title = "SOFT dark pairs (ticks) = 40000" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMDRK" , "0 , 40000 , 40000" ) @WaitTime ( "00h00m25s" , *!S ) @SendCommand ( "MBCMDRK" , "0 , 40000 , 40000" ) @WaitTime ( "00h00m25s" , *!S ) End For @SendCommand ( "MBCMAADC" , "3" ) !Title = "~Set CCD amplifier back to A, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Question = "MDI to Close Decom File" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: mdiltc." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure mdiiss ( ) --. --. Checks ISS performance vs. input jiggle --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s("") Int !NbErr = 0 Str(80) !Question = "" Str(80) !Check = "" Str( 3) !RS = " " Main !Title = "-EXECUTING PROCEDURE: mdiiss." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMAADC" , "3" ) !Title = "~CCD amplifier A, offset: 3" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !GM_I0 = 16000 !GM_I9 = 30 !Title = "Exposure time (ticks) = " + &d( !GM_I0 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Title = "Wait time (seconds) = " + &d( !GM_I9 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Question = "Jitterer set up, ISS locked (Y/N)?" !Check = "in Y, y, N, n" @AskStr (!Question, !Check, *!RS, *!S, *!NbErr) @Upper (!RS, *!RS) PERFORM/NO MDI_MODE , "lobsmode" , "no" If !RS <> "Y" Then PERFORM/NO MDI_LLT, "llton" !Title = "Setup jitter mirror" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Align crosshair in FOV" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt PERFORM/NO MDI_LLT , "lltcntr" , "no" !Title = "IF OK, then CLOSE THE LOOP" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If @SendCommand ( "MBCMSUMM" , "1 , 1" ) @SendCommand ( "MBIPLBIC" , "4 , 4" ) @WaitTime ( "00h00m15s" , *!S ) If !GM_Conf = 2 Then PERFORM/NO MDI_LIP , "liptlm2" , "no" End If @WaitTime ("00h00m15s",*!S) @SendCommand ( "MBCMHDR1" , "0X4040 , 0X4040 , 0 , 1 , 0" ) !Title = "~Central 256x256 in HI-REZ mode" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Question = "MDI to Open Decom File (Y/N)" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, NO disturbance" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, NO disturbance" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 100v at 1Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 100 V at 1 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45" , *!S ) !Title = "~CLOSED loop, 100 V at 1 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 400v at 1Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 400 V at 1 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 400 V at 1 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 1000v at 1Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 1000 V at 1 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 1000 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 1000v at 10Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 1000 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 1000 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 400v at 10Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 400 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 400 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 100v at 10Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 100 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 100 V at 10 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 100v at 45Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 100 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 100 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 400v at 45Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 400 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 400 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 1000v at 45Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 1000 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 1000 V at 45 Hz" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 1000v at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 1000 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 1000 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 400v at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 400 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTCLSL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 400 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "Input 100v at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "Operator CONTinue" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMTP3" , "0 , 1 , " + &d(!GM_I0)) @WaitTime ( "00h00m45s" , *!S ) !Title = "~CLOSED loop, 100 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" @SendCommand ( "MBLTOPNL" , "" ) @SendCommand ( "MBCMTP3" , "0 , 0 , " + &d( !GM_I0 ) ) @WaitTime ( "00h00m45s" , *!S ) !Title = "~OPEN loop, 100 V at RANDOM" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "lltprn1" , "no" !Title = "~Soft DARK" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBCMDRK" , "0 , " + &d( !GM_I0 ) + " , " + &d( !GM_I0 ) ) @WaitTime ( "00h00m15s" , *!S ) !Question = "MDI to Close Decom File (Y/N)" !Check = "Y,y,N,n" @AskStr ( !Question , "??" , *!RS , *!S , *!NbErr ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: mdiiss." @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) -- Beep 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 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 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 Time_To_Text (Int !Stime, Str(10) *!Text) --. Convert a time passed in seconds to a string as "hh:mn:ss". --. The number of hours is limited to 999 with no error reported. Var Int !hour = 0 Int !minute = 0 Int !second = 0 Main CALL Hh_mn_ss(!Stime, *!hour, *!minute, *!second) !Text = &02d(!hour) + "h" + &02d(!minute)+ "m"+ &02d(!second) +"s" Return End Procedure ------------------------------------------------------------------------------------- Procedure Hh_mn_ss(Int !STime, Int *!hour, Int *!minute, Int *!second) --. Compute and return the number of hour, minute and second from an interger number --. of seconds. Var Int !Tmp Main !Tmp = !STime !hour = !Tmp / 3600 !Tmp = !Tmp Mod 3600 !minute = !Tmp / 60 !second = !Tmp Mod 60 Return End Procedure -------------------------------------------------------------------------------------