Xyd may be controlled via a Tcl interface.
To load the Tcl commands into a Tcl interpreter (e.g., tclsh or wish): add the Tcl package directory (set when the software was built) to your auto_path. Then execute the command:
package require -exact xy 0.5Where the final number is the version number, and should be replaced with the appropriate version number.
xy auth
Parameters: (none)
Returns:
status (integer)
statdesc (string)
The user-authentication system is currently not enabled. There is no need to use this function.
xy cancel
Parameters: (none)
Returns:
status (integer)
statdesc (string)
This command cancels a xy movexy , xy moverelxy , xy moverd , xy moverelrd , xy reset , or xy monitorreset command.
| Warning |
This command cannot actually stop the hardware from rebooting. It only stops the daemon from constantly monitoring the reboot. |
xy die
Parameters: (none)
Returns:
status (integer)
statdesc (string)
This commands shuts down the daemon immediately. This command brings down the daemon, regardless of the current state of the daemon. If it is necessary, to shut down the daemon, it is normally better to use shutdown instead. This command is only for use when shutdown fails (e.g., if the daemon is busy, and cannot be interrupted).
| Warning |
Normal users should never need to shut down the daemon. |
xy download
Parameters: (none)
Returns:
status (integer)
statdesc (string)
Download a new boot program to the Galil hardware.
| Warning |
Only the system maintainer should download a boot program. |
xy endtrack
Parameters: (none)
Returns:
status (integer)
statdesc (string)
Stops tracking (non-sidereal guiding).
xy fail
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
This command for debugging purposes only. It always fails and generates an error.
xy focus duration
Parameters:
duration (float)
Returns:
status (integer)
statdesc (string)
id (integer)
Adjusts the focus by a relative amount. duration is the amount of time that the motors should be enabled. Negative values of duration move the focus in the reverse direction.
The focus is not encoded, so positioning is only approximate. The end of travel is not detected.
xy galilconnect
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Force the daemon to connect to the hardware.
| Warning |
The daemon normally connects automatically. The only time that it will not connect automatically, is if the terminal server is rebooted or if the user explicitly uses xy galildisconnect . |
xy galildisconnect
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Force the daemon to disconnect from the hardware.
| Warning |
The only time that the daemon should be disconnected is for system maintenance. |
xy getasync
Parameters: (none)
Returns:
status (integer)
statdesc (string)
async (integer)
Get the current state of the asynchronous mode flag.
xy getbusy
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Get the state of the busy flag. The busy flag is set whenever the daemon is performing an operation that does not complete immediately.
xy getinit0
Parameters: (none)
Returns:
status (integer)
statdesc (string)
init0 (string)
Get the state of the init0 flag. The init0 flag indicates the state of the Galil hardware. If it is DONE then all initialization completed successfully. If it is FAIL then initialization failed. If it is anything else, then initialization is still in progress.
Note that this command only returns the last known value of the init0 flag. Use xy monitorreset or xy readinit0 to force the system to read the flag (normally not necessary unless the hardware has been rebooted). The xy reset command always monitors the reboot.
xy getaction
Parameters: (none)
Returns:
status (integer)
statdesc (string)
action (string)
This command returns a string that is set whenever the daemon is performing an operation that takes a long time to complete (such as moving or focusing). The string provides a brief description of the operation.
xy getnaxes
Parameters: (none)
Returns:
status (integer)
statdesc (string)
naxes (integer)
This command returns the number of axes that is supported by the controller.
xy getrd
Parameters: (none)
Returns:
status (integer)
statdesc (string)
ra (float)
dec (float)
This command returns the current position of the xy stage, in the current relative R.A. and Dec coordinates.
It is generally wise to call xy readrotang before invoking this function.
xy getrotang
Parameters: (none)
Returns:
status (integer)
statdesc (string)
rotang (float)
Get the daemon's current value of the rotator angle.
xy getscale
Parameters: (none)
Returns:
status (integer)
statdesc (string)
scaleid (integer)
scalefactor (float)
scaledescr (string)
Get the current scale factor that is used to convert from R.A. and Dec offsets to encoder units.
scaleid is the index which identifies the currently active scale factor (0-9).
scalefactor is the numeric value of the scale factor.
scaledescr is a text description of the scale factor.
xy getscaleinfo ind
Parameters:
ind (integer)
Returns:
status (integer)
statdesc (string)
scaleid (integer)
scalefactor (float)
scaledescr (string)
Get the information for the specified scale factor.
ind is the index of the desired scale factor.
scaleid is the index which identifies the currently active scale factor (0-9). (This should be identical to ind. It is provided as a convenience, so that xy getscale and xy getscaleinfo provide identical data.)
scalefactor is the numeric value of the scale factor.
scaledescr is a text description of the scale factor.
xy getswitches
Parameters: (none)
Returns:
status (integer)
statdesc (string)
swx (integer)
swy (integer)
swxstr (string)
swystr (string)
Get the current value of the Galil hardware switches.
swx and swy return the numeric values of the switches.
swxstr and swystr return a text equivalent of the switches that is intended to be slightly more readable for humans.
xy gettracking
Parameters: (none)
Returns:
status (integer)
statdesc (string)
tracking (integer)
Get the current state of the tracking flag.
The tracking flag is set whenever the system is tracking (non-sidereal guiding).
xy gettrackrate
Parameters: (none)
Returns:
status (integer)
statdesc (string)
rarate (float)
decrate (float)
Get the current value of the rate variables for tracking (non-sidereal guiding).
xy getversion
Parameters: (none)
Returns:
status (integer)
statdesc (string)
version (string)
Get the current version of the Galil hardware.
xy getxy
Parameters: (none)
Returns:
status (integer)
statdesc (string)
x (integer)
y (integer)
Gets the position of the xy stage in encoder units.
xy gread parm
Parameters:
parm (string)
Returns:
status (integer)
statdesc (string)
id (integer)
Updates the current value of a Galil hardware parameter.
The following parameters are supported: speed, accel (acceleration/deceleration), errlim (error limit), integ (integration servo parameters), gain (servo gain).
Note that this command only modifies the internal state of the daemon, and does not return the current value.
xy gget parm
Parameters:
parm (string)
Returns:
status (integer)
statdesc (string)
xval (integer)
yval (integer)
Gets the current value of a Galil hardware parameter.
The parameters are the same as are listed for gread.
xy gset parm xval yval
Parameters:
parm (string)
xval (integer)
yval (integer)
Returns:
status (integer)
statdesc (string)
id (integer)
Sets the current value of a Galil hardware parameter.
The parameters are the same as are listed for gread.
xy monitorreset
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
If the hardware is currently resetting, continuously check the state of the INIT0 flag.
xy moverd ra dec
Parameters:
ra (float)
dec (float)
Returns:
status (integer)
statdesc (string)
id (integer)
Move the xy stage, using R.A. and Dec offsets relative to the origin of the xy stage.
It is generally a good idea to use xy readrotang before calling xy moverd .
xy moverelrd ra dec
Parameters:
ra (float)
dec (float)
Returns:
status (integer)
statdesc (string)
id (integer)
Move the xy stage, using R.A. and Dec offsets, relative to the current position.
It is generally a good idea to use xy readrotang before calling xy moverelrd .
xy moverelxy x y
Parameters:
x (integer)
y (integer)
Returns:
status (integer)
statdesc (string)
id (integer)
Move the xy stage, using encoder units, relative to the current position.
xy movexy x y
Parameters:
x (integer)
y (integer)
Returns:
status (integer)
statdesc (string)
id (integer)
Not written.
xy readback
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Read back the current Galil start up code.
This is primarily used to verify that download worked correctly. It should not necessary to use it for any other purpose.
xy readinit0
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Updates the current value of the init0 flag.
This command does not return a value to the user. It only updates the internal state of the daemon. Use xy getinit0 to get the value of the init0 flag.
xy readrd
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
This is identical to the xy readxy command, and is provided only for completeness.
xy readrotang
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Read the current rotator angle from the TCS controller.
xy readswitches
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Read the current values of the Galil hardware switches.
xy readxy
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Force the daemon to re-read the position of the x and y axes from the hardware. Note that under normal circumstances, this is not necessary, because the daemon keeps track of when the x and y axes are changed. This command only updates the internal state of the daemon, and does not return the value to the user. To get the current value, use getxy.
xy reset
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Force a Galil hardware reset and monitor the init0 variable until the reset completes.
xy setasync async
Parameters:
async (integer)
Returns:
status (integer)
statdesc (string)
Sets the value of the asynchronous mode flag.
xy setrotang rotang
Parameters:
rotang (float)
Returns:
status (integer)
statdesc (string)
Manually set the value of the rotator angle.
xy setscale scaleid
Parameters:
scaleid (integer)
Returns:
status (integer)
statdesc (string)
Select one of the scale factors (0-9). Use xy getscaleinfo to get a description of the available scale factors.
xy settrackrate rarate decrate
Parameters:
rarate (float)
decrate (float)
Returns:
status (integer)
statdesc (string)
Set the R.A. and Dec offset rates (marcsec / s)
xy shutdown
Parameters: (none)
Returns:
status (integer)
statdesc (string)
This commands shuts down the daemon, after verifying that the daemon is in an idle state (i.e., that no mechanisms are moving).
| Warning |
Normal users should never need to shut down the daemon. |
xy track
Parameters: (none)
Returns:
status (integer)
statdesc (string)
id (integer)
Start tracking (non-sidereal guiding).
It is generally a good idea to use xy readrotang before calling xy track .
xy wait id
Parameters:
id (integer)
Returns:
status (integer)
statdesc (string)
wid (integer)
wcode (integer)
wdescr (string)
Wait until any current actions are complete, then return the status of the action with the specified id.
status and statdesc describe the status of the wait command
wid, wcode, and wdescr are the id, status, and status description of the specified command.
Normally, xyd will never send any data to a client application, except as a response to a command. However, if the client application sets the asynchronous mode flag using the setasync command, the xy_cmd_do_setasync() function, or the xy setasync Tcl command, xyd will inform the client application when an operation has completed or when a various variables are changed.
The user may process asynchronous DONE messages by using the xy -commanddone command to define a done handler, which is a function which takes three arguments: id, code, and descr, which is followed by a variable number of optional arguments.
The user may process asynchronous UPDATE messages by using the xy -commandupdate command which is a function which takes two arguments. The first argument identifies the variable that changed, and the second give the new value.
After defining handlers, the user should arrange for the function xy -checkasync to be called periodically.
If the user has enabled asynchronous mode, it becomes the user's responsibility to call xy -checkasync sufficiently often (approximately once per second is reasonable). Otherwise, communications between the client and server can become corrupted.