Loading ...
Sorry, an error occurred while loading the content.

Re: [ASCOM] NexStar Combined driver

Expand Messages
  • Ray St.Denis
    Hi Dan, Yes, please send me your current code at stdenis(at)webtech.on.ca This is what I m using in my code for Tracking: (Let me know if this comes out
    Message 1 of 3 , Jan 7, 2003
    • 0 Attachment
      Hi Dan,

      Yes, please send me your current code at stdenis(at)webtech.on.ca

      This is what I'm using in my code for Tracking:
      (Let me know if this comes out garbled)

      '-----------------------------------------------------------
      ' SetTrackingMode - Sets Scope Tracking Mode
      ' 0 - Tracking OFF
      ' 1 - AzAlt Tracking
      ' 2 - EQ North Tracking
      ' 3 - EQ South Tracking
      '-----------------------------------------------------------
      Public Sub SetTrackingMode(ByVal TrackingMode As TrackingModes)
      Dim Response As String
      If TrackingMode >= 0 And TrackingMode <= 3 Then
      Response = SendScopeCommand("T" & Chr$(TrackingMode))
      mTrackingMode = TrackingMode
      mAzTrackingRate = 0
      mAltTrackingRate = 0
      End If
      End Sub

      '-----------------------------------------------------------
      ' SetTrackingRate - Sets Scope Moving in Set Speed and Direction
      ' AzRate - Positive Value moves Right, Negative moves Left
      ' Specified in ArcSeconds per Second (ie 15 = Sidereal)
      ' AltRate - Positive Value moves Up, Negative moves Down
      ' Specified in ArcSeconds per Second (ie 15 = Sidereal)
      '-----------------------------------------------------------
      Public Sub SetTrackingRate(ByVal AzRate As Double, ByVal AltRate As Double)
      Dim tAzRate As Double, tAltRate As Double
      tAzRate = Round(AzRate * 4#, 0) / 4#
      tAltRate = Round(AltRate * 4#, 0) / 4#
      If mTrackingMode <> 0 Then
      SetTrackingMode TrackingOFF
      End If
      If tAzRate = 0 And tAltRate = 0 Then
      SetTrackingMode TrackingOFF
      Exit Sub
      End If
      If tAzRate = mAzTrackingRate And tAltRate = mAltTrackingRate Then
      Exit Sub
      End If

      If tAzRate <> mAzTrackingRate Then
      SetAzTrackingRate tAzRate * 4#
      End If
      If AltRate <> mAltTrackingRate Then
      SetAltTrackingRate tAltRate * 4#
      End If
      mAzTrackingRate = tAzRate
      mAltTrackingRate = tAltRate
      End Sub

      Private Sub SetAzTrackingRate(ByVal AzRate As Long)
      Dim AzDirection As Integer, AzRateHi As Long, AzRateLo As Long
      Dim Response As String
      AzDirection = Sgn(AzRate)
      AzRateHi = (Abs(AzRate) * 1) \ 256: AzRateLo = (Abs(AzRate) * 1) Mod 256
      Select Case AzDirection
      Case 1 'Right
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(16) & Chr$(6) & _
      Chr$(AzRateHi) & Chr$(AzRateLo) & Chr$(0) & Chr$(0))
      Case 0 'Stop
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(16) & Chr$(6) & _
      Chr$(AzRateHi) & Chr$(AzRateLo) & Chr$(0) & Chr$(0))
      Case -1 'Left
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(16) & Chr$(7) & _
      Chr$(AzRateHi) & Chr$(AzRateLo) & Chr$(0) & Chr$(0))
      End Select
      End Sub

      Private Sub SetAltTrackingRate(ByVal AltRate As Long)
      Dim AltDirection As Integer, AltRateHi As Long, AltRateLo As Long
      Dim Response As String
      AltDirection = Sgn(AltRate)
      AltRateHi = (Abs(AltRate) * 1) \ 256: AltRateLo = (Abs(AltRate) * 1) Mod 256
      Select Case AltDirection
      Case 1 'Up
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(17) & Chr$(6) & _
      Chr$(AltRateHi) & Chr$(AltRateLo) & Chr$(0) & Chr$(0))
      Case 0 'Stop
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(17) & Chr$(6) & _
      Chr$(AltRateHi) & Chr$(AltRateLo) & Chr$(0) & Chr$(0))
      Case -1 'Down
      Response = SendScopeCommand("P" & Chr$(3) & Chr$(17) & Chr$(7) & _
      Chr$(AltRateHi) & Chr$(AltRateLo) & Chr$(0) & Chr$(0))
      End Select
      End Sub



      [Non-text portions of this message have been removed]
    • Bob Denny
      Ray St.Denis: Hi Dan, ... May I respectfully inquire as to the reasons for the Public SetTrackingMode() method? Should this be indicated/set in the instrument
      Message 2 of 3 , Jan 7, 2003
      • 0 Attachment
        Ray St.Denis:> Hi Dan,
        >
        > Yes, please send me your current code at stdenis(at)webtech.on.ca
        >
        > This is what I'm using in my code for Tracking:
        > (Let me know if this comes out garbled)

        May I respectfully inquire as to the reasons for the Public
        SetTrackingMode() method? Should this be indicated/set in the instrument
        setup dialog so that scripts aren't unduly involved with the low level
        operation of the scope? Must I write in special code for this (NexStar
        only) whenever I write a script? How do I test my scripts and clients?

        ASSUMING WE HAVE A POWERFUL REASON FOR EXTENDING THE STANDARD... since the
        client is setting values (modes), perhaps it would be worth considering a
        property TrackingMode with discrete values (a Public Enum, like the
        ALignmentModes and GuideDirections in the current Telescope standard). And
        with a property, scripts can read back the current state of the tracking
        mode without another method GetTrackingRate(). Any time you find yourself
        using Setxxx() and Getxxx(), it begs to be a property. Also, turning
        tracking on and off is already covered by the current Tracking property. So

        Public Enum TrackingModes
        trkAltAz = 0
        trkEqNorth = 1
        trkEqSouth = 2
        End Enum

        Public Property Get TrackingMode() as TrackingModes
        TrackingMode = <<one of the legal values>>
        End Property

        Public Property Let TrackingMode(newVal as TrackingModes) as Boolean
        Select Case newVal
        trkAltAz: <<whatever>>
        trkEqNorth: <<whatever>>
        trkEqSouth: <<whatever>>
        default: Err.Raise etc... (illegal value)
        End Select
        End Property

        But I am really against ad-hoc addition of new properties and/or methods to
        a driver! It breaks the shole reason for drivers in the first place. If we
        need to extend the Telescope standard, then let's do so. Discuss the need,
        converge on a solution, extend the standard, then implement the new
        standard in all of the drivers, and finally release a new Platform with the
        updated standard and drivers. And the tracking mode stuff appears on the
        surface to be device-dependent/low level manipulation that may not be
        appropriate, but I may also have misunderstood the function of it...

        And all of the above is a total botch if TrackingMode is not supposed to be
        a public part of the Telescope interface in the new driver. If that is the
        case, sorry for the noise!!

        -- Bob
      • Ray St.Denis
        Hi Bob, Sorry for the confusion .. the code snipit I posted was from a non-ASCOM driver I am using in some of my programs and was not meant as a direct
        Message 3 of 3 , Jan 7, 2003
        • 0 Attachment
          Hi Bob,

          Sorry for the confusion .. the code snipit I posted was from a non-ASCOM driver I am using in some of my programs and was not meant as a direct replacement to any of the ASCOM interfaces, but mearly to show some sample code.

          Sorry for the confusion,

          Ray

          >
          > From: Bob Denny <rdenny@...>
          > Date: 2003/01/07 Tue PM 09:48:14 EST
          > To: ASCOM-Talk@yahoogroups.com
          > Subject: Re: [ASCOM] NexStar Combined driver
          >
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.