Jump to content

Banner.jpg.b89429c566825f6ab32bcafbada449c9.jpg

Using VBScript for Automation


russellhq

Recommended Posts

I started a thread a while ago titled "Maxim DL Scripts" (https://stargazerslounge.com/topic/226124-maxim-dl-scripts/) but later realised that I don't need Maxim to run scripts. So I thought I'd start a new topic for anyone interested in using vbscript to automate some of the tasks we do on a regular basis.

To start off, I made this simple script which points the scope to the zenith so I can balance my light panel on the end of the scope without sliding off.

' This script will slew the telescope to the zenith for the current LST
' The script uses the local latitude to find the zenith altitude,
' then uses the LST with an offset to choose which side of the pier to point
' This is optional

Option Explicit

' List of variables used
Dim localDEC 'Local declination of zenith in decimal degrees
Dim localRA 'Local RA at LST in decimal hours

'Run sub to slew to zenith
SlewToZenith

' Sub sets variables with details held in telescope driver 
Sub SlewToZenith
   Dim Tel ' ASCOM telescope
   Dim TelescopeDriver 'Telescope driver
   Set Tel = Nothing
   TelescopeDriver = "EQMOD.Telescope" 
   Set Tel = CreateObject(TelescopeDriver)
   localDEC = Tel.SiteLatitude ' Telescope declination, decimal degrees
   localRA = Tel.SiderealTime + 0.02' Telescope right ascension, decimal hours
   Tel.SlewToCoordinates localRA, localDEC 'Right ascension in decimal hours and Declination in decimal degrees
   Set Tel = Nothing

End Sub

 

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. By using this site, you agree to our Terms of Use.