GuiderMove works for 3 out of 4 directions

Discussion in 'Scripting and Programming' started by Richard Gray, Jun 3, 2015.

  1. Richard Gray

    Richard Gray Standard User

    Joined:
    Nov 29, 2014
    Messages:
    8
    Hi,
    I am writing a script that will use the guider relay box to center a star on a spectrograph slit. I have written a little test script to use the $CCDCamera.GuiderMove function to access those relays, with four buttons, one for each direction. The N, S, and West directions work fine, but the East direction does not work. The telescope does not budge. The code is fine; if I flip the function of the E and W buttons, the E button now works (although moves the telescope west). I know that the relays work -- we use the same autoguider every night, and the paddle buttons all work as well. I have tested this on both Maxim DL 6 and Maxim DL 4, but always the E button fails. Any clues?

    The guide camera I am using is an ST-402, and it is connected to a relay box. I have verified in the guider setup menu that all directions are selected.

    Here is the script written in autoit3:

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Misc.au3>
    #include <AutoITConstants.au3>
    #include 'TCP_Funcs.au3'

    Opt('MustDeclareVars',1)
    Global $Dur,$Flag

    MainGUI()

    Func MainGUI()
    #Region ### START Koda GUI section ### Form=C:\Users\grayro\Documents\Koda\koda_1.7.3.0\Forms\Guider_jog.kxf
    Local $Form1,$Label1,$Button1,$Button2,$Button3,$Button4,$Input1,$Input2,$Input3,$Input4
    Local $nMsg

    $Form1 = GUICreate("Form1", 615, 438, 192, 124)
    $Label1 = GUICtrlCreateLabel("Guider Jog", 16, 16, 161, 41)
    GUICtrlSetFont(-1, 24, 400, 0, "MS Sans Serif")
    $Button1 = GUICtrlCreateButton("Move Up", 208, 96, 153, 57)
    $Button2 = GUICtrlCreateButton("Move Down", 208, 288, 153, 57)
    $Button3 = GUICtrlCreateButton("Move Right", 376, 192, 137, 57)
    $Button4 = GUICtrlCreateButton("Move Left", 48, 192, 137, 57)
    $Input1 = GUICtrlCreateInput("0", 376, 112, 57, 21)
    $Input2 = GUICtrlCreateInput("0", 528, 208, 49, 21)
    $Input3 = GUICtrlCreateInput("0", 368, 304, 57, 21)
    $Input4 = GUICtrlCreateInput("0", 200, 208, 57, 21)
    GUISetState(@SW_SHOW)
    #EndRegion ### END Koda GUI section ###

    While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
    Case $GUI_EVENT_CLOSE
    Exit
    Case $Button1
    $Dur = GUICtrlRead($Input1)
    $Flag = 1
    GuideCamera()
    Case $Button2
    $Dur = GUICtrlRead($Input3)
    $Flag = 2
    GuideCamera()
    Case $Button3
    $Dur = GUICtrlRead($Input2)
    $Flag = 3
    GuideCamera()
    Case $Button4
    $Dur = GUICtrlRead($Input4)
    $Flag = 4
    GuideCamera()
    EndSwitch
    WEnd
    EndFunc

    Func GuideCamera()
    Local $Cam, $Direction

    $Cam = ObjCreate("MaxIm.CCDCamera")
    $Cam.LinkEnabled = True

    If $Cam.LinkEnabled = False Then
    MsgBox(0,"","Camera not ready")
    Exit
    EndIf

    $Cam.DisableAutoShutdown = True

    If($Flag = 1) Then
    $Direction = 2
    EndIf
    If($Flag = 2) Then
    $Direction = 3
    EndIf
    If($Flag = 3) Then
    $Direction = 1
    EndIf
    If($Flag = 4) Then
    $Direction = 0
    EndIf

    $Cam.GuiderMove($Direction,$Dur)
    While($Cam.GuiderMoving = True)
    Wend
    EndFunc


    Richard Gray
     
    Last edited: Jun 3, 2015
  2. Richard Gray

    Richard Gray Standard User

    Joined:
    Nov 29, 2014
    Messages:
    8
     
  3. Richard Gray

    Richard Gray Standard User

    Joined:
    Nov 29, 2014
    Messages:
    8
    So, our observatory engineer has done some testing and tells me that this is a hardware problem. Glad to know that I am not yet going insane.
    Richard
     
  4. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,163
    That was going to be my first suggestion... really it's the only way I know of to get a failure like that.
     

Share This Page