Contents


RunOnError Scripts

In the unlikely event of an unhandled exception or other program error, CCDAutoPilot will attempt to run a script called RunOnError.vbs, if it exists.  There is only one location checked for the existence of this script:
(My)Documents\CCDWare\CCDAutoPilot5\

A script is a simple text file that addresses server programs through Windows Scripting Host.  A script is written in notepad or other simple text editor, (not Word!) and has the extension .vbs instead of .txt.  If you want to use this recommended back up facility, here are some sample scripts.  Simply copy the text between the ***'s (but not the ***'s) and paste it into notepad.   Save the file as RunOnError.vbs, initially to the desktop.  Double click on it to make sure it has the desired result.  Once you are satisfied, move it to (My)Documents\CCDWare\CCDAutoPilot5\

Park the mount with TheSkyX:
***
dim tele
set tele = CreateObject ("TheSkyXAdaptor.RASCOMTele")
tele.connect
tele.Park
set tele = nothing
***
    
Park the mount with TheSky6:
***
Dim tele
set tele = CreateObject ("TheSky6.RASCOMTele")
tele.Park
set tele = Nothing
***

If you have Good Night System set up on your observatory and smartphone, you can really take advantage of RunOnError. Should a program error occur, GNS can notify you via your smartphone if you include the following in your RunOnError script:
* * *
Dim GNS
set GNS = CreateObject("GNS.OWL")
GNS.NewMsg = "CCDAP5 Program Error"
GNS.NewTimeout = 0
set GNS = nothing
* * *


If you want to add more to this, for example close a roof or dome, that can be added.  Google Windows Scripting Host for more info and see the documentation for your server programs.