CMD p1 p2 p3 p4...<CR>
The CMD portion of the command structure designates the action to be taken. The parameter fields adds additional information necessary to perform the desired action.
Command Response Valid 06 hex (ack) 0d hex (cr) ">" Invalid 15 hex (nak) 0d hex (cr) "Invalid Commande" 0d hex (cr) ">" TABLE 0: Serial Responses
Command Action Parameters KL Total Shutdown - RS Reset Software - PA Power On Board ID PO Power Off Board ID MV Move Motors Absolute position FH Find Home of Motor Motor ID ZC Zero Motor Counter Motor ID ST Status Request - IS Interface Status - CI Calibration Mirror In - CO Calibration Mirror Out - LA Lamp On Lamp ID LO Lamp Off Lamp ID LX Lamp On, Exclusive Lamp ID VA Vacuum Sensor On Vacuum Sensor ID VO Vacuum Sensor Off Vacuum Sensor ID IA Ion Pump On - IO Ion Pump Off - WV Write Vacuum Enable - WO Write Vacuum Disable - DG DeGas Camera Tank - TABLE 1: Command Summary
This state is maintained until ANY command is received from the serial port or console keyboard. The program does not exit. RS (Reset Software) - Not Implemented The RS command is used to remotely reset the motion control software. The command performs a Ctrl-Alt-Del to reboot the motion control computer. The command syntax is:
RS<CR> PA (Power Activate) PA activates power to a specific driver board, or motor controller box. The valid Board IDs for this command are:
RS<CR>
ID Description 1 OptiDriver 1 - Filter wheels, Cal. Mirror 2 OptiDriver 2 - Slit Focus, Echelle Grating 3 OptiDriver 3 - Tip, Tilt 4 OptiDriver 4 - CCD Focus 5 All Low Voltage (5, 10, 24 V) TABLE 2: Power Board IDs
The specified board remains powered until commanded off (see PO) or a shutdown occurs. Only the first Board ID will be processed. PO (Power Off) PO disable power to the specified board. The valid Board IDs for the command are identical to those listed above for PA. Only the first Board ID will be processed per command. MV (Move) The MV command is used to instruct a motor or motors to move a specified distance. The motors move in units of steps. A step is 0.9 degrees of rotation of the motor shaft. The parameter list follows the format:
MV m1 m2 m3 m4 m5 m6 m7 m8<CR>
The parameters are separated by spaces (0x20 hex). Each parameter (m1, m2, m3...) is a motor step or position value. The first 3 motors, calibration mirror, echelle filter and guide camera filter are indexed moves. The remainder of the motors are absolute position moves. If the motor is not to be moved a parameter of "N" (ascii ) should be used. Not all the parameters are necessary. Parameters may be omitted as long as the sequence of the command string is preserved. Examples to follow.
Parameter Description Range (integer steps) m1 Calibration Mirror {0 (out), 1 (in)} m2 Echelle Filter Wheel {1,2,3,4,5,6} m3 Camera Filter Wheel {1,2,3,4,5,6} m4 Echelle Grating (-1000000,1000000) m5 Slit Focus (-1000000,1000000) m6 CCD Tip (-1000000,1000000) m7 CCD Tilt (-1000000,1000000) m8 CCD Focus (-1000000,1000000) TABLE 3: MV Command Parameters
FH mID<CR>
where mID is the motor ID (1 to 8). ZC(Zero Motor Counter) The ZC command is used to reset the hardware counters of the motion control boards to zero. This command is proprietary to laboratory characterization and will not be used by any user of the Echelle Spectrograph. The command syntax is:
ZC mID<CR>
where mID is the motor ID (1 to 8). ST (Status) ST commands the motion control software to transmit information on the position of the motors, lamps and vacuum. The command syntax is:
ST<CR>
IS (Interface Status) IS commands the motion control software to transmit a limited information set on the motor positions and the vacuum conditions. The transmission is a single string delimited by spaces. Keywords are used as a parsing tool. The sting has the following composition:
"KEYWORD=######## KEYWORD=####### .... "
The following table describes the available keywords and their associated information. The order of the keywords in the table is the order in which they appear in the string.
KEYWORD Associated Object CalbMir Calibration Mirror Position EchFltr Echelle Filter Position GCFiltr Guide Camera Filter Position Grating Echelle Grating Motor Position SlitFcs Slit Focus Motor Position TipMotr CCD Tip Motor Position TiltMtr CCD Tilt Motor Position CCDFocs CCD Focus Motor Position VacuumLO Low Vacuum Sensor Reading VacuumHI High Vacuum Sensor Reading IonHV Ion Pump High Voltage Status TABLE 6: Keyword Summary
The command syntax is:
IS<CR> CI (Calibration In) CI commands the Calibration mirror to move into position for calibration to take place. The command syntax is:
IS<CR>
CI<CR> CO (Calibration Out) CO commands the Calibration mirror to move out of the optical path of the Echelle Spectrograph. The command syntax is:
CI<CR>
CO<CR> LA (Lamp Activate) The LA command activates one of 3 lamps used for calibration of the spectrograph. The command syntax is:
CO<CR>
LA lampID<CR>
Once the lamp is activated it will remain active until commanded off (see LO).
lampID Description "F" Fe/Ne Lamp "T" Th/Ar Lamp "W" White Lamp "A" All Lamps (only used with LO) TABLE 5: LA/LO Command Parameters
LO lampID<CR>
Refer to the LA command for a description of parameters. LX (Lamp activate, eXclusive) The LX command activates one of 3 lamps used for calibration of the spectrograph. ALL other lamps are deactivated by this command! It is equivalent to issuing the commands:
LO A LA lampID
LX lampID<CR>
Once the lamp is activated it will remain active until commanded off (see LO). VA (Vacuum Activate) VA commands the motion control software to activate one or both of the echelle vacuum sensors. The command parameters are described in TABLE 7: VA/VO command parameters. The sting has the following syntax:
VA vacuumID<CR>
vacuumID Description "L" Low vacuum sensor "H" High vacuum sensor TABLE 7: VA/VO command Parameters
VO vacuumID<CR>
For valid "vacuumID"s, see VA.
Note: An artifact of the electronics design forces both vacuum sensors to be de-activated when the "VO L" command is given. IA (Ion Activate) IA turns on the ion pump. There are no parameters. IO (Ion OFF) IO turns off the ion pump. There are no parameters. WV (Write Vacuum) WV starts writing vacuum readings to the file "vacuum.log". All data is appended to the file, so there is no danger of overwriting previous data. There is no error checking for disk space, etc. Vacuum readings are recorded every 30 seconds. WV will not turn on or off the vacuum gauges. A timestamp is included for logging purposes.
This command should only be issued from the console! Issuing it over the serial link may not produce expected results! WO (Write Off) WO stops recording vacuum readings to a file. It does not change the state of the vacuum guages. No timestamp is written to indicate logging has stopped.
This command should only be issued from the console! Issuing it over the serial link may not produce expected results! DG (DeGas) DG is a meta-command that moves all camera tank motors limit-to-limit N times, then conducts a "Find Home". This is to allow gasses trapped in the motor windings and threads to be vented. The DeGas procedure requests the # of cycles to run from the keyboard; there are no parameters on the command-line. DeGas can take a long time; for 5 cycles, it is estimated to take well over 1 hour. Once started, the procedure cannot be aborted without rebooting the ACC. This reboot cannot be done remotely.
This command may only be issued from the console! Issuing it over the serial link will result in a locked ACC that is waiting for keyboard input! This state cannot be fixed remotely!
Motor # Name 0...............Calibration Mirror 1...............Echelle Filter Wheel 2...............Guider Filter Wheel 3...............Grating Tilt 4...............Slit Bench Focus 5...............CCD Tip 6...............CCD Tilt 7...............CCD Focus Movement Ranges Motor 0 0 = Out, 1 = IN Motor 1, 2 {1,2,3,4,5,6} Motor 3 - 7 (-1000000, 1000000) [integers only] Note: Actual travel for motors 3 through 7 may be less than stated upper range.
The source code listing includes the Makefile used for MS Visual C++, although it is not recommended to enter this Makefile by hand (it is very long and tedious).
Porting to another compiler should be relatively simple - the only potential pitfalls are the use of <conio.h> for DOS-specific functions (kbhit() and clearscreen()), and whatever is in <afx.h>. There should not be any Visual C++-specific classes used in the code.
Device/Card Address Slot # IRQ # Description OptiStep Card #1 250 4 Disabled Controller for Calibration Mirror and Filter Wheels OptiStep Card #2 260 3 Disabled Controller for Grating and Slit Focus motors OptiStep Card #3 270 2 Disabled Controller for CCD Tip and CCD Tilt motors OptiStep Card #4 280 1 Disabled Controller for CCD Focus motors DAS-1402 Card 2A0 5 N/A A/D Converter for Vacuum and Temperature monitors PIO-24 Card 300 6 Disabled Digital I/O for device power control CTM-05 Card #1 330 7 Disabled Counter Card for encoders CTM-05 Card #2 390 8 Disabled Counter Card for encoders CAT975 N/A 9 IRQ 4 = COM1 386sx Computer Card IRQ 14 = HD IRQ 6 = Floppy IRQ 5 = Parallel Port IRQ 12 = PS/2 Mouse(Disabled)