Dim cam ' "The" Camera object Dim Telescope, Util Dim startnum, nexposures, exptime Dim file_string Dim shutter Dim filternum Dim binning Dim rootpath Dim obsdate Dim fullpath Dim targetname, targetRA, targetDec ' ' Change the obsdate subdirectory name to write to a new night ' obsdate = "20200819" ' pathname = "C:\Users\Public\Documents\ACP Web Data\Doc Root\images\bketzeba\" pathname = "C:\Users\Public\Documents\ACP Web Data\Doc Root\images\AS04\" fullpath = pathname & obsdate ' ' Change the following variables for your target and exposure ' target info: targetname, targetRA, targetDec ' startnum is the inital image number in a sequence, usually 0 or 1 ' nexposures is number of exposures you want to take ' exptime is exposure time in seconds ' shutter is 1 for light (open shutter) or 0 for darks ' filternum is the number of the filter in the wheel 0 to 9 ' binning is the bin factor for the camera (1,2, 3, etc) targetname = "EVLac_V" targetRA = "22:47:24.85" targetDec = "+44:26:24" sequencenum = 0 nexposures = 999 exptime = 20 shutter = 1 filternum = 7 binning = 2 ' ' Create an ACP object for telescope and utility functions ' Set Telescope = CreateObject("ACP.Telescope") Set Util = CreateObject("ACP.Util") ' ' Slew to your target coordinates and track ' Telescope.TargetRightAscension = Util.HMS_Hours(targetRA) Telescope.TargetDeclination = Util.DMS_Degrees(targetDec) wscript.echo "Current position", Util.Hours_HMS(Telescope.RightAscension), Util.Degrees_DMS(Telescope.Declination) Util.Console.Clear Util.Console.PrintLine "" Util.Console.PrintLine "Start observing script" Util.Console.PrintLine "" Util.Console.PrintLine "Slewing to " & targetname & " ..." Telescope.SlewToTarget Do While Telescope.Slewing Util.WaitForMilliseconds(1000) LOOP wscript.echo "Slew complete" Util.Console.PrintLine "Slew Complete" ' Wait 15 seconds to settle the telescope and update the position Util.WaitForMilliseconds(15000) wscript.echo "" wscript.echo "Current position", Util.Hours_HMS(Telescope.RightAscension), Util.Degrees_DMS(Telescope.Declination) ' ' Create the camera object and see if it is connected ' Set cam = CreateObject("MaxIm.CCDCamera") cam.LinkEnabled = True if Not cam.LinkEnabled Then wscript.echo "Failed to start camera." Quit End If ' ' Set binning and filter ' Util.Console.PrintLine "Setting up the camera binning and filterwheel" cam.BinX = binning cam.BinY = binning cam.Filter = filternum Util.Console.PrintLine "Starting exposure sequence.... " Do While sequencenum < nexposures file_string = fullpath & "\" & targetname & "_" & sequencenum & ".fits" Util.Console.PrintLine "Camera is ready, Exposing for " & exptime & " seconds" wscript.echo "Camera is ready, Exposing for " & exptime & " seconds." cam.Expose exptime, shutter, filternum Do While Not cam.ImageReady Loop cam.SaveImage file_string Util.Console.PrintLine "Exposure " & sequencenum & " is done, Image saved" wscript.echo "Exposure is done, Image saved as " & file_string sequencenum = sequencenum + 1 Loop ' ' Turn off tracking once the script is done ' If Telescope.CanSetTracking Then ' Turn tracking off If Telescope.Tracking Then ' Avoid needless change Util.Console.PrintLine " (tracking off)" Telescope.Tracking = False End If End If Util.Console.PrintLine "Script complete" ' Wait 5 seconds to read the message Util.WaitForMilliseconds(5000)