WARNING! – use the API at your own risk. It’s recommended that you do not leave the amount alone while running scripts. Green Swamp Software is not responsible for any damage resulting from using the API interface.
Running scripts requires that GSS be running and connected to the mount. You can start GSS on its own or by using other external programs that will load the GSS ASCOM driver such as CDC or SGP. Unless you’re experienced with how GSS separates ASCOM commands from the API It’s recommended that GSS be running on its own so no other external sources can interfere or interact with running scripts.
GSS exposes a number of class members available to external programs and scripting languages. There are PowerShell example scripts located in the GSS Program files scripting directory. Find the installation section of this manual for directory locations.
The example scripts we’re created using the Windows 10 PowerShell ISE. To run PowerShell, type in the Windows search box “PowerShell ISE” and run either the 64 bit or X86 versions. You may run into problems executing scripts because of Windows security settings. There are a number of ways to correct this and you should search google for Microsoft’s recommended approach. One way is to allow the current logged in user the ability to run script. The following command can be run within PowerShell by placing it on the first line and clicking execute or the run button. Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Bypass -Force;
/// Tells GSS not to process any AsCoM moment commands for external programs using the AsCoM driver.
/// <returns>bool</returns>
bool AscomOn { get; set; }
/// Starts the AutoHome slew to home sensors
/// <param name="degreelimit"></param>
/// <param name="offsetdec"></param>
void AutoHomeStart(int degreelimit = 100, int offsetdec = 0);
/// Stops Auto home from completing
void AutoHomeStop();
/// Move axis number of micro steps, not marked as slewing
/// <param name="axis">>axis number 1 or 2</param>
/// <param name="steps">number of micro steps</param>
/// <returns>nothing</returns>
void AxisMoveSteps(int axis, long steps);
/// Send a pulse command
/// <param name="axis">Axis 1 or 2</param>
/// <param name="guideRate">GuideRate degrees, 15.041/3600*.5, negative value denotes direction</param>
/// <param name="duration">length of pulse in milliseconds, always positive numbers</param>
/// <param name="backlashSteps">Positive micro steps added for backlash</param>
/// <returns>nothing</returns>
void AxisPulse(int axis, double guideRate, int duration, int backlashSteps = 0);
/// Goto position in degree
/// <param name="axis">axis number 1 or 2</param>
/// <param name="targetPosition">position in degrees</param>
/// <returns>nothing</returns>
void AxisGoToTarget(int axis, double targetPosition);
/// Slew axis based on a rate in degrees. Use this for small movements
/// like pulse guiding, rate changes, guiding changes, not go tos
/// <param name="axis">axis number 1 or 2</param>
/// <param name="rate">rate/sec in degrees</param>
/// <returns>nothing</returns>
void AxisSlew(int axis, double rate);
/// K Slows to a stop movement of an Axis
/// <param name="axis">axis number 1 or 2</param>
void AxisStop(int axis);
/// L Abruptly stops movement of an Axis
/// <param name="axis">axis number 1 or 2</param>
/// <returns>nothing</returns>
void AxisStopInstant(int axis);
/// q Axes slews must start independently
bool CanAxisSlewsIndependent { get; }
/// q Does mount support AZ/EQ mode
bool CanAzEq { get; }
/// q Does mount support dual encoders
bool CanDualEncoders { get; }
/// q Does mount support half current tracking
bool CanHalfTrack { get; }
/// q Does mount support home sensors
bool CanHomeSensors { get; }
/// Test result if the mount can move Dec a single step in GoTo mode
bool CanOneStepDec { get; }
/// Test result if the mount can move Ra a single step in GoTo mode
bool CanOneStepRa { get; }
/// q Does mount support a polar LED
bool CanPolarLed { get; }
/// q Does mount support PPec
bool CanPPec { get; }
/// q Does mount support WiFi
bool CanWifi { get; }
/// Sets the amount of steps added to Dec for reverse backlash pulse
int DecBacklash { get; set; }
/// Gets the number of steps from the angle in rad
/// <param name="axis"></param>
/// <param name="angleInRad"></param>
/// <returns>Steps in rad</returns>
long GetAngleToStep(int axis, double angleInRad);
/// e Gets versions of axis in long format
/// <param name="axis"></param>
/// <returns>long axis version</returns>
long GetAxisVersion(int axis);
/// e Gets version of axis in string readable format
/// <param name="axis"></param>
/// <returns>string axis version as string</returns>
string GetAxisStringVersion(int axis);
/// j Gets current axis position in degrees
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Get Current Axis position as double</returns>
double GetAxisPosition(int axis);
/// j Gets axis position counter
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Cardinal encoder count as long</returns>
long GetAxisPositionCounter(int axis);
/// d Gets Axis Current Encoder count
/// <param name="axis">axis number 1 or 2</param>
/// <returns>count as double</returns>
double GetEncoderCount(int axis);
/// Multiply the value of radians/second by this factor to get a 32-bit integer for the set speed used by the motor board.
/// <param name="axis">axis number 1 or 2</param>
/// <returns>factor used to get the speed</returns>
double GetFactorRadRateToInt(int axis);
/// Inquire motor high speed ratio
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Ratio used to determine high speed</returns>
long GetHighSpeedRatio(int axis);
/// q Get Home position
/// <param name="axis">axis number 1 or 2</param>
long GetHomePosition(int axis);
/// h Get Current "goto" target
/// <param name="axis">axis number 1 or 2</param>
double GetLastGoToTarget(int axis);
/// i Get Current "slew" speed
/// <param name="axis">axis number 1 or 2</param>
long GetLastSlewSpeed(int axis);
/// Margin used to move from high speed to low speed
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
long GetLowSpeedGotoMargin(int axis);
/// e Gets the complete version string
/// <returns></returns>
string GetMotorCardVersion(int axis);
/// Runs a motor test to see of axis can move one step in GoTo mode
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Result of each axis test</returns>
bool GetOneStepIndicator(int axis);
/// s Inquire PEC Period ":s(*1)", where *1: '1'= CH1, '2'= CH2, '3'= Both.
/// <param name="axis">axis number 1 or 2</param>
double GetPecPeriod(int axis);
/// c Micro steps from target where the ramp down process begins
/// <param name="axis">axis number 1 or 2</param>
double GetRampDownRange(int axis);
/// D Sidereal rate in axis speed
/// <returns></returns>
/// <param name="axis">axis number 1 or 2</param>
long GetSiderealRate(int axis);
/// Gets the angle in rad from amount of steps
/// <param name="axis"></param>
/// <param name="steps"></param>
/// <returns></returns>
double GetStepToAngle(int axis, long steps);
/// a Steps per revolution
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Step Count</returns>
long GetStepsPerRevolution(int axis);
/// b Frequency of stepping timer
/// <param name="axis">axis number 1 or 2</param>
/// <returns>Frequency of stepping timer</returns>
long GetStepTimeFreq(int axis);
/// The current Declination guide rate
double GuideRateDeclination { get; set; }
/// The current Right Ascension guide rate
double GuideRateRightAscension { get; set; }
/// F Initialize both Axes
void InitializeAxes();
/// Is the auto home process running
bool IsAutoHomeRunning { get; }
/// Is mount in a connected serial state
bool IsConnected { get; }
/// Starts or Stops mount and connection
bool IsMountRunning { get; set; }
/// Is mount parked
bool IsParked { get; }
/// q Is the mount collecting PPec data
bool IsPPecInTrainingOn { get; }
/// q Does the mount have PPec turned on
bool IsPPecOn { get; }
/// j Is axis at full stop
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
bool IsFullStop(int axis);
/// j Is axis in high speed mode
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
bool IsHighSpeed(int axis);
/// Is mount type set to SkyWatcher
bool IsServerSkyWatcher { get; }
/// f Is axis slewing normal mode
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
bool IsSlewing(int axis);
/// f Is axis slewing in a positive direction
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
bool IsSlewingForward(int axis);
/// f Is axis slewing in goto mode
/// <param name="axis">axis number 1 or 2</param>
/// <returns></returns>
bool IsSlewingTo(int axis);
/// Last known error from the AutoHome Process
string LastAutoHomeError { get; }
/// e Identify type of mount
bool MountType { get; }
/// e Identify board version
bool MountVersion { get; }
/// Park mount to the current selected park position
void Park();
/// Get parked selected or Set to an existing park position name
string ParkPosition { get; set; }
/// Turns PPec off during movements and then back on for error correction moves
/// <param name="on"></param>
void SkySetAlternatingPPec(bool on);
/// E Reset the position of an axis
/// <param name="axis">axis number 1 or 2</param>
/// <param name="position">degrees</param>
void SetAxisPosition(int axis, double position);
/// M Set the break point increment
/// <param name="axis">axis number 1 or 2</param>
/// <param name="stepsCount">The steps count.</param>
void SetBreakPointIncrement(int axis, long stepsCount);
/// Turns on or off converting a Dec pulse guide into a Dec GoTo
/// <param name="on"></param>
void SetDecPulseToGoTo(bool on);
/// W 4-5 Turn on off encoders
/// <param name="axis">axis number 1 or 2</param>
/// <param name="on"></param>
void SetEncoder(int axis, bool on);
/// W 6 Enable or Disable Full Current Low speed
/// <param name="axis">axis number 1 or 2</param>
/// <param name="on"></param>
void SetFullCurrentLowSpeed(int axis, bool on);
/// H Set the goto target increment in steps
/// <param name="axis">axis number 1 or 2</param>
/// <param name="stepsCount"></param>
void SetGotoTargetIncrement(int axis, long stepsCount);
/// W 8 Reset the home position index
/// <param name="axis">axis number 1 or 2</param>
void SetHomePositionIndex(int axis);
/// J Start motion based on previous settings
/// <param name="axis">axis number 1 or 2</param>
void StartMotion(int axis);
/// G Set a different motion mode
/// <param name="axis">Axis number 1 or 2</param>
/// <param name="func">'0' high speed GOTO slewing,'1' low speed slewing mode,'2' low speed GOTO mode,'3' High slewing mode</param>
/// <param name="direction">0=forward (CW) right, 1=backward (CCW) left, also based on observatory settings</param>
void SetMotionMode(int axis, int func, int direction);
/// W 2-3 Turn on off PPec
/// <param name="axis">axis number 1 or 2</param>
/// <param name="on"></param>
void SetPPec(int axis, bool on);
/// W 0-1 Turn on off PPEC training
/// <param name="axis">axis number 1 or 2</param>
/// <param name="on"></param>
void SetPPecTrain(int axis, bool on);
/// I Set slewing rate, seems to relate to amount of skipped step counts.
/// <param name="axis">axis number 1 or 2</param>
/// <param name="stepSpeed">StepSpeed = 1 motor step movement, higher counts means slower movements</param>
void SetStepSpeed(int axis, long stepSpeed);
/// Set simulator goto rate
/// <param name="rate">1-20</param>
void SetSimGotoSpeed(int rate);
/// S Set absolute goto target
/// <param name="axis">axis number 1 or 2</param>
/// <param name="position"></param>
void SetTargetPosition(int axis, double position);
/// shutdown and close the server
void ShutdownServer();
/// UnPark mount
void UnPark();