Notes on the xo vbs script ========================== The vbs script defines functions and then calls them when the telescope is asked to "observe". There is an interesting technique at the start that makes the programming readable: Dim objTele Dim objGlobal 'Create objects Set objGlobal = New globals Set objTele = WScript.CreateObject("TheSky6.RASCOMTele") In our code this would be Set objTele = WScript.CreateObject("TheSkyXAdaptor.RASCOMTele.1") Set tracking to sidereal rate Call objtele.settracking(1,0,0,0) Slew to drift scan starting position RA: ra Dec: decmax Call objtele.slewtoradec(ra,decmin,"north") Set scanning speed RA: sidereal Dec: decrate arcsec/sec Call objtele.settracking(1,0,0,decrate) Slew to drift scan starting position RA: ra Dec: decmax Call objtele.slewtoradec(ra,decmax,"south") Begin initialization Connect to the mount objTele.Connect() If (objTele.IsConnected = 0) Then Call log(objGlobal.logpath,"Connection to the mount failed.") WScript.Quit Else Call log(objGlobal.logpath,"Successfully connected to mount.") End If Initiate park Call objTele.park() Disconnect from the mount objTele.disconnect() If (objTele.IsConnected = 0) Then Call log(objGlobal.logpath,"Successfully disconnnected from mount.") Else Call log(objGlobal.logpath,"ERROR: Mount disconnect failed.") End If Initiate mount homing Call objtele.findhome() '********************************************************************* '** sub stow() ******************************************************* '********************************************************************* ' requires lst(), julian(), and ha2ra() to calculate RA of stow position sub stow() 'stowra = lst(objGlobal.longitude,now(),objGlobal.timezone) - (objGlobal.stowha) stowra = ha2ra(lst(objGlobal.longitude,now(),objGlobal.timezone), objGlobal.stowha) Call log(objGlobal.logpath,"Initiate mount homing.") objTele.FindHome() Call log(objGlobal.logpath,"Mount homing complete.") 'Call log(objGlobal.logpath,"Stowing at HA=" & objGlobal.stowha & ", Dec=" & objGlobal.stowdec & ". (RA=" & stowra & ")") 'Call objtele.slewtoradec(stowra,objGlobal.stowdec,"south") 'Call log(objGlobal.logpath,"Finished slew to stow position.") objTele.park() Call log(objGlobal.logpath,"Mount parking complete.") objTele.disconnect() If (objTele.IsConnected = 0) Then Call log(objGlobal.logpath,"Successfully disconnnected from mount.") Else Call log(objGlobal.logpath,"ERROR: Mount disconnect failed.") End If Call log(objGlobal.logpath,"Finished stowing the mount.") Call log(objGlobal.logpath,"### End of script.") end sub 'stow()