User Tools

Site Tools


tcs:legacy_tcs_socket_communction

This is an old revision of the document!


Overview

Legacy TCS only allows remote telescope communication and control through a serial port on the main TCS computer. In order to allow network communication and control of the telescope we have built software called Telcom to convert tcp/ip sockets to serial communication. To make sure this software is up and running on the BOK telescope you can check the website http://bokpop.as.arizona.edu and look for the table marked telemetry. This webpage queries the telcom server about once a second.

Request syntax

The Telcom server makes 14 pieces of information available.

Description Key Word return synax
Motion Status MOT 0=No motion 1=RA Motion 2=Dec Motion 3=RA and Dec Motion
Right Ascension RA [hhmmss.ss]
Declination DEC [+/-ddmmss.ss]
Hour Angle HA [+/-hh:mm:ss.ss]
Secant z (Air Mass) SECZ [s.ss]
Epoch EQ D[YYYY.YYY]
Julian Date JD [DDDDDDD.D]
Universal Time UT [hh:mm:ss.s]
IIS position IIS [DDD.D] angle in degrees
Local Sidereal Time ST [hh:mm:ss.ss]
Elevation Angle EL [DD.D]
Azimuth Angle AZ [DDD.D]
Dome positoin DOME [DDD.D] this position is relative to the telescope azimuth. To get absolute dome position add this angle to the telescope azimuth.
WOBBLE WOBBLE ???

To retrieve these values simply open a TCP socket to the Telcom server and send a request. The syntax is as follows.

<TELESCOPE ID> TCS <REF NUM> REQUEST <KEYWORD>

For Example:

BOK TCS 123 REQUEST RA

The telcom server will return:

<TELESCOPE ID> TCS <REF NUM> <RETURN VALUE>

For Example:

BOK TCS 123 214412.79

As you can see the RA units are not seperated by colons.

"ALL" keyword

If you want to get multiple pieces of data from the telcom server rapidly you can use the ALL keyword. This will return a string containing all the telemetry data described above which will have to be parsed. The string gives values seperated by 1 or more white spaces. The structure of the string is given in the table below.

Return Values MOT RA DEC HA ST EL AZ SECZ EQ JD WOBBLE DOME UT IIS
Example Value 0 221941.92 +314308.8 -00:00:00 22:20:19 90.0 +7.6 1.00 D2000.000 2456698.3 1 -78.6 20:27:19.1 0.0

It should be noted that all strings returned on the Telcom socket will end with a carriage return (\r).

Command Syntax

The syntax for sending commands to the Telcom server is very similar to sending requests. The syntax looks like:

<TELESCOPE ID> TCS <REF NUM> <COMMAND> <ARG_1> … <ARG_n>

For Example

BOK TCS 123 BIASRA 12.5

This example sets the Right Ascension bias rate at 12.5 seconds per second.

Each command will return:

<TELESCOPE ID> TCS <REF NUM> <ERROR_STATE>

For Example

BOK TCS 123 OK

The <ERROR_STATE> value will be either “OK” or “BAD”. “OK” means the command was understood and “BAD” means the command was NOT understood (not found in the list of commands). “OK” does NOT mean the command was executed. For example, if the Right Ascension is off and you send the command:

BOK TCS 123 TRACKON

Telcom server will return :

BOK TCS 123 OK

But the telescope will not start tracking because it can't when the drives are off.

***For brevity sake the complete list of TCS command will not be written here. Instead they can be found list of network commands

Example Scripts

Below are some sample scripts to communicate with telcom

#!/usr/bin/python
""" A simple python script to  """
import socket
tcs/legacy_tcs_socket_communction.1392234053.txt.gz · Last modified: 2014/02/12 12:40 by scott