--+----------------------------------------------------------------------------+ --+ SOHO Project -- Control File --+ ---------------------------- --+ --+ Name : MDI_LLT , !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/00 211 20:00 13/01/94 A.J. TURK -- Conversion from MDI language. --+ 1/01 289 13:58 09/02/94 Ph. IATRINO -- During debug phase. --+ 1/02 360 13:26 05/05/94 Ed COBB/Ph. IATRINO -- Rationalization. --+ 1/03 393 08:43 20/05/94 Ed COBB -- MDI Updates. --+ 1/04 406 13:26 24/05/94 Ed COBB -- MDI Updates. --+ 1/07 443 16:31 17/06/94 Ed COBB -- MDI Updates. --+ 2/01 479 19:46 20/09/94 Ed COBB/Ph. IATRINO -- MDI Updates. --+ ???? ??? 0857 26/01/95 M.Levay(LPARL) -- Jitter Test Procedures. --+ ???? ??? 1059 01/02/95 D.Mathur(LPARL) -- extracted Jitter Test --+ -- Procedures. --+ 2/02 544 20:20 01/02/95 Ph. IATRINO -- MDI Updates. --+ 2/03 572 19:00 17/03/95 O. MICHEL -- 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 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 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_LLT , 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 "lltcntr" @lltcntr() Case "lltcom" @lltcom() Case "lltoff" @lltoff() Case "llton" @llton() Case "lltprn1" @lltprn1() Case "lltprn2" @lltprn2() Case "lltsetup" @lltsetup() Case "llttaps" @llttaps() 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 lltcntr ( ) --. --. This procedure allows the operator to centre the stimulus telescope --. image for the ISS --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Get_dig = "" Int !Get_int = 0 Real !Get_real = 0.0 Int !LM_I0 = 0 Int !LM_I1 = 0 Int !LM_I2 = 0 Int !LM_I3 = 0 Main !Title = "-EXECUTING PROCEDURE: lltcntr." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Get_dig = Get( "MKPWLT" ) If !Get_dig <> "ON" Then @llton() End If PERFORM/NO MDI_MODE , "lobsmode" , "no" PERFORM/NO MDI_LIP , "liplbic5" , "no" !GM_I0 = 4000 !GM_I9 = 7 Execute MDI_INTRRPT , "Type 'YES' when image is centred" @WaitTime ( "00h00m05s" , *!S ) @llttaps() @WaitTime ( "00h00m05s" , *!S ) -- after image is centred, record offsets and errors !Get_int = Get( "MKLTXOFS" ) !Title = " X offset: " + &3d( !Get_int ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_real = Get( "MULTXAVE" ) !Title = " X avgerr: " + &4.2f( !Get_real ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_int = Get( "MKLTYOFS" ) !Title = " Y offset: " + &4.2f( !Get_real ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_real = Get( "MULTYAVE" ) !Title = " Y avgerr: " + &4.2f( !Get_real ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) For !LM_I0 = 1 to 10 @lltsetup() @WaitTime ( "00h00m30s" , *!S ) !Title = "~lltsetup number :" + &2d( !LM_I0 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_int = Get( "MKLTXOFS" ) !Title = "X offset: " + &3d( !Get_int ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_real = Get( "MULTXAVE" ) !Title = "X avgerr: " + &4.2f( !Get_real ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) If !Get_real > 2.2 Then If !Get_real < 2.4 Then !LM_I1 = 1 End If End If !Get_int = Get( "MKLTYOFS" ) !Title = "Y offset: " + &3d( !Get_int ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Get_real = Get( "MULTYAVE" ) !Title = "Y avgerr: " + &4.2f( !Get_real ) @Message( "DC" , "date" , !ExpName , !Phase , !Title , *!S ) If !Get_real > 2.2 Then If !Get_real < 2.4 Then !LM_I2 = 1 End If End If !LM_I3 = !LM_I1 * !LM_I2 If !LM_I3 = 1 Then Goto ##DONE End If End For ##DONE !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltcntr." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure llton ( ) --. --. This procedure file turns ON & initializes the limb tracker for use --. with the stimulus telescope. --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Get_dig = "" Main !Title = "-EXECUTING PROCEDURE: llton." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Powering ON ISS with open loop" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBPWLTON" , "" ) @SendCommand ( "MBLTOPNL" , "" ) @WaitTime ( "00h00m30s" , *!S ) !Title = "Limb tracker ON & OPEN loop" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Expect "MKPWLT" , "ON" , 1 Enable "MKPWLT" !Get_dig = Get( "MKPWLT" ) If !Get_dig <> "ON" Then !Title = "*Limb Tracker is NOT on - procedure halted" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "*Operator CONTinue " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If @CheckDig( "MKPWLT" , "= ON" , *!NbErr ) !Title = "~Setting ISS gains for Stimulus Telescope" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTPDIO" , "" ) @SendCommand ( "MBLTPOUT" , "" ) @SendCommand ( "MBLTHIGN" , "" ) @SendCommand ( "MBLTFINE" , "" ) @WaitTime ( "00h00m05s" , *!S ) !Title = "~Select prime diodes, HI gain(lamp), fine offsets" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTXGN" , "0x40" ) @SendCommand ( "MBLTYGN" , "0x40" ) @WaitTime ( "00h00m05s" , *!S ) !Title = "X & Y gains to 0x40" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTXOFS" , "0" ) @SendCommand ( "MBLTYOFS" , "0" ) @WaitTime ( "00h00m05s" , *!S ) !Title = "X & Y offsets to 0" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x40" ) @SendCommand ( "MBLTBOFS" , "0x40" ) @SendCommand ( "MBLTCOFS" , "0x40" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1 () !Title = "All PZT offsets to 0x40" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: llton." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lltcom ( ) --. --. This procedure file performs the short form test of the limb tracker. --. This proceedure assumes the limb tracker was turned on using llton --. and that the instrument is in the normal observation mode (obsmode). --. It also assumes that the grid image has been centred (lltcntr) --. so that lltsetup can be used to close the loop and that the alignment --. mechanism is on (lamon) --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Get_dig = "" Str(80) !Question = "" Str(80) !Check = "" Int !Cmd_data_i(30) Int !Get_int = 0 Str(80) !LM_S0 = "" Int !LM_I0 = 0 Int !LM_I1 = 0 Int !LM_I2 = 0 Int !LM_I3 = 0 Main !Title = "-EXECUTING PROCEDURE: lltcom." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Open loop, fine offset, prime photodiodes" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) PERFORM/NO MDI_LFD , "lfdstat" , "no" If !GM_S7 = "CLOSED" Then Goto ##START End If !Get_dig = Get( "MKPWAM" ) If !Get_dig <> "ON" Then PERFORM/NO MDI_LAM , "lamon" , "no" End If !Title = "~Moving Alignment Mechanism legs " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "2" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBAM2INC" , "2" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBAM1DEC" , "2" ) @WaitTime ( "00h00m02s" , *!S ) @SendCommand ( "MBAM2DEC" , "2" ) @WaitTime ( "00h00m45s" , *!S ) !Title = "~Nulling error signals using X & Y offsets" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @lltsetup() !Check = "in y, Y, n, N" !Question = "Error Signals ~2.3V? (Y or N) " @AskStr ( !Question , !Check , *!LM_S0 , *!S , *!NbErr ) @Upper (!LM_S0, *!LM_S0) If !LM_S0 <> "Y" Then !Title = "Null error sig 2.3V using X & Y offsets " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "*Operator CONTinue " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If !Title = "Error signals nulled" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @PrintParam( "MKLTXOFS" , "REG" ) @PrintParam( "MKLTYOFS" , "REG" ) ##START @lltprn1() !Title = "Changing X and Y offsets to +0x0c " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !LM_I0 = Get( "MKLTXOFS" ) !LM_I1 = Get( "MKLTYOFS" ) @SendCommand ( "MBLTXOFS" , "0x0C" ) @SendCommand ( "MBLTYOFS" , "0x0C" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "Changing X and Y offsets to 0xF4" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTXOFS" , "0xF4" ) @SendCommand ( "MBLTYOFS" , "0xF4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "~X & Y offsets to Start, PZT A offset to 0x20" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTXOFS" , &d( !LM_I0 ) ) @SendCommand ( "MBLTYOFS" , &d( !LM_I1 ) ) @SendCommand ( "MBLTAOFS" , "0x20" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT A offset to 0x60 " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x60" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "~PZT A offset to 0x40, PZT B offset to 0x20" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x40" ) @SendCommand ( "MBLTBOFS" , "0x20" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT B offset to 0x60" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTBOFS" , "0x60" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "~PZT B offset to 0x40, PZT C offset to 0x20" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTBOFS" , "0x40," ) @SendCommand ( "MBLTCOFS" , "0x20," ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT C offset to 0x60" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTCOFS" , "0x60" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT C offset to 0x40" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTCOFS" , "0x40" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() -- stop here if no stimulus, else continue If !GM_S7 = "CLOSED" Then Goto ##DONE End If -- write errors/photodiodes !Title = "~Starting position: Leg1 +0, Leg2 +0" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @lltprn2() -- move legs, write error signals/photodiodes !Title = "Moving to position Leg1 +2, Leg2 -2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "2" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2DEC" , "2" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 -2, Leg2 +2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1DEC" , "4" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2INC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 +2, Leg2 +2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 -2, Leg2 -2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1DEC" , "4" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2DEC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving legs back to original position" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "2" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2INC" , "2" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() -- with the stimulus image centered on the CCD (zero error) close the loop !Title = "~Closing the loop" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTCLSL" , "" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() -- change PZT offests, verify errors stay zero !Title = "~PZT A, PZT B, and PZT C offsets to 0x60" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x60" ) @SendCommand ( "MBLTBOFS" , "0x60" ) @SendCommand ( "MBLTCOFS" , "0x60" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT A, PZT B, and PZT C offsets to 0x20" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x20" ) @SendCommand ( "MBLTBOFS" , "0x20" ) @SendCommand ( "MBLTCOFS" , "0x20" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "PZT A, PZT B, and PZT C offsets to 0x40" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTAOFS" , "0x40" ) @SendCommand ( "MBLTBOFS" , "0x40" ) @SendCommand ( "MBLTCOFS" , "0x40" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn1() -- move legs, write error signals/photodiodes !Title = "~Moving to position Leg1 +2, Leg2 -2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "2" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2DEC" , "2" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 -2, Leg2 +2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1DEC" , "4" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2INC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 +2, Leg2 +2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving to position Leg1 -2, Leg2 -2" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1DEC" , "4" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2DEC" , "4" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "Moving legs back to original position" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBAM1INC" , "2" ) @WaitTime ( "00h00m03s" , *!S ) @SendCommand ( "MBAM2INC" , "2" ) @WaitTime ( "00h00m45s" , *!S ) @lltprn2() !Title = "~Moving PA wheel to position 89" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Cmd_data_i(0) = 255 !Cmd_data_i(1) = 255 !Cmd_data_i(2) = 89 !Cmd_data_i(3) = 255 !Cmd_data_i(4) = 255 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "Moving PA wheel to position 125" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !Cmd_data_i(0) = 255 !Cmd_data_i(1) = 255 !Cmd_data_i(2) = 125 !Cmd_data_i(3) = 255 !Cmd_data_i(4) = 255 PERFORM/NO PLM_BLOCK , "MDI" , 0x1D , !Cmd_data_i() , 5 @WaitTime ( "00h00m45s" , *!S ) @lltprn1() !Title = "~Opening the loop" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @SendCommand ( "MBLTOPNL" , "" ) ##DONE !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltcom." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lltoff ( ) --. --. This procedure powers OFF the Limb Tracker. --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(80) !Get_dig = "" Main !Title = "-EXECUTING PROCEDURE: lltoff." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !Title = "~Switching off limb tracker" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Inhibit "MKPWLT" Inhibit "MKLTLOOP" @SendCommand ( "MBPWLTOF" , "" ) -- Power off limb tracker. @WaitTime ( "00h00m45s" , *!S ) Expect "MKPWLT" , "OFF" , 1 Expect "MKLTLOOP" , "OPEN" , 1 Enable "MKPWLT" Enable "MKLTLOOP" !Get_dig = Get( "MKPWLT" ) If !Get_dig <> "OFF" Then !Title = "*Limb tracker is NOT OFF - procedure halted" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) Halt !Title = "*Operator CONTinue " @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) End If @CheckDig( "MKPWLT" , "= OFF" , *!NbErr ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltoff." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lltprn1 ( ) --. --. Outputs limb tracker status data 1 --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Int !Get_int = 0 Real !Get_real = 0.0 Main !Title = "-EXECUTING PROCEDURE: lltprn1." @Message( "DC" , "date" , !ExpName , !Phase , !Title , *!S ) If !GM_S7 <> "CLOSED" Then -- front door open !Title = "~OFFSETS and GAIN VALUES" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @PrintParam( "MKLTXOFS" , "REG" ) @PrintParam( "MKLTYOFS" , "REG" ) @PrintParam( "MKLTXGN" , "REG" ) @PrintParam( "MKLTYGN" , "REG" ) @PrintParam( "MULTXAVE" , "ANA" ) @PrintParam( "MULTYAVE" , "ANA" ) @PrintParam( "MULTXMAX" , "ANA" ) @PrintParam( "MULTYMAX" , "ANA" ) @PrintParam( "MULTDIO1" , "ANA" ) @PrintParam( "MULTDIO2" , "ANA" ) @PrintParam( "MULTDIO3" , "ANA" ) @PrintParam( "MULTDIO4" , "ANA" ) @PrintParam( "MKLTAOS" , "REG" ) @PrintParam( "MKLTBOS" , "REG" ) @PrintParam( "MKLTCOS" , "REG" ) @PrintParam( "MULTPZT1" , "ANA" ) @PrintParam( "MULTPZT2" , "ANA" ) @PrintParam( "MULTPZT3" , "ANA" ) Else !Title = "PZT OFFSETS VALUES" @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) @PrintParam( "MKLTXOFS" , "REG" ) @PrintParam( "MKLTYOFS" , "REG" ) @PrintParam( "MKLTAOS" , "REG" ) @PrintParam( "MKLTBOS" , "REG" ) @PrintParam( "MKLTCOS" , "REG" ) @PrintParam( "MULTPZT1" , "ANA" ) @PrintParam( "MULTPZT2" , "ANA" ) @PrintParam( "MULTPZT3" , "ANA" ) End If !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltprn1." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lltprn2 ( ) --. --. Outputs limb tracker status data 2 --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Real !Get_real = 0.0 Main !Title = "-EXECUTING PROCEDURE: lltprn2." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) @PrintParam( "MXAM1POS" , "ANA" ) @PrintParam( "MXAM2POS" , "ANA" ) @PrintParam( "MULTXAVE" , "ANA" ) @PrintParam( "MULTYAVE" , "ANA" ) @PrintParam( "MULTXMAX" , "ANA" ) @PrintParam( "MULTYMAX" , "ANA" ) @PrintParam( "MULTDIO1" , "ANA" ) @PrintParam( "MULTDIO2" , "ANA" ) @PrintParam( "MULTDIO3" , "ANA" ) @PrintParam( "MULTDIO4" , "ANA" ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltprn2." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure lltsetup ( ) --. --. This procedure automatically adjusts the x and y offsets of the --. Limb tracker AFTER aligning so that offsets are within range !!! --. This proceedure assumes the Limb tracker was turned on using ltstmon --. or ltsunon and that the instrument is in the normal observation mode. --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Real !LM_R0 = 0.0 Real !LM_R1 = 0.0 Real !LM_R2 = 0.0 Real !LM_R3 = 0.0 Real !LM_R4 = 0.0 Real !LM_R8 = 0.0 Int !LM_I1 = 0 Int !LM_I2 = 0 Main !Title = "-EXECUTING PROCEDURE: lltsetup." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !LM_R8 = 2.28 -- Voltage for closed loop offset !LM_R0 = Get( "MULTXAVE" ) !LM_R1 = Get( "MULTYAVE" ) !LM_I1 = Get( "MKLTXOFS" ) !LM_I2 = Get( "MKLTYOFS" ) If !LM_I1 > 127 Then !LM_I1 = !LM_I1 - 256 End If If !LM_I2 > 127 Then !LM_I2 = !LM_I2 - 256 End If !LM_R2 = !LM_R0 - !LM_R8 !LM_R3 = !LM_R1 - !LM_R8 !LM_R2 = !LM_R2 / .14 !LM_R3 = !LM_R3 / .14 !LM_R2 = !LM_R2 + Real( !LM_I1 ) !LM_R3 = !LM_R3 + Real( !LM_I2 ) !Title = "Offset s/b: " + &5.0f( !LM_R2 ) + ", " + &5.0f( !LM_R3 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !LM_R4 = 0.5 If !LM_R2 < 0.0 Then !LM_R4 = -0.5 End If !LM_I1 = (Int( !LM_R2 + !LM_R4 )) Andb 0x00FF !LM_R4 = 0.5 If !LM_R3 < 0.0 Then !LM_R4 = -0.5 End If !LM_I2 = (Int( !LM_R3 + !LM_R4 )) Andb 0x00FF @SendCommand ( "MBLTXOFS" , &d( !LM_I1 ) ) @SendCommand ( "MBLTYOFS" , &d( !LM_I2 ) ) @WaitTime ("00h00m30s" , *!S) !Title = "Final Offsets: " + &4d( !LM_I1 ) + ", " + &4d( !LM_I2 ) @Message( "DC" , "time" , !ExpName , !Phase , !Title , *!S ) !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: lltsetup." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) Return End Procedure -------------------------------------------------------------------------------< Procedure llttaps ( ) --. --. This procedure takes continuous 1x1 summed FD images --. Var Str( 3) !ExpName = "MDI" Str(10) !Phase = " " Str(49) !Title = " " Str(80) !S = &80s(" ") Int !NbErr = 0 Str(10) !Time = " " Real !LM_R0 = 0.0 Real !LM_R1 = 0.0 Real !LM_R2 = 0.0 Real !LM_R3 = 0.0 Real !LM_R4 = 0.0 Real !LM_R8 = 0.0 Int !LM_I0 = 0 Int !LM_I1 = 0 Int !LM_I2 = 0 Main !Title = "-EXECUTING PROCEDURE: llttaps." @Message( "DCL" , "date" , !ExpName , !Phase , !Title , *!S ) !GM_Display = "" !Title = Date() !Title = "Start images at " + !Title @Display_string( !Title , 32 ) @Message( "D" , "time" , !ExpName , !Phase , !GM_Display , *!S ) @SendCommand ( "MBCMSUMM" , "1 , 1" ) !Title = "image 0000 at exp " +&d( !GM_I0 ) @Display_string( !Title , 56 ) @Message( "D" , "time" , !ExpName , !Phase , !GM_Display , *!S ) @Time_To_Text( !GM_I9 , *!Time ) DO !Title = &d( !LM_I0 ) @Display_string( !Title , 62 ) !Title = &d( !GM_I0 ) @Display_string( !Title , 74 ) @Message( "D" , "time" , !ExpName , !Phase , !GM_Display , *!S ) @SendCommand ( "MBCMTP1" , "0 , 0 , " + &d( !GM_I0 ) ) @WaitTime ( !Time , *!S ) EXIT If !GM_Interrupt = 1 End DO !GM_NbErr = !GM_NbErr + !NbErr !Title = "-FINISHED PROCEDURE: llttaps." @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 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 -------------------------------------------------------------------------------<