Hello,
Script to shutdown power to the telescope upon Weather alert when using LesveDomeNet driver as a Dome Driver:
Hopefully this will save someone else the time of finding the solution himself. Good luck with it:
Complete script of ACP Weather.vbs
'
' Standard ACP Weather Safety script. Please see ACP Help, Customizing ACP,
' Adding to ACP's Logic, Weather Safety Script. If you have a real dome Or
' if the scope can clear your roll-off roof under all conditions, then
' you can adjust this so that the dome/roof closes right away.
'
' NOTE: This assumes tht you have the ACP Dome Control option "Close and
' park/home [dome] AFTER scope is parked by script" ON/Set.
'
' NOTE: To have your safe roof or real dome close right away, turn OFF the
' above option and uncomment the indicated line for opening the dome
'
Sub Main()
Dim FMX
Console.PrintLine "Weather Safety Script"
On Error Resume Next ' Best efforts...
'
' FOR SAFE DOME/ROOF - See the two NOTEs above, then
' Uncomment next 4 lines after turning option in ACP OFF
'
' If Dome.ScopeClearsClosedDome Then
' Console.PrintLine "Closing roof/shutter."
' Dome.CloseShutter ' Harmless if no dome/roof
' End If
If Prefs.AutoFocus.Enabled Then
If Prefs.AutoFocus.UsePWI Then
Console.PrintLine "Halting PWI AutoFocus (if needed)"
Set PWAF = CreateObject("PlaneWave.AutoFocus")
PWAF.StopAutofocus
Else
Console.PrintLine "Checking on FocusMax"
Set FMX = CreateObject("FocusMax.FocusControl")
If FMX.FocusAsyncStatus = -1 Then ' If FMx is actually doing something, stop it
Console.PrintLine "Halting FocusMax operation"
FMX.Halt
End If
Set FMX = Nothing
End If
Util.WaitForMilliseconds 1000
End If
If Telescope.Connected Then
Console.PrintLine "Parking scope"
Telescope.Park ' Default setting in ACP, this parks and closes the dome/roof in that order
if Telescope.Connected Then
Console.PrintLine "Disconnecting Scope"
Telescope.Connected = false
End If
driverID = "ASCOM.LesveDomeNet.Switch"
set o = CreateObject(driverID)
o.Connected = true
o.SetSwitch 1, false
o.Connected = false
Console.PrintLine("Power is now off")
End If
Console.PrintLine "Script complete"
End Sub