'********************************************************* 'Putman Mountain Observatory RCOS Telescope Startup Script. 'This script will invoke the TIM Control Program and then connect to it. 'After connected, the following actions are taken: ' 1. Robotic Mirror Flaps are opened ' 2. Primary Mirror Fans are turned on automatic ' 3. Dew heater is turned on automatic ' '****************************************************************************************************** 'Define Variables '****************************************************************************************************** Dim wshShell, TIM, Ambient, Primary, Secondary, Focuser, UserInput Const cTitle = "Putman Moutain Observatory" '****************************************************************************************************** 'Create WScript Shell Object '****************************************************************************************************** Set wshShell = WScript.CreateObject("WScript.Shell") '****************************************************************************************************** 'Invoke TIM Control App '****************************************************************************************************** wshShell.run ("""C:\Program Files (x86)\RCOS\TIMCtrl.exe""") wscript.sleep 3000 'Instantiate the TIM Control Object Set TIM = CreateObject ("ASCOM.TIMCtrl.Utilities") wscript.sleep 100 'Connect to the TIM COntrol APP TIM.SystemConnect wscript.sleep 1000 'Get Readings and Load into Variables Ambient = TIM.AmbientTemperature Primary = TIM.PrimaryTemperature Secondary = TIM.SecondaryTemperature Focuser = TIM.FocuserPosition 'Display Current Readings for ten seconds UserInput = WshShell.Popup("Current Telescope Status:" & VbCrLf & VbCrLf & _ "Ambient Temperature: " & VbTab & Ambient & VbCrLf & _ "Primary Temperature: " & VbTab & Primary & VbCrLf & _ "Secondary Temperature: " & VbTab & Secondary & VbCrLf & _ "Focuser Position: " & VbTab & VbTab & Focuser, 10, cTitle, vbInformation+vbOkOnly) Wscript.Sleep 100 '****************************************************************************************************** 'Open Mirror Covers '****************************************************************************************************** UserInput = WshShell.Popup("Proceeding to Open Robotic Mirror Covers", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 TIM.ShowMirrorCover_Page WScript.Sleep 100 TIM.MirrorCoverOpen WScript.Sleep 100 UserInput = WshShell.Popup("Status: " & TIM.MirrorStatus, 5, cTitle, vbInformation+vbOkOnly) Do Until TIM.MirrorStatus = "OPEN" Loop UserInput = WshShell.Popup("Status: " & TIM.MirrorStatus, 5, cTitle, vbInformation+vbOkOnly) '****************************************************************************************************** 'Turn on Primary Fans '****************************************************************************************************** Wscript.Sleep 100 UserInput = WshShell.Popup("Proceeding to turn on Primary Fans", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 TIM.ShowFanPwm_Page WScript.Sleep 100 TIM.PWMSetAutoFan = 1 WScript.Sleep 100 UserInput = WshShell.Popup("Primary Fans are now on Auto", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 '****************************************************************************************************** 'Turn on Secondary Heater '****************************************************************************************************** Wscript.Sleep 100 UserInput = WshShell.Popup("Proceeding to turn on Secondary Heater", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 TIM.ShowFanPwm_Page WScript.Sleep 100 TIM.PWMSetAutoSec = 1 WScript.Sleep 100 UserInput = WshShell.Popup("Secondary Heater is now on Auto", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 '****************************************************************************************************** 'Future Logic for Homing Focuser and Returning to Start Position and Trapping Errors '****************************************************************************************************** '****************************************************************************************************** 'Shut Down and Goodbye '****************************************************************************************************** Wscript.Sleep 100 UserInput = WshShell.Popup("RCOS Telescope Startup Sequence Complete" & vbCrLf & vbCrLf & _ "Script will now terminate...", 5, cTitle, vbInformation+vbOkOnly) WScript.Sleep 100 Set TIM = nothing WScript.quit