--+----------------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_JT , !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 : JBB --+----------------------------------------------------------------------------------+ --+ 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 --+ +---+ +------+ +---+ +------+ +------------------------------------------------+ --+ ???? ??? 08:57 26/01/95 M.Levay(LPARL) -- Jitter Test Procedures --+ ???? ??? 10:59 01/02/95 C.Edwards(LPARL) -- "extract from MDI_LLT" --+ 1/01 544 20:12 01/02/95 Ph. IATRINO -- MDI Updates for New On Board S/W. --+ 1/01 545 12:00 03/02/95 Ph. IATRINO -- MDI Updates for New On Board S/W. --+ --+----------------------------------------------------------------------------------+ 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 Int !GM_Interrupt -- MDI Interrupt Global (1 | 0) Int !GM_I0 Int !GM_I9 Str(80) !GM_S7 Str(80) !GM_Display End Common -------------------------------------------------------------------------------------+ Extern Cfile MDI_MODE, MDI_SW1X1S, MDI_LAM , MDI_INTRRPT, MDI_LFD , PLM_BLOCK Cfile MDI_LIP , MDI_IP , MDI_LLT , MDI_IMAGE Group MWTM , PWP12TM Procedure AskReal , AskStr , AskInt Procedure CheckAna , CheckDig , CheckReg Procedure CheckArgReal, CheckArgStr, CheckArgInt Procedure DispMess , Message Procedure ExConnect , ExDisconnect Procedure OpenWindow , ExitCF Procedure WaitAna , WaitDig , WaitReg , WaitTime Procedure PrintAna , PrintDig , PrintReg , PrintParam Procedure SendCommand Procedure Lower , Upper End Extern -------------------------------------------------------------------------------------+ Program MDI_JT , 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 = "" Str(80) !Check = "" Int !NbErr = 0 Main @OpenWindow() Select !Proc_s Case "jtcal1" @jtcal1() Case "jtcal2" @jtcal2() Case "jtinit" @jtinit() Case "jtdata" @jtdata() Case "jtnormal" @jtnormal() Case "jtptinit" @jtptinit() Case "jtpict" @jtpict() 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 jtinit ( ) --. --. This procedure initializes the DEP and IP for taking jitter test data --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(10) !Time = " " Main !Title = "-EXECUTING PROCEDURE: jtinit." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ("MBPWIPON","") @SendCommand ("MBIPRSAL","") PERFORM/NO MDI_IP,"ipwload","no" -- Load the queue with the ISS data program @varcmd ("MBIPLDIN","0x154") @varcmd ("MBIPCMD","0x91,0,256") @varcmd ("MBIPMACL","400,0x1B2,512,6,1,0,0x4000,0,0xFFFF,0xFF30") @varcmd ("MBIPMACL","9999,0x1B2,518,2,32219,0") @varcmd ("MBIPMACL","9999,0x19C,512,0x174,3,0x4000,518,0x1FC") @varcmd ("MBIPLDIN","0x16C,0,0x4000,33000,0,1") @varcmd ("MBIPCMD","0x32,0x8000,0") @varcmd ("MBIPLDIN","0x160,0,0x4000,32768,0") @varcmd ("MBIPCMD","0x32,0,0") @varcmd ("MBIPLDIN","0x160,0,0x4000,32768,0") @varcmd ("MBIPLDIN","0x16C,0,0,40,0,0") @varcmd ("MBIPLDIN","0x1B2,512,2,0x2049,0x5353") @varcmd ("MBIPLDIN","0x14A,512,2,37,0") @SendCommand ("MBDPFLGS","11,0xFFFF,400") @varcmd("MBIPMACL","0x100,0x1B2,0x338,11,0,0,0,0x800,0,0x1000," + \ "0x6590,0x10,1,0xFFFF,0x10") @varcmd("MBIPMACL","9999,0x1E0,0x338") @varcmd("MBIPMACL","9999,0x1B2,0x32B,8,0x1E94,0x1006," + \ "0x226,0x4000,0x100,0x100,0x410,69") @varcmd("MBIPMACL","9999,0x17A,0x32B") @varcmd("MBIPMACL","9999,0x1B2,0x200,6,1,0,0x4000,0,0xFFFF,0xFF03") @varcmd("MBIPMACL","9999,0x19C,512,0x1B2,518,2,0,1") @varcmd("MBIPMACL","9999,0x174,3,0x4000,518,0x1FC") @varcmd("MBIPLDIN","0x136") @varcmd("MBIPLDIN","0x1B2,69,2,0,0") @SendCommand("MBCMHDR1","0x4141,0x4141,0,0,0") @SendCommand("MBCMDRK","0,0,16000") @WaitTime("00h00m15s",*!S) @SendCommand("MBCMHDR1","0x4040,0x4040,0,1,0") @SendCommand("MBCMDRK","0xC023,16000,16000") @WaitTime("00h00m15s",*!S) !Title = "-FINISHED PROCEDURE: jtinit." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtdata ( ) --. --. This procedure starts jitter test data taking --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Int !LM_I1 = 0 Main !Title = "-EXECUTING PROCEDURE: jtdata." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Question = "Zero Error Signals?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then PERFORM/NO MDI_LLT , "lltcntr","no" @jtinit () End If !Question = "Set X and Y Gains?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then !Question = "Enter the X Gain" !Check = ">= 0 and <= 255" @AskInt(!Question,!Check,*!LM_I1,*!S,*!NbErr) @SendCommand ("MBLTXGN",&d(!LM_I1) ) !Question = "Enter the Y Gain" !Check = ">= 0 and <= 255" @AskInt(!Question,!Check,*!LM_I1,*!S,*!NbErr) @SendCommand ("MBLTYGN",&d(!LM_I1) ) End If !Question = "MDI to Open Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) @SendCommand ("MBDPMOD","4") !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtdata." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtnormal ( ) --. --. This procedure sets the DEP/IP back to normal mode --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Int !LM_I1 = 0 Main !Title = "-EXECUTING PROCEDURE: jtnormal." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @SendCommand ("MBDPMOD","1") @WaitTime("00h00m15s",*!S) @SendCommand ("MBPWIPON","") !Question = "MDI to Close Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtnormal." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtptinit ( ) --. --. This procedure initializes DEP/IP for picture taking --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Int !LM_I1 = 0 Main !Title = "-EXECUTING PROCEDURE: jtptinit." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !GM_I0 = 16000 !GM_I9 = 15 @SendCommand("MBDPMOD","1") @SendCommand("MBCMSUMM","1,1") @SendCommand("MBCMAADC","3") !Question = "MDI to Open Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) -- Perform/No MDI_LEXPSET,"lexpset","NO" @varcmd("MBIPLDIN","0x1B2,69,2,0,0") @SendCommand ("MBCMHDR1","0x4141,0x4141,0,0,0") @SendCommand ("MBCMDRK","0,0," + &d(!GM_I0)) @Time_to_Text (!GM_I9,*!Time) @WaitTime(!Time,*!S) @SendCommand ("MBCMHDR1","0x4040,0x4040,0,1,0") @SendCommand ("MBCMTP3R","0xC023," + &d(!GM_I0) + "," + &d(!GM_I0)) @Time_to_Text (!GM_I9,*!Time) @WaitTime(!Time,*!S) !Question = "Ask MDI and enter 0=OK, 1=X, 2=Y, 3=Both" !Check = "in 0,1,2,3" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) If !LM_S1 = "1" then @varcmd ("MBIPLDIN","0x1B2,69,2,0x800,2") End If If !LM_S1 = "2" then @varcmd ("MBIPLDIN","0x1B2,69,2,128,0") End If If !LM_S1 = "3" then @varcmd ("MBIPLDIN","0x1B2,69,2,0x880,2") End If @SendCommand ("MBCMTP3R","0xC023," + &d(!GM_I0) + "," + &d(!GM_I0)) @Time_to_Text (!GM_I9,*!Time) @WaitTime(!Time,*!S) !Question = "MDI to Close Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtptinit." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtpict ( ) --. --. This procedure take 2 or 4 pictures to support jitter tests --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Str(80) !LM_S2 = " " Int !LM_I1 = 0 Main !Title = "-EXECUTING PROCEDURE: jtpict." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !GM_I0 =16000 !GM_I9 = 15 !Question = "MDI to Open Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) @SendCommand ("MBCMHDR1","0x4040,0x4040,0,1,0") @SendCommand ("MBCMTP3R","0xC023," + &d(!GM_I0) + "," + &d(!GM_I0)) @Time_to_Text (!GM_I9,*!Time) @WaitTime(!Time,*!S) @SendCommand ("MBCMTP3R","0xC023," + &d(!GM_I0) + "," + &d(!GM_I0)) @Time_to_Text (!GM_I9,*!Time) @WaitTime(!Time,*!S) !Question = "MDI to Close Decom File" !Check = "in DONE, done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtpict." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtcal1 ( ) --. --. This procedure performs the one time gain calibration for the jitter test --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Str(80) !LM_S2 = " " Int !LM_I1 = 0 Main !Title = "-EXECUTING PROCEDURE: jtcal1." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "llton" , "no" @SendCommand("MBCMSUMM","1,1") @SendCommand("MBCMHDR1","0x4040,0x4040,0,1,0") @SendCommand("MBCMAADC","3") -- Perform/No MDI_LEXPSET,"lexpset","NO" !Question="Ask MDI ... to note Stimulus Lamp Voltage" !Check="in DONE,done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) !Question = "Zero Error Signals?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then PERFORM MDI_LLT , "lltcntr" ,"no" @jtinit () End If @SendCommand("MBLTYOFS","0") @cala1("MBLTXOFS","MKLTXOFS",0) @cala1("MBLTXOFS","MKLTXOFS",6) @cala1("MBLTXOFS","MKLTXOFS",250) @SendCommand("MBLTCOAR","") @cala1("MBLTXOFS","MKLTXOFS",0) @cala1("MBLTXOFS","MKLTXOFS",3) @cala1("MBLTXOFS","MKLTXOFS",253) @SendCommand("MBLTFINE","") @SendCommand("MBLTXOFS","0") @cala1("MBLTYOFS","MKLTYOFS",0) @cala1("MBLTYOFS","MKLTYOFS",6) @cala1("MBLTYOFS","MKLTYOFS",250) @SendCommand("MBLTCOAR","") @cala1("MBLTYOFS","MKLTYOFS",0) @cala1("MBLTYOFS","MKLTYOFS",3) @cala1("MBLTYOFS","MKLTYOFS",253) @SendCommand("MBLTYOFS","0") @SendCommand("MBLTFINE","") @WaitTime("00h00m30s",*!S) @jtinit() @jtdata() !Question = "Begin Gain Calibration A2. Signal Generator to freq 1" @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") !Question = "Closed Loop" @SendCommand ("MBLTCLSL","") @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") !Question = "Open Loop. Signal Generator to freq 2" @SendCommand ("MBLTOPNL","") @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") !Question = "Closed Loop" @SendCommand ("MBLTCLSL","") @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") !Question = "Open Loop. Signal Generator to freq 3" @SendCommand ("MBLTOPNL","") @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") !Question = "Closed Loop" @SendCommand ("MBLTCLSL","") @cala2 (!Question,"MBLTXGN","MBLTYGN","MKLTXGN") @SendCommand("MBLTXGN","0x40") @SendCommand("MBLTYGN","0x40") @SendCommand ("MBLTOPNL","") @WaitTime("00h00m15s",*!S) @jtnormal() --. Done with Gain Calibration A2 !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtcal1." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure jtcal2 ( ) --. --. This procedure performs the daily calibration for the jitter test --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Str(80) !Question = " " Str(80) !Check = " " Int !NbErr = 0 Str(10) !Time = " " Str(80) !LM_S1 = " " Str(80) !LM_S2 = " " Int !LM_I1 = 0 Int !LM_O1 = 0 Int !LM_O2 = 0 Main !Title = "-EXECUTING PROCEDURE: jtcal2." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LLT , "llton" ,"no" @SendCommand("MBCMSUMM","1,1") @SendCommand("MBCMHDR1","0x4040,0x4040,0,1,0") @SendCommand("MBCMAADC","3") !Question="Ask MDI ... to note Stimulus Lamp Voltage" !Check="in DONE,done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) @jtinit () !Question = "Zero Error Signals?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then PERFORM MDI_LLT , "lltcntr" , "no" @jtinit () End If @jtptinit() !Question = "Begin Disturbance Mirror Cal B1, Set Mirror to 0V" @calb1 (!Question) !Question = "Write down 0V data, Set Mirror to 250V" @calb1 (!Question) !Question = "Write down 250V data, Set Mirror to 500V" @calb1 (!Question) !Question = "Write down 500V data, Set Mirror to 750V" @calb1 (!Question) !Question = "Write down 750V data, Set Mirror to 1000V" @calb1 (!Question) !Question = "Write down 1000V data, Set Mirror to 500V" !Check="in DONE,done" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) --. Done with Gain Calibration B1 DO !Question = "Zero Error Signals?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then PERFORM MDI_LLT , "lltcntr" ,"no" @jtinit () End If @jtptinit() @SendCommand("MBLTCLSL", "") !Question = "Ask MDI - is the loop properly closed ?" !Check="in Y,N,y,n" @AskStr (!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) EXIT IF (!LM_S1 = "Y") END DO !LM_O1 = Get("MKLTXOFS") !LM_O1 = !LM_O1 - 256 !LM_O2 = !LM_O1 Andb 0x00FF @cala1("MBLTXOFS","MKLTXOFS",!LM_O2) @jtpict() !LM_O2 = (!LM_O1 + 6) Andb 0x00FF @cala1("MBLTXOFS","MKLTXOFS",!LM_O2) @jtpict() !LM_O2 = (!LM_O1 - 6) Andb 0x00FF @cala1("MBLTXOFS","MKLTXOFS",!LM_O2) @jtpict() !LM_O2 = !LM_O1 Andb 0x00FF @cala1("MBLTXOFS","MKLTXOFS",!LM_O2) !LM_O1 = Get("MKLTYOFS") !LM_O2 = !LM_O1 - 256 !LM_O2 = !LM_O1 Andb 0x00FF PERFORM MDI_LLT , "lltprn1" ,"no" @jtpict() !LM_O2 = (!LM_O1 + 6) Andb 0x00FF @cala1("MBLTYOFS","MKLTYOFS",!LM_O2) @jtpict() !LM_O2 = (!LM_O1 - 6) Andb 0x00FF @cala1("MBLTYOFS","MKLTYOFS",!LM_O2) @jtpict() @SendCommand("MBLTYOFS", &d(!LM_O1)) @SendCommand("MBLTOPNL", "") --. Done with Gain Calibration B2 !Question = "Zero Error Signals?" !Check = "in Y,N,y,n" @AskStr(!Question,!Check,*!LM_S1,*!S,*!NbErr) @Upper(!LM_S1,*!LM_S1) If (!LM_S1 = "Y") Then PERFORM MDI_LLT , "lltcntr" ,"no" @jtinit () End If @jtdata() For !LM_I1 = 1 to 6 !Question = "Enter the X Gain" !Check = ">= 0 and <= 255" @AskInt(!Question,!Check,*!LM_I1,*!S,*!NbErr) @SendCommand("MBLTOPNL", "") @SendCommand ("MBLTXGN",&d(!LM_I1) ) !Question = "Enter the Y Gain" !Check = ">= 0 and <= 255" @AskInt(!Question,!Check,*!LM_I1,*!S,*!NbErr) @SendCommand ("MBLTYGN",&d(!LM_I1) ) @SendCommand("MBLTCLSL", "") @WaitTime("00h00m16s",*!S) End For @SendCommand("MBLTXGN","0x40") @SendCommand("MBLTYGN","0x40") @WaitTime("00h00m16s",*!S) @jtnormal() @SendCommand("MBLTOPNL", "") !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: jtcal2." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------------+ Procedure calb1 (str(80) !Quest) --. Do a repetitive part of calibration b1 Var Str(80) !Check = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_int = 0 Str(80) !LM_S1 = " " Main !Check="in DONE,done" @AskStr (!Quest,!Check,*!LM_S1,*!S,*!NbErr) @WaitTime("00h00m15s",*!S) PERFORM/NO MDI_LLT , "lltprn1" ,"no" @jtpict() Return End Procedure -------------------------------------------------------------------------------------+ Procedure cala1 (str(8) !Cmd, str(8) !Monitor, int !offs) --. Do a repetitive part of calibration A1 Var Str(80) !S = &80s(" ") Int !Get_int = 0 Main @SendCommand(!Cmd,&d(!offs)) DO @WaitTime("00h00m08s",*!S) !Get_int = Get(!Monitor) EXIT IF (!offs = !Get_int) END DO @WaitTime ("00h00m15s",*!S) PERFORM/NO MDI_LLT , "lltprn1" ,"no" Return End Procedure -------------------------------------------------------------------------------------+ Procedure cala2 (str(80) !Quest, str(8) !Cmd, str(8) !Cmd1, str(8) !Monitor) --. Do a repetitive part of calibration A2 --.NOTE: The 5 looping sections are nearly identical. I didn't --. make another procedure because I think I might exceed the --. allowed Elisa nesting depth Var Str(80) !Check = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_int = 0 Str(80) !LM_S1 = " " Main !Check="in DONE,done" @AskStr (!Quest,!Check,*!LM_S1,*!S,*!NbErr) @SendCommand(!Cmd,"0x60") @SendCommand(!Cmd1,"0x60") DO @WaitTime("00h00m08s",*!S) !Get_int = Get(!Monitor) EXIT IF (!Get_int = 0x60) END DO @WaitTime ("00h00m15s",*!S) PERFORM/NO MDI_LLT , "lltprn1" ,"no" @SendCommand(!Cmd,"0x40") @SendCommand(!Cmd1,"0x40") DO @WaitTime("00h00m08s",*!S) !Get_int = Get(!Monitor) EXIT IF (!Get_int = 0x40) END DO @WaitTime ("00h00m15s",*!S) PERFORM/NO MDI_LLT , "lltprn1" ,"no" @SendCommand(!Cmd,"0x00") @SendCommand(!Cmd1,"0x00") DO @WaitTime("00h00m08s",*!S) !Get_int = Get(!Monitor) EXIT IF (!Get_int = 0x00) END DO @WaitTime ("00h00m15s",*!S) PERFORM/NO MDI_LLT , "lltprn1" ,"no" 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 Display_string ( Str(80) !Add_Display , Int !Start_Pos ) Var Int !Len1 Int !Len2 Str(80) !Full_Display1 Str(80) !Full_Display2 Main !Len1 = Len( !GM_Display ) !Len2 = Len( !Add_Display ) If !Len1 <= ( !Start_Pos - 1 ) Then !Full_Display1 = !GM_Display Do Exit If !Len1 >= ( !Start_Pos - 1 ) !Full_Display1 = !Full_Display1 + " " !Len1 = !Len1 + 1 End Do !Full_Display2 = "" End If If !Len1 > ( !Start_Pos - 1 ) Then !Full_Display1 = Extract( !GM_Display , 1 , ( !Start_Pos - 1 ) ) If !Len1 > ( !Start_Pos + !Len2 - 1 ) Then !Full_Display2 = Extract( !GM_Display , \ ( !Start_Pos + !Len2 - 1 ) , \ ( !Len1 - !Start_Pos - !Len2 + 1 ) ) Else !Full_Display2 = "" End If End If !GM_Display = !Full_Display1 + !Add_Display + !Full_Display2 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 -------------------------------------------------------------------------------------+ 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 "MBIPTBL" !Code_i = 0x0F !No_of_cmds_i = 0 Case "MBIPMACL" !Code_i = 0x11 !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) 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 -------------------------------------------------------------------------------------+