This is the TAURUS II U-TASK. It provides full control over the taurus II micro and/or a system status display 1 PARAMETERS 2 etalon_door Current state of the etalon wheel access door read only (OPEN or CLOSED) 2 pupil_door Current state of the pupil wheel access door read only (OPEN or CLOSED) 2 fpfw_door Current state of the focal plane filter wheel access door read only (OPEN or CLOSED) 2 aw_door Current state of the focal plane aperture wheel access door read only (OPEN or CLOSED) 2 tau_pres_os Pressure outside taurus II read only in millibars 2 tau_pres_et Pressure in the etalon plane read only in millibars 2 tau_temp_et Temperature of the etalon currently being servoed read only in degrees celsius 2 tau_temp_fp Temperature in the focal plane read only in degrees celsius 2 tau_temp_os Temperature outside TAURUS II read only in degrees celsius 2 fp_filter The focal plane filter Specify filter 1 to 8 or a prevously defined name of that filter. Default names are ONE, TWO ... EIGHT. Define name with the define filter command. use '?' to get the list of filter names 2 set_aperture The focal plane aperture Specify aperture 1 to 8 or a prevously defined name of that aperture. Default names are ONE, TWO ... EIGHT. Define name with the define filter command. use '?' to get the list of aperture names 2 etalon_path The etalon in the light path Specify etalon 1 to 6 or a prevously defined name of that etalon. Default names are ONE, TWO ... SIX. Define name with the define filter command. use '?' to get the list of etalon names 2 etalon_table The etalon in the light table (etalon access position) Specify etalon 1 to 6 or a prevously defined name of that etalon. Default names are ONE, TWO ... SIX. Define name with the define filter command. use '?' to get the list of etalon names 2 pp_filter The pupil plane filter in the light path Specify filter 1 to 8 or a prevously defined name of that filter. Default names are ONE, TWO ... EIGHT. Define name with the define filter command. use '?' to get the list of filter names 2 pupil_table The pupil plane filter in the light table (access position) Specify filter 1 to 8 or a prevously defined name of that filter. Default names are ONE, TWO ... EIGHT. Define name with the define filter command. use '?' to get the list of filter names (read only) 2 filter_tilt Focal plane filter tilt (can be 0 to 16 (degrees), 16 = disengaged, -1 = position unknown) 2 iris_position Iris size (can be 1 to 15 (cm), -1 = position unknown) 2 camera_focus Camera focus length (can be 0 - 900 (range of 6 mm), -1 = position unknown) 2 fpfw_detent Focal plane filter wheel detent (IN or OUT) 2 pfw_detent Pupil plane filter wheel detent (IN or OUT) 2 aw_detent Focal plane aperture wheel detent (IN or OUT) 2 erw_detent Etalon rotator wheel detent (IN or OUT) 2 cs_reset CS100 reset, always OFF after setup but can be monetarly reset. (ON or OFF (logical)) 2 loop_status Current status of the cs100 loop Do not confuse with the parameter CS_LOOPS which is used to close or open the loops. This parameter is the current status of the loop which may differ from CS_LOOPS due if the cs100 is reset, not in external mode etc. read only (OPEN or CLOSED (logical)) 2 overload TRUE on etalon overload, FALSE otherwise. (logical) 2 x_offset The setting for the cs100 etalon x offset (range -2048 to 2047) 2 y_offset The setting for the cs100 etalon y offset (range -2048 to 2047) 2 z_offset The setting for the cs100 etalon z offset (range -2048 to 2047) 2 CS_loop_gain The setting for the cs100 etalon loop gain (range 0 to 9) 2 cs_time_con The setting for the cs100 etalon time constant (range 0 to 9) 2 cs100_external cs100 eternal mode ON - set cs100 external mode on, computer control OFF - set cs100 external mode off, front panel control (logical) 2 cs_integ The setting for the cs100 integrator (IN or OUT (logical)) 2 cs_loops Setting of cs100 loops Do not confuse with the parameter LOOP_STATUS which is is the current status of the loop which may differ from CS_LOOPS if the cs100 is reset, not in external mode etc. (OPEN or CLOSED (logical)) 2 sel_servo The servoed etalon Specify etalon 1 to 6 or a prevously defined name of that etalon. Default names are ONE, TWO ... SIX. Define name with the define filter command. use '?' to get the list of etalon names 2 cur_state The current utask state (read only, see HELP STATES for a list of states) 2 door_interlock Select door interlock overrides NORMAL motors may not be run, and the shutter may not be opened with one or more doors open MOTOR O/R motors may be run, but the shutter may not be opened with one or more doors open SHUTTER O/R motors may be run and shutter opened with one or more doors open 2 inlet_value The setting for the gas inlet valve (OPEN or CLOSED (logical)) 2 outlet_value The setting for the gas outlet valve (OPEN or CLOSED (logical)) 2 inlet_value The setting for the gas inlet valve (OPEN or CLOSED (logical)) 2 shutter specifiy setting for the shutter OPEN for open shutter Anything else to close shutter 2 oper_shutter The setting of the shutter (OPEN or CLOSED (logical)) 2 expose_time Exposure time in seconds (Real, but only integer second value used) 2 cmd_line Line of text to be sent to micro by the CMD action 3 micro_cmds di door interlock overrides rx radix used in commands and status iv gas inlet valve ov gas outlet valve sh shutter xs CS100 xs position ys CS100 ys position zs CS100 zs position ga CS100 gain tc CS100 time constant en CS100 external control ig CS100 integrator rc CS100 reset cl CS100 servo loop sv CS100 high voltage sr etalon slow run fw focal plane filter wheel aw aperture wheel lt number of er position in light table pw pupil plane filter wheel pl pupil plane filter wheel position in light table ew etalon wheel fd fpfw detent ad aw detent pd pfw detent ew erw detent in tilt is iris cf camera focussing ft focal plane temp et etalon temp ot outside temp ep etalon pressure op outside pressure lp etalon loop open or closed fl fpfw door open al aw door open pl pfw door open el etalon door open lk reset after a door has been opened sf selective fill of etalon array if increment fill of etalon array af automatic fill of etalon array fi output etalon array fr etalon fast run ar etalon automatic run ?s store cs100 settings !s restore cs100 settings os go through zero ex open shutter of specified number of seconds io set new input device od return to original input device lg start logging ?a do not send status codes !a send status codes ps output all status values am abort motor operation qu quit taurus 2 setup_file Current setup file (default file type .TSF) Only a file previously produced by the UTASK is valid. Use # to select default file name which is TAU_SETUP.TSF or the presiously specified file. 2 filter_file Filter definition file (default file type TFD) Use # to select default file name which is TAU_SETUP.TFD or the presiously specified file. When asked for a filter file to be associated with a setup file. use ^ to specify the same name assuming default filetypes. ^ should not be used if the default filetype are not being used. A filter definition file produced by the UTASK can be edited and used a new input file. Format example * test file FILTER FOCAL 2 GREEN 3 RED ENDFILTER FILTER ETALON 5 JOHN 6 FRED ENDFILTER This defines focal filter position 2 as GREEN, position 3 as RED, ETALON 5 as JOHN and ETALON 6 as FRED. A * causes the rest of the line to be ignored. If the first character of the first line is a * then that line is used as the title and is placed in the fcomment parameter. Defintions should not start with a number and must be in upper case. 2 array_file File to Store an etalon array. (Default file type TEA) Only a file previously produced by the UTASK is valid. Use # to select default file name which is TAU_ARRAY.TEA or the presiously specified file. 2 fcomment Comment to be placed in or taken from a filter definition file 2 scomment Comment to be placed in or taken from a setup file 2 acomment Comment to be placed in or taken from an etalon array file 2 fdate Creation date of filter file 2 sdate Creation date of setup file 2 adate Creation date of array file 2 def_filter One off wheel position definitions format examples "FOCAL 4 BLUE" "APERTURE 3 TWENTY" "PUPIL 3 RED" "ETALON 2 IR" Defintions should not start with a number. 2 af_start Automatic fill of etalon array start position 2 af_incr Automatic fill of etalon array increment 2 sf_element Selective fill of etalon array, array element 2 sf_data Selective fill of etalon array, value to be placed in element 2 stop_act Action to be stopped by the STOP action (SLOW_RUN, AUTO_RUN, PASSTHROUGH) 2 log_act Actions to be logged Messages from microprocessor - FROM_MICRO Messages to microprocessor - TO_MICRO All messages from/to micro - BOTH STop logging - STOP 1 STATES In this section, individual details of utask states are given. Commands valid in all states Exit Exit taurus utask, exit os9 system taurus software (CRTL-Z) SHUTTER Open/close shutter (PF4) Close shutter (DO) LOG Enable/disable logging of microprocessor communications (F17 = LOG BOTH) 2 INITIAL This is the initial utask state entered on startup. Only the default commands EXIT, HELP etc. may be entered. When initialization of taurus is complete the state will be changed to MAIN_MENU 2 MAIN_MENU The default state, gives a status display of general information on the status of taurus. 3 SETUP Enter the setup control state (KP7) 3 CS100 Enter the cs100 control state (KP8) 3 RUN Enter the etalon run control state (KP9) 3 MISC Enter the miscellaneous menu (KP minus) 2 SETUP_1 Position wheels, iris, tilt etc. Define wheel position names 3 MAIN_MENU Return to the main menu (PF1,KP7) 3 CS100 Enter the cs100 control state (KP8) 3 RUN Enter the etalon run control state (KP9) 3 MISC Enter the miscellaneous menu (KP minus) 3 FOCAL Select focal filter (KP4) 3 PUPIL Select pupil filter (KP5) 3 APERTURE Select aperture (KP6) 3 ETALON Select etalon in light path (KP comma) 3 LIGHT_TABLE Select etalon in light table (KP1) 3 TILT Position focal plane filter tilt (KP2) 3 IRIS Select iris size (KP3) 3 CAMERA Select camera focus distance (ENTER) 3 INTERLOCK Set door interlocks (KP0) 3 RETRY Abort all current motor operations and retry This command is designed to help in error recovery. The AM (abort motor operation) command is sent to the micro attempts are made to reposition all motors that have timed out, or whose position is unknown. (KP period) 3 SETF Define wheel position names (F18) 3 OUTF Output wheel position names (F19) 3 NEXT_MENU Change to setup menu 2 (F20) SETUP_2 Load and save instrument setups, wheel position definitions and the etalon array. The current setup, array and filter definition filenames, comments and creation dates are displayed. 3 MAIN_MENU Return to the main menu (PF1,KP7) 3 CS100 Enter the cs100 control state (KP8) 3 RUN Enter the etalon run control state (KP9) 3 MISC Enter the miscellaneous menu (KP minus) 3 SETUP Return to SETUP_1 menu (F20) 3 LOADA Load the etalon array from a file (.TEA) (KP4) 3 SAVEA Save the etalon array to a file (.TEA) (KP5) 3 OUTA Output the etalon array to the terminal (KP6) 3 LOADF Load wheel position definitions from a file (.TFD) (KP1) See HELP PARAMETER FILTER_FILE to determine the file format. 3 SAVEF Save wheel position definitions to a file (.TFD) (KP2) See HELP PARAMETER FILTER_FILE to determine the file format. 3 OUTF Output wheel position definitions to terminal (KP3) 3 SETF Define a wheel position (KP0) Format "WHEEL POSITION DEFINITION" Where wheel = FOCAL, APERTURE, ETALON or PUPIL (only first letter required), POSITION is the number of the position you wish to define, Definition is the definition of the position. The first letter must not be a number. 3 LOADS Load a setup from a file (.TSF) (KP period) 3 SAVES Save a setup to a file (.TSF) (KP enter) 2 MOTOR_MOD The state is selected while the motors are being repositioned. Since the state should not be changed while in this state, the state change commands are disabled. Other commands are as per the SETUP_1 state. When there is not longer any motors being moved the state is returned to SETUP_1 2 CS100 Setup of the CS100 is carried out from this state. All settings are displayed 3 SETUP Enter to SETUP menu (KP7) 3 MAIN_MENU Return to the main menu (PF1,KP8) 3 RUN Enter the etalon run control state (KP9) 3 MISC Enter the miscellaneous menu (KP minus) 3 XSET Set the CS100 x offset (KP4) 3 YSET Set the CS100 y offset (KP5) 3 ZSET Set the CS100 z offset (KP6) 3 GAIN Set the CS100 loop gain (KP comma) 3 TIME_CON Set the CS100 loop time constant (KP1) 3 EXTERNAL Enable/disable CS100 external control (KP2) 3 INTEGRATOR Set the cs100 integrator function IN or OUT (KP3) 3 RESET Momentarly reset the CS100 (enter) 3 CLOSE_LOOPS Open/close CS100 loops (KP0) 3 SERVO Select the etalon to be servoed (KP period) 2 RUN Filling of the etalon array, selection of the run type and loading of setups are made from this state 3 SETUP Enter to SETUP menu (KP7) 3 CS100 Enter the cs100 control state (KP8) 3 MAIN_MENU Return to the main menu (PF1,KP9) 3 MISC Enter the miscellaneous menu (KP minus) 3 SLOW_RUN Execute an IPCS slow etalon run (status updated)(kp4) 3 FAST_RUN Execute an IPCS fast etalon run (no status update)(KP5) 3 AUTO_RUN Execute an automatic etalon run. (KP6) Ramp etalon up and down etalon array. Status updated 3 AFILL Automatic fill of etalon array. (kp1) Array channel #1 = af_start Array channel #a (1 < a < 256) = af_start + a*af_step 3 SFILL Selective fill of etalon array (KP2) Array channel sf_element = sf_data 3 OUTA output the etalon array to the terminal (KP3) 3 ZSET Set the cs100 z offset (KP0) 3 SERVO Select the etalon to be servoed (KP period) 3 LOADS Load a setup from a file (.TSF) (KP period) 2 SLOW_RUN Entered during an IPCS slow run. Exits after an etalon overload, 0 from the IPCS or STOP SLOW_RUN command 3 STOP SLOW_RUN Stop an IPCS slow run (PF1) 2 AUTO_RUN Entered during an Automatic etalon run. Exists after an etalon overload or a STOP AUTO_RUN command. 3 STOP AUTO_RUN Stop an automatic etalon run. (PF1) Note it may take some time for this to take affect. 2 FAST_RUN Entered during an IPCS fast run. Exists only after a zero is received from the IPCS. (If this does not occur for some reason pushing the panic button will cause an exit) 2 MISC Provides status display and commands for functions that are not normally required or do not belong to another state. 3 SETUP Enter the setup control state (KP7) 3 CS100 Enter the cs100 control state (KP8) 3 RUN Enter the etalon run control state (KP9) 3 MAIN_MENU Return to the main menu (PF1,KP minus) 3 EXPOSE Start an exposure (KP5) (open shutter for a specified number of seconds) 3 VALVES Operate the gas valves (KP6) 3 DETENT Operate the detents. (KP7 comma) 3 CMD Send a command to the TAURUS II microprocessor (KP 1) 3 PASSTHROUGH Stop interpreting messages from micro (KP2) All messages from the micro will be displayed but not interpreted 3 STOP PASSTHROUGH Revert to interpreting messages from the microprocessor (KP3) 3 LOG Enable/disable logging of microprocessor communications (KP4) (F17 = LOG BOTH) 2 DETENT_MOD The state is selected while the detent motors are being repositioned. Since the state should not be changed while in this state, the state change commands are disabled. Other commands are as per the MISC state. When there is not longer any motors being moved the state is returned to MISC. 2 PANIC This state is entered after reception of a panic interrupt message. 3 PANIC Continue after panic. (PF1) Any motor that was panic stopped will be returned to its correct position The shutter will be closed. 2 PANIC_RECOVERY This state is entered while reseting taurus after a panic interrupt. When all motors are in there correct position state will revert to the MAIN_MENU. Selective fill of etalon array, value to be placed in element 2 stop_act Action to be stopped by the STOP action (SLOW_RUN, AUTO_RUN, PASSTHROUGH) 2 log_act Actions to be logged Messages from microprocessor - FROM_MICRO Messages to microprocessor - TO_MICRO All messages from/to micro - BOTH STop logging - STOP 1 STATES In this section, individual details of utask states are given. Commands vasms_doc.txt 664 516 17 142205 6430174650 6354 SCIENCE AND ENGINEERING RESEARCH COUNCIL AON/4.8 ROYAL OBSERVATORY EDINBURGH and UNIVERSITY OF EDINBURGH ADAM Project Issued by ADAM Observer Note 4.8 J A Cooke 25 January 1989 ---------------------------------------------------------------------- Using the ADAM Screen Management System --------------------------------------- The Screen Management System (SMS) is a user interface for ADAM. This document describes SMS in outline, how to use it, and how to write the control tables which configure it. Intended readership: observers; programmers writing SMS control tables This document has been revised for SMS version 1.2. Contents page Recent enhancements 2 1. Introduction 3 2. An outline of SMS 3 3. How to use SMS 5 4. How to write control tables for SMS 9 5. Stand-alone table compiler 11 6. Features of the system which may change 11 Appendices A: Specification of the control table entry types 12 B: An example control table 27 - 1 - AON/4.8 Page 2 RECENT ENHANCEMENTS Enhancements to SMS made in 1988 to date are: o The CLI prompt is now configurable using "cli_prompt" o Prompts and "information" output are now logged o The stand-alone table compiler now produces formatted printouts of menus and parameter lists which provide hardcopy for previews or documentation. o Inline editing of parameter list items has been added o An "expert user" facility has been added o SMS may now be configured to provide one-line help automatically as the cursor is moved around menu items or parameter list entries o Bugs in the routine which handles SMS parameter substitution causing integer overflow errors have been fixed; errors in parameter substitution are now reported. o The internal mechanism for SMS system configuration changes made using the keypad "COMMA" key facility has been changed. To make use of this facility, new "+config+" entries are needed in the system part of the control table. See the example in Appendix B. o Equivalences have been set up for those using SMS on a VT220 terminal as follows (by JHF@JACH): VT100 key VT220 key ENTER NEXT_SCREEN PF1 DO PF2 INSERT_HERE PF3 FIND PF4 PREV_SCREEN keypad "." key SELECT "?" key HELP "ctrl-U" REMOVE o Help entries can include the help file name (by JHF@JACH). o Continuation lines can be used within action entries. o A file "include" facility has been added. - 2 - AON/4.8 Page 3 1 INTRODUCTION SMS is a part of the ADAM system. It is one of the user interfaces on the system, and is intended to be a general purpose user interface. It is general purpose because the same program (SMS) can be configured to give different views of the ADAM system to the user at a terminal. For example, there could be an SMS configuration set up for one particular instrument. Note that SMS was originally designed for VT100 or VT100 compatible terminals, but is now implemented on top of the DEC screen management facility. SMS can be used for instrument control, data acquisition and data analysis. In the ADAM system these functions are accomplished in the command language (e.g. ADAMCL) by issuing commands. SMS can be used to package these commands in more complex ways than is possible in command language procedures, so that, for example, by selecting a single menu item from several displayed on the screen, a particular set of command language commands would be issued. 2 AN OUTLINE OF SMS SMS provides a menu-driven control system which has a user-defined structure; it can be set up to be hierarchical but this is not essential. The structure is defined in a "control table". Menu entries may select other menus, or parameter lists, or actions. Menus and parameter lists are "pasted" on the terminal screen, with the most recently used item on top. The layout is determined by the SMS control table, so these may or may not overlap. SMS is mostly single keystroke driven; for example, the arrow keys to move the cursor, or the keypad keys for a whole range of functions. Note in particular the use of the "PF" keys of the VT100 terminal; the current function of these keys is always shown in status fields at the bottom of the screen (in the default control table). The user can be prompted for information as a result of some SMS operations or in response to requests from tasks. During prompting, the "current position" of the cursor on a menu or parameter list display is marked by a reversed video block. This enables the user to see where he has got to in the menu or parameter list. 2.1 Definitions A "menu" is simply a list of items which are displayed on the screen in any rectangular format, with or without a box drawn around them. The screen cursor points at menu items; by using the "arrow" keys on the terminal the cursor can be made to jump around the menu items. Pressing the "ENTER" key selects a menu item; pressing the "PF1" key - 3 - AON/4.8 Page 4 escapes from the menu. A "parameter list" has one or more parameter entries whose values may be set either to one of a set of predefined constants or to a single typed value as required. An "action" can be one or many command language commands; the actual commands are defined in the SMS control table being used. Values from parameter list entries may be substituted in the command language commands before they are executed. Both menus and parameter lists can have actions set up which will be executed on entry or on exit, so that, for example, after SMS parameters have been set up in a parameter list the appropriate command language commands can be executed to change the state of an instrument according to the parameter values selected. On pressing "PF1" to exit, these actions are executed; on pressing "PF4", the menu or parameter list is left but the actions are not executed. 2.2 Macros SMS is a macro system; in fact, a "keystroke" macro system, something like a programmable calculator. At any time the system can be asked to "learn" a macro as a set of keystrokes; this macro can then be assigned to one of the keypad numeric keys. The macro can then be "called" at any time by pressing the appropriate keypad key. This allows, for example, a particular place in the SMS menu tree to be "remembered" as a macro keystroke, and subsequently returned to at any time by pressing the correct keypad key. It also allows a whole instrument configuration to be "remembered" as a macro and re-used on the following night. (Macro definitions can, of course, be stored in files). Note that macros can be called from within other macros, but users defining macros should be careful about possible recursion. For some applications, macros may be unnecessary and the possibility of using them inappropriate. The macro function of SMS can be turned off by an entry in the control table. 2.3 Online Help SMS uses the ADAM "help" system. At any time help may be requested by typing the "?" key. The help given is controlled from entries in the control table for each menu item and each SMS parameter, and two levels of help information may be accessed as required. This help information is extracted from the ADAM help structure. More detailed help on the use of SMS itself may be obtained by pressing the keypad "-" key, unless this help information has been removed or replaced by the person who constructed the control table being used. - 4 - AON/4.8 Page 5 It is possible to configure SMS to give "one-line" help automatically, through an entry in the system part of the control table. This facility can also be turned on or off whilst SMS is running through the configuration menu (see 2.5). 2.4 Direct Command Language Commands SMS allows single command language commands to be issued at any time by pressing the keypad "." key; this gives a prompt for the command. This of course may also allow access to DCL commands through the command language. Commands prefixed by "$" are sent to DCL for interpretation. 2.5 SMS System Configuration SMS allows some interactive configuration of its behaviour by pressing the keypad "," key; this enters a parameter list which allows the SMS "beep" to be turned on and off, allows the automatic one-line help facility to be turned on or off, allows the SMS "scroll region" to be made temporary or permanent (in which case it is not erased on new keyboard input), and also allows redirection of scroll region output to other terminals (this feature is disabled at present; redirected output will not be displayed). The current ADAM help file may also be selected here (but note that "exit" and not "quit" must be used to set it up). 3 HOW TO USE SMS The bare essentials needed to run SMS are: - a VT100 compatible terminal to run it on (or a terminal set up with appropriate features specified in an SMG 'TERMTABLE' - SMS itself on a full or partial ADAM system - a "control table", pointed to by the logical name "SMSTABLE" - an associated ADAM help file (which is an HDS structure), pointed to by the logical name "ADAM_HELPFILE" The logical names must be set up before starting up. SMS is started by typing the ADAM-defined symbol "SMS" in response to the VAX DCL prompt: $ ADAMSTART - 5 - AON/4.8 Page 6 $ SMS This starts up the system, displays the "welcome" page, and then compiles the control table. Once the table is compiled (large tables take several seconds) the top level (or root) menu of the table is displayed on the terminal screen. You are now ready to start using SMS. The terminal cursor will be positioned on the first item in the top-level menu. By positioning the cursor using the terminal's "arrow" keys, you can point at the various items in the SMS displays; by using the terminal's keypad you can execute functions of the SMS system. Most of the time, ordinary alphanumeric keys have no effect on the system, apart from simply counting as a keystroke; any keystroke which is not recognised can be made to sound the terminal bell (or, more usually, beep); this is normally the default setting. 3.1 Obtaining Online Help Help information must be provided along with the control table by the author of the control table in use. Normally, there is existing help available about how to use SMS, obtained by pressing the "MINUS" key, but help for any application must be written and set up in an ADAM help file. "One-line" help information on the item indicated by the cursor is given if the "?" key is pressed; if this key is pressed again, any "full" help information is written into the screen scrolling region. "One-line" help is given for EVERY menu or parameter list entry automatically if the automatic help feature is enabled. This feature is disabled by default; it may be enabled or disabled explicitly in the "fields" entry of the control table, and may also be enabled or disabled whilst SMS is running (section 2.5). The help line is removed by pressing keys other than the "arrow" keys and the entry/exit control keys; this is simply a feature of SMS. 3.2 The Terminal Keypad The VT100 keypad contains the following: four "programmable function" or "PF" keys; ten digit keys; an "ENTER" key; and three punctuation keys, "MINUS", "COMMA" and "DOT". The use of these keys in SMS is as follows: 3.2.1 The ENTER Key - The ENTER key is used to select a menu item. In a menu display, the cursor will be lying on one of the menu items; pressing ENTER will cause one of three things to happen. If the menu - 6 - AON/4.8 Page 7 item points to another menu, then this new menu will be displayed. If the menu item points to a parameter list, then this parameter list will be displayed. If the menu item corresponds to an SMS action, then this action (a series of command language commands) will be executed. In each case, the menu item will be highlighted until either exit from the new display or termination of the action. 3.2.2 The PF Keys - The function of these keys varies, but is always indicated on the screen (at the bottom of the screen, by default). 3.2.3 The DOT Key - Pressing the DOT key makes SMS give the command language prompt which allows any single command language command to be given. 3.2.4 The COMMA Key - allows the user to configure some SMS system parameters, described in 2.5. 3.2.5 The MINUS Key - Pressing the MINUS key normally enters a help menu which gives help on the SMS system. This should be self explanatory. Press "exit" (PF1) to leave this menu, as "quit" (PF4) will not restore the help file needed for the control table in use. Note that the author of the control table in use may have supplied an alternative to the default SMS help menu. 3.2.6 The Digit Keys - These keys are used to run pre-defined macros. See 2.2, "Macros". 3.3 Refreshing The Screen The SMS screen display may be refreshed at any time (e.g. after a system broadcast message) by pressing "ctrl-R". 3.4 Parameter Lists If you enter a parameter list, then the parameters there are set in one of two ways. If the control table specifies a set of possible values for the parameter, then the value required is selected simply - 7 - AON/4.8 Page 8 by using the "arrow" keys: up or down to select the parameter, left or right to select a particular value. If the control table specifies just one value, then this value may be altered as follows: "LF" (ctrl-J) or "ctrl-U" will delete the current value, characters typed will appear at the cursor position, and the "DEL" key allows the character to the left of the cursor to be deleted. The left and right "arrow" keys may be used to perform "in-line" editing, with insert/overstrike modes toggled using "ctrl-A". The parameter values given in the parameter list may be set up by a mechanism which interrogates named tasks for the values of named parameters or from a command language variable; for examples of this see the "switch" field specification in Appendix A. The syntax is simply to specify "from taskname parametername" or "from adamcl variablename" on the line following the parameter definition in the list. 3.5 Control-C Behaviour Pressing "control-C" on the keyboard can be used to interrupt the user interface. The effects of this are as follows: Macros: the macro is aborted at the present point; the screen display is not changed Parameter requests: this is equivalent to "!!" (cancel) The command language is also interrupted, and will interrupt command language procedures The message "Cancel" is echoed on the terminal screen; this can be removed by typing "ctrl-R" ("refresh"). 3.6 Expert User Facility WARNING: control tables intended for use with this facility must be designed very carefully! It is possible to configure SMS to enable an "expert" user who knows the control table names for menus and parameter lists used internally by SMS to "jump" to a named menu or parameter list. This is done by pressing the DOT key (section 2.4) and using the escape character "@" to prefix a menu or parameter list name. SMS will then paste up the named menu or parameter list, just as a normal entry to such. Pressing "exit" will unpaste the new display and return to where SMS was before; stacking operates as normal. A well-designed control table should not normally need to use this feature, but it may be useful to an expert using a particularly complicated system. This - 8 - AON/4.8 Page 9 facility is disabled by default; it may be enabled or disabled explicitly in the "fields" section of the control table. 4 HOW TO WRITE CONTROL TABLES FOR SMS The format of menus displayed on the screen, the switchable parameters used in SMS, the ADAM commands sent by SMS, and the definition of the function of parts of the screen are all defined in an ASCII text file called the "control table". This file is read by SMS at run-time and compiled into an internal, quickly accessed form. (It will be possible eventually to save the compiled form of the table so that SMS will start up faster.) To create a control table you use a text editor. The best plan is to take the useful parts from an existing table to save re-typing them. The control table syntax is fairly straightforward but it is best to look at an example to see what a control table looks like; for example, the table in appendix B. At present all the SMS configuration is in one control table. It is likely that in some future release the first part of the configuration will be removed to a separate control table, as the first part relates to the screen positions of essential parts of the SMS system, such as the position of the text describing the "PF" key functions. The rest of the configuration relates to the menus, parameter lists and actions for a particular application. Thus there are currently four types of entry in a control table. These are introduced by the following keywords: fields - the definitions for the location of SMS system information on the screen. There will only be one "fields" entry. menu - a menu definition entry switch - a "parameter list" entry action - an entry with containing one or more command language commands These keywords MUST be in lower case starting in the first character position on the line. Comments may appear in the control table, identified by "*" in the leftmost character position. Items on the lines in the table may be separated by spaces or tabs or both. - 9 - AON/4.8 Page 10 Lines in the table within an action entry may be continued with the continuation character "-" in the usual DCL manner. An "include file" facility is provided, so that sections of control tables can be brought together from different sources. Include files can be nested to a maximum depth of 16. The syntax is simply include filespec where the keyword "include" MUST be in lower case and MUST start in column 1, as for the other keywords. Note that there are no quotes around the file specification. Detailed specifications of the types of table entry are given in Appendix A. There are internal limits set on the size of control tables, which can only be changed by re-compiling SMS. These limits are: maximum number of menus 200 maximum number of parameter lists 200 maximum number of actions 400 maximum number of list entries (names etc.) 1500 The table compiler has explicit checks for these limits being reached, and reports when this occurs. The table compiler also identifies references in the table to undefined menus, actions or parameter lists, and outputs messages to inform the user of these. - 10 - AON/4.8 Page 11 5 STAND-ALONE TABLE COMPILER A stand-alone version of the table compiler is available, which allows control tables to be compiled for checking purposes without running SMS. This produces listings of the data stored in the internal structures of SMS, a listing of the control table (with error messages inserted, if any!) and listings of the formats of menus and parameter lists which give a "hard-copy" preview of what will appear on the screen. Note that in the "action table" the lines are truncated in the listing to 80 characters; these lines may in fact be up to 132 characters long. This is invoked by obeying the commands: $ ADAMSTART ! Start up ADAM $ ADAMDEV ! Define symbol COMPSCT $ DEFINE SMSTABLE file_description ! Define control table $ COMPSCT ! Run the compiler Output from the compiler will be into a file in the user's current directory with the same filename as the control table and filetype .LIS. 6 FEATURES OF THE SYSTEM WHICH MAY CHANGE Storing compiled tables so that start-up is quicker. Saving the whole of a "current configuration". - 11 - APPENDIX A SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES There are four types of entry in an SMS control table. One of these describes the configuration of the SMS system components on the screen, and will not usually be changed much from one application to another. This entry is introduced by the keyword "fields", and is put at the beginning of the control table file. (It is likely that at some time in the future this entry in the table may be moved to another file, since it is not part of the application.) The other three entry types describe what appears on the screen when running a particular application. They are introduced by the keywords "menu", "switch" and "action". The "menu" and "switch" entries describe displays which are pasted on the terminal screen when required. The "switch" entry consists of a list of parameters which can have switched or manually entered values; it is thus referred to as a parameter list. The "action" entries consist of one or more command language commands which can be executed as a consequence of the user's keystrokes at the terminal. These "action" entries may be called up in three ways: - on entry to a menu or parameter list from a higher level menu - on exit from a menu or parameter list back to a higher level menu - by selecting a menu option which is explicitly associated with a particular action Mechanisms are provided to: o Take the values of parameters from SMS parameter lists and substitute them in command language command lines. This allows communication of parameter values from SMS to the command language. o On entry to a parameter list from a menu, take the value of any SMS parameter from the current value of a named - 12 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-2 parameter in any ADAM task. This allows communication of parameter values back from the ADAM system to SMS. o On entry to a parameter list from a menu, take the value of any SMS parameter from the current value of a named command language variable. This allows communication of the values of variables back from ADAMCL to SMS. Names used within the table entries are allowed to be up to 60 characters long, with the exception of help keywords; these are of the form helpname or @helpname or @helpfile.helpname where each of helpfile and helpname can be up to 15 characters long (an HDS limit). If the help keyword is not prefixed by @, then help information is taken from the current ADAM help file, using the help keyword given in the menu item or parameter entry. If this keyword cannot be located in the current help file, then SMS will inform the user that no help is available. If the help keyword is of the form @helpname, then the current help file is set to the default (the logical name SMS_HELPFILE) and searched for helpname. If the help keyword is of the form @helpfile.helpname, then the current help file is set to helpfile and searched for helpname. A detailed specification of the four entry types follows. - 13 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-3 A.1 The "fields" entry. This entry consists of a list of instructions which configure the SMS _ _ system. Some of these must be present, others have defaults and need not be given. A.1.1 Required entries: pf specifies where on the screen the descriptive text for the keypad "PF" keys appears; takes the values 1 to 4, and specify the screen position pf_width is the number of characters allowed for descriptive text in the PF key display scroll_top is the top line on the screen to be allocated to a scrolling region scroll_bot is the bottom line on the screen to be allocated to a scrolling region prompt_line specifies the screen line where parameter prompts are to appear err_line specifies the screen line where error messages are to appear - 14 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-4 msg_line specifies the screen line where one-line messages (e.g. from the message system) are to appear cmd_line specifies the screen line where the command language prompt is to appear help_line specifies the screen line where one-line help is to appear A.1.2 Optional entries: txt_ These entries allow the default text for the PF key labels to be over-ridden. If no entries are present, the internal default values will be used. One or more of the defaults may be changed by appropriate entries. There are four sets of the PF key labels: - the "base" set, used for menus - the "switch" set, used for parameter lists - the "macro definition" set; replaces the base set when defining macros - the "macro display" set, used for the macro display function The names for these text entries (as used in SMS control tables) and their default values are as follows: txt_base_pf1 = PF1: exit txt_base_pf2 = PF2: learn macro txt_base_pf3 = PF3: show macros txt_base_pf4 = PF4: quit txt_swit_pf1 = PF1: exit txt_swit_pf2 = PF2: defaults txt_swit_pf3 = PF3: txt_swit_pf4 = PF4: quit - 15 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-5 txt_mdef_pf1 = PF1: exit txt_mdef_pf2 = PF2: end macro txt_mdef_pf3 = PF3: show macros txt_mdef_pf4 = PF4: quit txt_mdis_pf1 = PF1: txt_mdis_pf2 = PF2: txt_mdis_pf3 = PF3: load macro txt_mdis_pf4 = PF4: macros This entry enables the macro facility to be disabled. The entry macros disabled will disable the PF2 and PF3 keys (in a menu) and the keypad numeric keys so that macros cannot be used. Macros can be enabled explicitly by the entry macros enabled but this is also the system default, so no "macros" entry means that macros will be enabled. If use is made of this facility to disable macros, then the PF2 and PF3 key labels for menus should also be altered, e.g. with entries txt_base_pf2 PF2: txt_base_pf3 PF3: to leave these blank. scroll_switch The SMS system sets up the scroll region as "permanent" by default, i.e. it does not go away if the user presses a key when it is on the screen. This can be changed in the SMS configuration parameter list (accessed from the keypad "comma" key), to make the scroll region "temporary", i.e. it is only displayed until the next keystroke. The system default can be over-ridden by this entry, e.g. scroll_switch on sets up SMS with the scroll fields "permanent" once text is written to it. It can be set up to be "temporary" with "scroll_switch - 16 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-6 off". cli_prompt The SMS system sets up the command language prompt to be "Command: " by default. This can be changed to reflect the actual command language which SMS is linked with. The system default can be over-ridden by this entry, e.g. cli_prompt Adamcl: sets up SMS with the command language prompt "Adamcl: ". Note that this used to be the default. show_task determines whether the task name is displayed along with incoming messages. This is "off" by default, so that only the value part of an incoming message is displayed. auto_help This sets up the initial state of the automatic one-line help facility, which is disabled by default. This can be changed in the SMS configuration parameter list (accessed from the keypad "comma" key). expert_user See section 3.6. This enables or disables the expert user facility (on to enable, off to disable). A.1.3 An example of the "fields" entry: fields * definition of field locations ... * keypad "pf" keys ... * (specifies where on the screen the descriptive text appears) * i.e. - 17 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-7 pf1 24 1 pf2 24 21 pf3 24 41 pf4 24 61 * no of characters allowed for descriptive text pf_width 19 * pf key text replacement ... txt_base_pf1 PF1: go back one txt_base_pf4 PF4: go away entirely txt_swit_pf3 PF3: no function * scroll field ... scroll_top 5 scroll_bot 15 scroll_switch on * parameter prompt field ... prompt_line 19 * error message line ... err_line 20 * one-line message display ... msg_line 21 * prompted command field ... cmd_line 22 cli_prompt ICL: * one-line help ... help_line 23 * macro operation ... macros disabled * "expert user" facility ... expert_user off - 18 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-8 A.2 The "menu" entry. The "menu" entry is introduced by menu where <name> is the name of the menu to be referenced in the "option" entries of other menus in the control table. The title, if given, is displayed at the top left border of the menu. A.2.1 Required entries: format <box/nobox> determines whether or not a box is drawn around the menu position <line> <column> gives the position of the top left corner of the menu on the screen (N.B. the box goes OUTSIDE this if present) field_width <number of characters> gives the width of the field for each menu item columns <number of columns in the menu> note the number of columns could be one, giving a tall thin menu! option <option name> <action/menu/switch> <name> <help key> There must be at least one "option" entry; these are the "items" in the menu. They can point to actions, parameter lists, or other menus. <option name> appears on the screen as the menu item "action", "menu" or "switch" specifies the entry type <name> specifies which action, menu or parameter list is selected - 19 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-9 <help key> specifies the help keyword to be used in the current help file when the user requests help by pressing "?" with the cursor on this menu entry A.2.2 Optional entries: entry <action name for action on entry> allows one or more command language commands (specified in the given "action" entry) to be obeyed on entry to an SMS menu. exit <action name for action on exit> allows one or more command language commands (specified in the given "action" entry) to be obeyed on exit from an SMS menu. pre_entry <action name for action before entry> pre_exit <action name for action before exit> In ADAMCL, these entries are like "entry" and "exit", but allow the control of access to menus and parameter lists by using command language variables as flags. The control variables are called "ENTER_SCREEN" and "EXIT_SCREEN"; they are "real" ADAMCL variables. For normal entry or exit, they are set to 1.0; to bar entry or exit, set the required variable to 0 in the appropriate "pre_entry" or "pre_exit" action. Note that, in parameter lists, the "from" mechanism for setting SMS parameters from external values is called before the "pre_entry" action, and thus is called even if entry to the display is barred. This may well be the required action in many cases. A.2.3 An example of the "menu" entry menu main_node This is the title * whether or not a box is drawn around the menu ... format box * position of top left corner of the menu on the screen ... position 5 10 * width of field on screen of each menu item ... field_width 10 - 20 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-10 * the number of columns could be one, giving a tall thin menu! columns 4 * the next four need not be present ... pre_entry check_permit entry setup1 pre_exit check_exit exit save1 * the menu items which can point to actions, parameter * lists, or other menus ... option observe action do_it obs_help option ... and so on ... - 21 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-11 A.3 The "switch" entry. The "switch" entry is introduced by switch <name> <title if any> where <name> is the name of the parameter list to be referenced in the "option" entries of menus in the control table. The title, if given, is displayed at the top left border of the parameter list. A.3.1 Required entries: position <line> <column> gives the position of the top left corner of the parameter list on the screen field_width <number of characters> gives the width of the field to hold the parameter name parameter <parameter name> <help key> [<default>] <another> <next> a "switched value" parameter (default indicated by [ ]); <parameter name> appears on the screen as the list item name, <help-key> is the help keyword for the parameter, the 'default' value has square braces around it, <another> and <next> are other possible 'switched' values for the parameter parameter <parameter name> <help key> <single value> A "single valued" parameter; the value is a string with no white space included. If data is typed for a parameter list single-valued entry such that the data typed would go beyond the rhs of the pasted display, then the data typed is stored, and on exit from the display its width is updated so that on next entry it will be wider and will show what was typed. At present, "shrinking" of the display if smaller length items are typed is not implemented ! (It's a bit more difficult, though not much) - 22 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-12 There must be at least one 'parameter' entry, which can be of either type. - 23 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-13 A.3.2 Optional entries: from <task> <parameter> After a parameter list parameter definition, the "from" entry can be used to set the parameter value from the value of a parameter in an external task, e.g. parameter myparm help_key 0 [1] 2 3 from <task_name> <parameter_name> from adamcl <variable_name> will pick up the value of any command language variable as a character string. In fact, <variable_name> can be any valid command language expression (provided it does not include "white space", i.e. spaces or tabs). maxchars <parameter_value_length> The SMS system maximum for name lengths (and parameter value lengths) is set up at 60 characters (changing this needs a system recompile). Additionally, the maximum length of individual parameter values can be specified by this 'maxchars' mechanism. After the parameter entry in the table, a line is added which specifies the maximum value length the user can type (this applies, of course, only to single-valued parameters), e.g. parameter object_name help_key The_Moon maxchars 25 sets up a parameter with initial value "The_Moon" and will not allow the user to change this value to anything longer than 25 characters. If a "maxchars" entry is not present, then the parameter value will be allowed to "grow" to the system maximum (i.e. 60 at present). entry <action name> exit <action name> - 24 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-14 pre_entry <action name> pre_exit <action name> These behave in an identical way to the corresponding entries for menus. A.3.3 An example of the "switch" entry: switch sw_1 Title on screen * this is a "parameter list" * position on the screen ... position 10 10 * width of field to hold parameter name ... field_width 15 * parameters: note that "help-key" is the help keyword for that * parameter; it may, of course, be the same as the parameter * name. * * a "switched value" parameter (default indicated by [ ] at * present) parameter <parameter name> <help key> [<default>] <another> <next> * a "single valued" parameter with size limit ... parameter heading head_help Observation maxchars 32 * this next parameter gets its value from a named task ... parameter ... from mytask filter_name * this next parameter gets its value from the command language ... parameter ... from adamcl myvariable * note these next two are not present if not required ... * if any action is to be called on entry to this field entry enter_sw1 * and if any action to be called on exit exit exit_allsw - 25 - SPECIFICATION OF THE CONTROL TABLE ENTRY TYPES Page A-15 A.4 The "action" entry. An action entry is introduced by action <name> where <name> is the name used inside the SMS control table to refer to this action from a menu item or in 'entry' and 'exit' directives. This is followed by a list of command language command lines, which SMS sends to the command language for execution. This is basically what SMS is: a means of packaging command language commands so that they can be executed by a single keystroke rather than by having to type them all in. Note that DCL commands can be placed here, just as at the "DOT key" prompt, if the underlying command language supports the "$" escape. There is a special escape pattern, "+config+", which when used as the first word in an action line attempts to configure an internal SMS parameter. This should normally only be used in the exit action of the SMS system configuration parameter list (see the example in Appendix B). This pattern must not be used as the first word on the line for any other action lines. A.4.1 An example of the "action" entry: action doit * an action definition may contain one or more command language * commands: load atasks:junktask junk send junk obey something etc ... * and SMS parameter substitution is done to allow variables in * these ADAMCL lines as follows ... send junk set something <<switch_name:parameter_name>> * where "switch name" is the name of a parameter list, * and "parameter name" is the name of a parameter in that * list. The characters held in SMS representing the current * value of the parameter are simply substituted in the ADAMCL * command line. - 26 - APPENDIX B EXAMPLE OF A CONTROL TABLE What follows is a simple example of a control table for SMS. It can be edited out and used as a base from which to experiment! The basic structure of this example is "home_menu" | +---------------+-----------------+ | | a_menu a_param_list "some_actions" parameters: | choice_letter +-------+-+---------+ choice_number | | | choice_value hi_there choices directory Actions: hi_there - print "Hi there" choices - print choices in 'a_parm_list' directory - do DCL "directory" command Note that there is an include file containing directives needed for SMS system operation. .page * Example control table to go with the document AON004. * * John Cooke (REVAD::JAC) 30Sep88 * include the system part of the table ... include smssystab.inc * This is where the "application part" of the control table * starts. The first menu becomes the SMS "top level" menu, - 27 - EXAMPLE OF A CONTROL TABLE Page B-2 * i.e. the one displayed first on the screen ... menu home home_menu position 2 2 field_width 15 columns 2 format box option a_menu menu action_menu action_help option a_param_list switch a_parm_list param_help * entry action to set up the help file ... entry start_action action start_action help @aon004 menu action_menu some_actions position 8 2 field_width 15 columns 1 format box option hi_there action hi_there hi_there option choices action choices choices option directory action directory directory switch a_parm_list position 9 12 field_width 15 parameter choice_letter help_letter A [B] C D E F parameter choice_number help_number 1 2 3 [5] 7 11 1986 parameter choice_value help_value 42.0 * Actions: action hi_there print "Hi there" action choices print "Letter: <<a_parm_list:choice_letter>>" print "Number: <<a_parm_list:choice_number>>" print "Value: <<a_parm_list:choice_value>>" action directory $directory .page This next section is the file "smssystab.inc" included at the top of the main control table: *================================================================= * Note that this section determines where SMS system components * appear on the screen; it should probably appear in a * separate file as it is not really part of the "application". fields * definition of field locations ... - 28 - EXAMPLE OF A CONTROL TABLE Page B-3 * keypad "pf" keys ... pf1 24 1 pf2 24 21 pf3 24 41 pf4 24 61 pf_width 19 * scroll field ... scroll_top 5 scroll_bot 15 * parameter prompt field ... prompt_line 19 * error message line ... err_line 20 * one-line message display ... msg_line 21 * prompted command field ... cmd_line 22 cmd_column 1 * one-line help ... help_line 23 * automatic one-line help ... auto_help on switch sms_sys_config SMS configuration position 4 10 field_width 15 entry sms_config_entry exit sms_config_exit * do not alter these parameters without making corresponding * alterations inside SMS routine "sysconfig" ... parameter beep term_beep [on] off * note that the next must match the "auto_help" switch ... parameter auto_help auto_help [on] off * and this must match the "scroll_switch" (default permanent) ... parameter scroll_region scroll_region temporary [permanent] parameter scroll_device scroll_device TT * you can change the next line to change the system default help * file; you will also need an entry action "help @<your file>" * to get it initialised as the code itself uses "sms_helpfile" * e.g. change this to * parameter help_file sms_help_file your_file parameter help_file sms_help_file aon004 .page action sms_config_entry help @sms_helpfile action sms_config_exit help @<<sms_sys_config:help_file>> * these lines must be present otherwise the SMS internal * parameters are not configured ... +config+ beep <<sms_sys_config:beep>> +config+ auto_help <<sms_sys_config:auto_help>> - 29 - EXAMPLE OF A CONTROL TABLE Page B-4 +config+ scroll_region <<sms_sys_config:scroll_region>> +config+ scroll_device <<sms_sys_config:scroll_device>> menu sms_help_menu SMS help topics - press ENTER to get help position 2 2 field_width 14 columns 5 * on entry, select SMS helpfile ... entry sms_help_select * on exit, restore current help file ... exit sms_help_restore * help topics ... option keypad action sms_h_keypad sms_keypad option menus action sms_h_menu sms_menu option param_lists action sms_h_param sms_param option macros action sms_h_macro sms_macro option cursor action sms_h_cursor sms_cursor option helpfile action sms_h_hfile sms_hfile option actions action sms_h_action sms_action action sms_help_select help @sms_helpfile action sms_help_restore help @<<sms_sys_config:help_file>> action sms_h_keypad fullhelp sms_keypad action sms_h_menu fullhelp sms_menu action sms_h_param fullhelp sms_param action sms_h_macro fullhelp sms_macro action sms_h_cursor fullhelp sms_cursor action sms_h_hfile fullhelp sms_hfile action sms_h_action fullhelp sms_action *================================================================= - 30 - s the name used inside the SMS control table to refer to this action from a menu item or in 'entry' and 'exit' directives. This is followed by a list of command language command lines, which SMS sends to the command language for execution. This is basically what SMS is: a means of packaging command language commands so that they can be executed by a singshuffle_1.txt��������������������������������������������������������������������������������������� 664 � 516 � 17 � 275347 6430203340 6604� �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� CHARGE SHUFFLING READOUT (CSR) ****************************** Started 12/6/95 Updated 17/1/96 J.R.Barton ccd_charge_shuffling.txt ************************************************************************* WRITE A DESCRIPTION FOR THE NEWSLETTER OUTLINING WHAT IS AVAILABLE IN CSR ************************************************************************* NOTES LEADING TO MICRO SPEC *************************** ** ASTRONOMER SETUP PARAMETERS ULTIMATELY: The following system details need to be input by means of a table which is accessible to and modifiable by the astronomer/engineer at any time (i.e. including during the observing run so that changes can take effect immediately): INITIALLY: This data will be hand-coded into the parameters sent in the cs commands Shutter times: Vincent Assoc (times in milliseconds) 225L 262 Taurus (Prontor E/100 fitted w/ special blades) minimum open time 5.5 25 60 " close time " cycle time 25 200 1000 delay to start opening 3.0 8 22-26 min-max opening time 2.5 17 22-33 " dely to start closing closing time 4.2 21 22-34 " Above may be used by the VAX to: - determine if a shuttered cycle is permissible, i.e. check that the minimum open and close times and minimum cycle times restrictions are not broken. - determine the delay, Tshc, used by the micro, between the micro close shutter command and the shutter becoming fully closed. THIS IS NOT NEEDED NOW THAT THE BASIC PHASE OPERATION IS "SHIFT AND EXPOSE"? - adjust a requested exposure time to an actual EXPTM number downloaded to the micro. The correction is for differences in the shutter opening and closing times (which may be experimentally determined) and may be further adjusted to make a suitable compromise between the central parts and the corners of an image shuttered with an IRIS type of shutter. Generally, the shutter is used for the longer exposures where opening and closing times are not critical. Thus can probably combine some of the above parameters in these cases. The EXT device (eg Etalon) This can be any device able to respond to the micro SYNC OUT pulse by changing state in a predictable manner through predetermined cycles to which phases can be attached - eg etalon, polariser, telescope position, chopping secondary, filter wheel, etc. The EXT device is pulsed right at the start of the phase after the phase starting interrupt (I/R) and before the N.V.Shifts are started. Thus EXT has some time to settle during the N.V.Shifts but this shift time may be shorter than the Tdext. If so, then for shuttered exposures, TDEXT must be timed out and the timer TC tested by the micro before opening the shutter. ULTIMATELY: (the same parameter set as for shutters could apply to EXT device) i.e. delay, operating and settle times perhaps in two or more directions or states? Initially assume that one delay time, TDEXT, will apply to all changes of direction and states of EXT. INITIALLY: Parameter TDEXT is hand coded into the cs command NB. That if the EXT device is slow to operate compared with the Vshift time then Tmargin may have to be increased to ensure the EXT device has settled for a reasonable time before the end of the phase otherwise the exposure will be with non-settled EXT. VAX must sort this out as it determines the minimum TINCR time or phase trigger period. The N.VS CNTR, counter 1 in C14 is to be commandeered for use in timing the TDEXT delay. OTHER DELAYS: These may include - micro processing times per phase - extra processing time per cycle - time to get started, i.e. to stop the clocks or to get TINCR going - Tmargin, an overall safety margin per phase? per cycle? - others....... INITIALLLY: These are all hand coded into the cs and PS, PR and PE parameters EXPTM COUNTER RESOLUTION: This is normally set to 100ms by default (100MST counter counting 1ms clocks) and thus minimum EXPTM is thus 200m. For shorter exposures (of say 50ms which is OK for the small shutter) the EXPTM counter can be clocked directly, bypassing the 100MST counter, with 10 kHz or 100 kHz clocks by software connecting the EXPTM counter clock to CK3 (SRC3) and on counter C14 setting its FOUT at the required frequency by feeding it from the F3 or F2 output of the internal frequency scaler as appropriate. The resolution of EXPTM also sets the shutter open maximum timing error. With a 1ms clock this is a 1 ms error. A 10 kHz clock would present a 0.1 ms max error probably comparable to the jitter in the shutter opening and closing times. The changing of the CMR and MMR for the counter chips is done by the micro with the hex byte for the MMR of C14 being INITIALLY hand coded into the cs command. TINCR COUNTER RESOLUTION: this needs to be fairly fine as with TINCR counting very fast for FLASH exposures, eg 0.1 ms for 100ms total FLASH time with a 1024 CCD. this counter runs repetitively and only the first terminal count would have a timing error as it syncs itself up with the clock. The resolution should approach that of a single Vshift, i.e. 10 us. with a 650 ms max TINCR would be the finest although 1 us with 65 ms max TINCR is a possibility This is handled by the EXPTM change above, i.e. with 10 kHz or 100 kHz clocks by counter C14 setting its FOUT at the required frequency by feeding it from the F3 or F2 output of the internal frequency scaler as appropriate. The micro will set the required MMR in the set-up sequences RUN TYPES Exposures Type; Normal exposure (NP): This is the full CSR exposure with the shutter opening and closing as required to illuminate the CCD. Dark frame (DF): This is an exposure made with the identical timing of the NP (thus takes the same time to perform as the NP) but with the shutter remaining closed. Bias frame (BF): This has all the phases and cycles of the (NP), is made with the shutter closed, has all EXPTM counts reduced to the minimum of 2 and has a minimum phase time, TINCRmin, set. Shutter Opening: Shutter opens at start, closes at end of exposure (uses TINCR, no EXPTM used) Shutter opens and closes each phase (both TINCR and EXPTM used) CCD Cleanout Direction: [Cleanout CCD in normal forward direction - Cleanout CCD in reverse direction (eg for shutterless streak use)] *** NO! USE START-UP SEQUENCE FOR THIS *** TRIGGER TYPES ANY COMBINATION OF THE FOLLOWING POSSIBILITIES, i.e. completely done with controller's internal timers, or completely by external timers via the SYNC1/2 inputs, or by a combination of both: **** TOO HARD FOR NOW **** Starting the exposure: - Normal VAX start command (cs command) will start as soon as the micro has done its setup without waiting for anything else. The cs command contains an indication of the choice of start be it the cs command or the use of a sync input. - SYNC I/P, allowing external hardware to trigger start of exposure - start on SYNC 1 - start on SYNC 2 Here, a SYNC I/P is used to trigger, from some external hardware event (eg occultation timer...), a delayed start to the measurement, i.e. the sync I/P is used to indicate that from that time onward do a further N cycles, in, say, a streak series.... i.e. just as a logic analyser trigger input performs During the Exposure: - TINCR I/R used to trigger the next step - TINCR triggers all next phases - TINCR trigger the next cycle (what triggers each phase?) **** TOO HARD FOR NOW **** - SYNC I/P, allowing external hardware to trigger the next step - SYNC 1 triggers all next phases - SYNC 2 triggers all next phases - trigger just the next phase on SYNC 1 - trigger just the next phase on SYNC 2 **** TOO HARD FOR NOW **** - trigger all or just next cycle on SYNC 1 - trigger all or just next cycle on SYNC 2 eg SYNC1 or 2 may be from an accurate frequency generator but what triggers each phase? TINCR? **** TOO HARD FOR NOW **** - SYNC1/2 I/P, allowing external hardware to trigger the next cycle with the system free-running through the phases ea with its own N.Vshifts + EXPTM + Tdshc delay all finishing before the next sync1/2 I/R. This is for shuttered exposures only. **** TOO HARD FOR NOW **** Stopping the Exposure: - SYNC I/P allowing external hardware to stop the exposure - stop after SYNC 1 at the end of the current cycle - stop after SYNC 2 at the end of the current cycle DO ONLY THE FOLLOWING TRIGGER COMBINATIONS INITIALLY 1. Start of exposure, either - cs command starts exposure without delay or - SYNC1 I/R starts exposure or - SYNC2 I/R starts exposure 2. For every phase of the CSR use either - TINCR I/R to start it or - SYNC1 I/R to start it or - SYNC2 I/R to start it 3. To stop the exposure - natural stop after the required number of cycles has completed and/or - use the VAX sc command to stop at the end of the current cycle and/or - stop after SYNC 1 at the end of the current cycle or - stop after SYNC 2 at the end of the current cycle 4. To abort the exposure - use the VAX ai command to abort as soon as possible with no CCD readout (the VAX to follow up with an 'IN' command A BASIC PHASE The basic phase sequence, comprising a "shift and expose", in that order, is described. A set of these phase definitions forms a CSR cycle. Each phase needs to have the following parameters defined: - the phase number - a disable shutter opening indication - the EXPTM value, if the timed shutter open is used - the TINCR phase period, if this defines the time - the shift direction of the charge shuffle - the number of whole vertical shifts, N.V.Shift - an enable EXT device change at start of phase - the number of repeats - the offset subtracted from current phase number for the repeat NB: If the number of vertical shifts is greater then the number of rows it effectively cleans the CCD so this could be done at any time to clean the CCD say prior to an ext sync type start when the exact timing is unknown, i.e. can get things started for the CSR, wait for sync, then rapidly clean CCD then do the required cycles for the exposure, terminate and readout Shift Direction definition (for a CCD read out of one or two outputs from the same serial register): Shift up is a shift forward, a "+" shift and is towards the readout register Shift down is a reverse shift, a "-" shift and is away from readout register THE BASIC PHASE SEQUENCE is as follows: SUMMARY [A] - receive the TINCR (or SYNC...) interrupt - test if PNEXT=PE1: should we gone to end-up sequence? if so, hop out to END2 to go the end-up sequence if not, proceed... - shuffle phase pointer registers - execute CURRENT phase - trigger EXT change if required (start timer, TDEXT, by issuing a !TRIG VS CNTR pulse (WP2,1) to cover this, but only if a shuttered CSR - send TRIG VSHIFT to do the N Vshifts, fwd/bwd direction, ending in a PTE as required - wait for EO uP BUSY I/R OR end of TDEXT timeout * - trigger the EXPTM if required - test if PNEXT=0: no phase definition to set up if so, hop out to END2 if not, proceed.... - set up PNEXT by - load TINCR for next phase, if used, unless BIASFLAG - load NVSHIFT or WC6 for next phase (and step counter?) # - load WC7 direction byte for next phase - determine if shutter is to open in next phase * - load EXPTM for next phase, if used, unless BIASFLAG NB: for the EXPTM counter, in order to look after the first time thru AND loading the counter when it is not counting (i.e. it is turned off for the phase) first load the EXPTM into the load register, immediately test is EXPTM (bit 5 of status_byte) is set. If not load the counter reg and step the counter. If so, skip out. - determine if EXT is to change state in next phase - forecast FUTURE phase (next, repeat or jump), cycle, test STOPFLAG, or whether change of sequence or wrap-up - wait for next TINCR (or SYNC...) interrupt - jump back to [A] - END2: - wait for next TINCR (or SYNC...) interrupt - enter end-up sequence # do this just on contents of PD, i.e. don't test whether changing is required or not - just write out fwd WC6 or rev WC6 acc to the pD SET-UP SEQUENCE - covers things done by the micro after the cs command is received up until the start-up sequence - change MMRs, CMRs, - terminate STBYM and thus stopping the cleanout of the CCD - get WAITM going in preparation for the CSR exposure - set the ENABLE CSR selective set/clear flip=flop, EN CSR, by writing to the selective set register SS 80. This enables the generation of V clocks in the WAIT mode condition that exists for the duration of the CSR exposure time. - prepare and set up for start-up according to n4 of the cs command, i.e. n4 = start the exposure triggered by.... = 0 start immediately, don't wait for and I/R = 1 by SYNC 1 I/R (hardware start of the exposure) = 2 by SYNC 2 I/R (hardware start of the exposure) START-UP SEQUENCE - do a start-up sequence, PSn, possibly, to get shutter open on a throwaway spot on the CCD Vshifted out of range in non-shuttered exposures to give a cleaner entry into the first phase of the running stage *** not really possible *** - required to prepare SYNC stopping the exposure as per n7 of the cs command n7 = stop the exposure triggered by.... = 0 nothing extra, ie use cycle counter or sc command = 1 by SYNC 1 I/R (hardware stop of the exposure) = 2 by SYNC 2 I/R (hardware stop of the exposure) - required to prepare for running sequence as per n5 of the cs command n5 = start the exposure triggered by.... = 0 start immediately, don't wait for and I/R = 1 by SYNC 1 I/R (hardware start of the exposure) = 2 by SYNC 2 I/R (hardware start of the exposure) - the parameters for the first phase of the running sequence are loaded. - needed do a CCD cleanout forward or reverse shifted especially if there can be a long delay in waiting for a SYNC1/2 start pulse after the system is in WAITM... NB: If the number of vertical shifts is greater then the number of rows it effectively cleans the CCD so this could be done at any time to clean the CCD say prior to an ext sync type start when the exact timing is unknown, i.e. can get things started for the CSR, wait for sync, then rapidly clean CCD then do the required cycles for the exposure, terminate and readout - needed to do any preparation for running sequence that can be done with the PS phase definitions, i.e. in non-shuttered use for fastest running sequence period use start-up sequence PSn to load counters with the required values so that in the running sequence can just skip over the loading of these - the TINCR is got going OR some method to get micro into synchronism with incoming timing steps and reference SYNC1 and SYNC2 I/R sources. To get into sync with TINCR interrupts, load a short time of, say, 20ms into TINCR , start the counter with GATE TINCR bit of the set/reset register, then load in the first PS definition which will contain the required TINCR.... For SYNC1/2 wait for one of these, load up for running sequence and wait for the next SYNC1/2 to start the running sequence. To get into sync with the SYNC1/2 I/R just set up for I/R and wait till one arrives then load in the first PS definition, etc... END-UP SEQUENCE - at the very end of the exposure, as the shutter is closing, perform the first phases of the cycle that occured during the shutter opening time by using PE phase definitions. In this way, what was lost at the start is made up at the end of the exposure (assuming that the opening and closing times of the shutter are equal) - do an end-up phase PE definition to close shutter so that the time to close delay doesnt upset the last valid phase of the exposure in non-shuttered exposures - this to be on a throwaway portion of the CCD - if the stop command was used, save the cycle count in SCC for later interrogation by the VAX - close the shutter with the STOP EXP pulse if it has been opened continuously throughout the TSR, start delay to close or use an end-up sequence PE phase definition to do this - stop the TINCR counter, after all PXn's have completed, by resetting the GATE TINCR bit of the set/reset register - when shutter closed go to wrap-up WRAP-UP SEQUENCE - wrap-up status, xs = 5, sent to the VAX on demand - return controller to normal using the saved list of changed parameters saved prior to run start, and await VAX readout command - reset the ENABLE CSR selective set/clear flip=flop, EN CSR, by writing to the selective reset register SR 80. This prevents the generation of V clocks in the WAITM condition returning the clock generation back to normal. - get the loop running again - return TEL to normal - issue a reset FIFO if neccessary - set up to await a VAX ro command to do a normal CCD readout as per speed and window spec SEQUENCES AND PHASE PROCESSING STARTUP PORTION OF START-UP SEQUENCE ie the in-line non-phase processing code - set startup sequ "xs" - determine I/R to use (TINCR or SYNC1/2) - wait for this I/R to get into sync - receive the TINCR (or SYNC...) interrupt - load first PX1 into [PNEXT] - enter phase processing at [B] STANDARD PHASE PROCESSING [A] - receive the TINCR (or SYNC...) interrupt - test if PNEXT is in a new sequence, ie, running or end-up if so, - set appropriate sequ "xs" - change any PXn limits used in forecasting FUTURE - proceed... if not, proceed... - shuffle phase pointer registers - execute CURRENT phase - test if PNEXT=0: no phase definition to set up if so, hop out to END2 if not, proceed.... [B] - set up PNEXT - forecast FUTURE phase - wait for next TINCR (or SYNC...) interrupt - jump back to [A] - END2: - wait for next TINCR (or SYNC...) interrupt - enter end-up sequence END ie the in-line non-phase processing code in the end-up sequence - delay for shutter closing, if required FORECASTING FUTURE PHASE Take into account the following factors: Rules re Sequences: - Start-up and End-up sequences may have repeats but no cycles - Running sequence may have both repeats and cycles - Cycles cycle around the complete running sequence from PR1 to PRnmax Forecasting: - normally FUTURE=PNEXT+1, ie the next line of the phase defn table, but check for: - repeats and completion of repeats in all sequences - cycles and completion of cycles if in running sequence - STOPFLAG if at end of a cycle in running sequence - end of the phase defn table in either running or end-up sequence - ABORTFLAG INSTRUMENT SEQUENCER (IS) OPERATION *********************************** VAX sends it parameters corresponding to step numbers on-band and off band (LGW to extend this to a table of n bands to correspond to n phases per cycle) IS sits in a hard loop looking for the next sync pulse in order to quickly respond and thus ignores external traffic. It needs an initialising sync pulse to get this process started and to send the first etalon step number correspondiing to the first phase of a cycle to Taurus. Thereafter all sync pulses signal a step in the step number corresponding to the next phase of the cycle. The IS needs the number of cycles or steps to be sent to it by the VAX so that it can count its way through the exposure and drop out of the hard loop at the end of the exposure (although I guess it could be sent a cntrl-C reset to do this and thus needn't know the full count???) Aborts are looked after by a control-C reset on the IS micro. TYPES OF RUN SEQUENCE FORSEEN ***************************** - square wave as requ for JBH and for JRB CCD tests - polarimetry at pos 1, plus, minus for n1; then move to pos 2, plus, minus for n2; then move to pos3, plus, minus for n3, etc, etc... then return and repeat - UBVRI photometry - pulsar several steps then return and repeat - streak readout (flash) to fill CCD then read out, egfor lunar or minor planet occultations where 1 to 10ms resolutions are required - long-slit or multi-slit spectroscopy shifting charge and telescope simultaneously to acquire object and sky on the same pixels. See CFHT CHARGE-SHUFFLE EXPOSURE DEFINITION ********************************** DEFINITION EXPOSURE: An exposure is the complete thing between the CCD cleanout and the CCD readout and comprises a set-up and a start-up sequence (the latter with PS1-to-n phases) followed by a running sequence with N repeated cycles. Then follows an end-up sequence which can also have PE1-to-n phases, then wrap-up prior to the CCD readout CYCLE: A cycle comprises a series of charge shuffling phases, PR1 to n, and that cycle can be repeated for the requested number of times, n1 of the cs command. PHASE: A cycle comprises one or more phases, each phase comprising a charge shuffling operation followed by a delay during which the CCD may be exposed to light. Each phase is defined by a line in the phase definition table. SEQUENCE OF OPERATIONS: A phase comprises several sequences of operations performed by the micro.... FOR EXAMPLE: JBH requires about 40 exposures (to cover the I-band) each of these exposures to be as follows. After the astronomer sets up the etalon parameters for the next I-band and commands the start, the exposure will be, say, 10 cycles, with each cycle comprising two phases. The first phase to be a forward shuffle of 300 lines followed by a shuttered 70 sec, on-band exposure. The second phase comprises a reverse shuffle of 300 lines followed by a shuttered 2 secs, off-band (or reference band) exposure. At the completion of the 10 cycles the CCD will then automatically be read out in the standard manner, at the specified readout speed and windowed and/or binned in the x and/or y directions as per the specified window. A CHARGE SHUFFLING PROPERTY *************************** If the number of phases per cycle is such that N separate image areas are created on the CCD then the proportion of the area of the CCD that is usefully used is A(usefull) = N / (2N-1) and thus the proportion of the area of the CCD that is wasted, as it gets shifted beyond the ends of the CCD, is A(wasted) = (N-1) / (2N-1) TO BE DONE ********** - In CCD controller cubicle, micro SYNC O/P pulse has been disconnected and IRIS stuff connected to SYNC O/P connector. Need to OR into it !IRIS.microSYNC O/P. - need to run with the MAPPIT style version of GORDON2 (or whatever) in order to be able to get in and change speed tables and the run parameters on the run - hardware mods required to run Thomson CCDs. Also speed table mods. - need to run CSR through [JRB] to pick up modifiable speed and window tables DRAFT ISSUE *********** MICRO TASKS AND SEQUENCES FOR CHARGE SHUFFLING READOUT (CSR) ************************************************************ Updated 3/10/95 Started 12/6/95 J.R.Barton ccd_charge_shuffling.txt BRIEF DESCRIPTION OF CSR ************************ The charge shuffling readout mode enables the astronomer to build up a CCD exposure comprising several on-chip charge movements made generally into and out of an aperture of a masked CCD. A change of state of an external device (etalon, filter wheel, polariser, telescope position, chopping secondary, etc) and the operation of a shutter may be synchronised to these charge shuffling movements. Alternatively, no mask may be used, resulting in superimposed images from each of the phases, these images being separated spatially by the vertical shuffling. The object of charge shuffling is to attempt to improve the signal to noise (S/N) of the observation by rapidly chopping between two states within the timescale of some interfering observational variation. In addition, the object may be to use the same part of the CCD to detect both states of the measurement in order to provide better subtraction when, previously, the S/N may have been limited by detector inconsistencies. The ext device must be able to be programmed and initialised in such a way that a series of sync pulses from the CCD controller will cause the ext device to cycle through a known and predetermined sequence of conditions corresponding to each shift of the charge on the CCD. A choice between shuttered or unshuttered exposures is available. A shuttered exposure enables unsmeared exposures to be made. However the shortest opening times and maximum repetition rates (max may be 10Hz for physically small shutters) of the particular shutter being used and even perhaps how rapidly the shutter might wear out may limit phase times to relatively long values. Unshuttered exposures open the shutter at the start of the exposure and close it at the end just before the CCD is read out. These exposures offer the phase times that may be very short (less than a millisecond) but may suffer from objectionable image smearing, depending on the how rapidly the CCD charge shifting occurs (CCD dependant) and how much of the phase or cycle time is taken in moving the charge. A cycle is constructed from a number of phase definitions and a repetition feature in these enables more complex and lengthy cycles to be more easily defined. Exposures may range in complexity from the simplest two-image shuffle of comprising only 2 phases per cycle, through to a large number of image phases each comprising a chopping between two conditions. A very fast flash facility which fills the CCD in a single burst over a short interval is also available to, for example, sample transient phenomena, eg occultations at less than 1ms rates, if required. In all CSR modes, it will be possible to prevent the shutter opening to produce a dark frame so that the dark current or the incidence of cosmic rays may be examined or recorded to subtract from the object measurements. Similarly, with EXPTM and TINCR set to minimum values of 2 and TINCRmin respectively, a bias frame can be generated permitting the electronic bias level and the level of shift induced charge, etc to be determined. DEFINITIONS *********** The CSR requires the following to be defined. To the astronomer these would ultimately be presented as a definition table that is able to be changed at will. To the CCD controller they will be passed from the VAX as a series of command lines... INITIAL TIMING AND DELAY SPEC Initially the VAX will do no timing checks. Timing restrictions will be taken into account when when constructing the phase definitions and the cs command during the "experimental" stage of the CSR project, i.e. - which shutter is in use and the opening, Tdsho, and closing, Tdshc, times are reflected in the phase period and EXPTM values. - EXT device's time to settle, TDEXT, is needed and is sent as part of the cs command in the "experimental" stage of the CSR project. - other delays, eg micro processing times per phase, extra processing time per cycle, time to get started, Tmargin, etc are also reflected in the phase period and EXPTM values. in the "experimental" stage of the project ULTIMATELY CONSIDER Shutter definition (a choice of a few, eg small, large Uniblitz, Taurus, RGO spectr, UCLES, etc) each resulting in its own a delay to open, Tsho, and a delay to close, Tshc, used in the interactive setting of EXPTM and TINCR (or the phase timing from a SYNC source) done by the VAX. *** INITIALLY HAND CODED INTO PHASE DEFINITIONS *** External device definition (a choice of a few, eg etalon, polariser, chopping secondary, filter wheel, telescope settling time, etc) each resulting in a micro invoked delay to step 1, Tex1, delay to step 2, Tex2, delay to step 3, Tex3, etc, that may be sent to the controller. These delays are used in the interactive setting of EXPTM and TINCR (or the phase timing from a SYNC source) by the VAX. Initially, there is a need for a delay, TDEXT to be sent to the micro to cover the possibility that the EXT device takes longer to settle than the N Vshifts take to do, in which case the opening of the shutter must be delayed until TDEXT has expired. All the micro processing delays and Tmargin delays that must be used by the VAX are to be inputted and changed at any time to update the system.... SNThe total exposure time comprises the sum of the following times (as relevent to the type of CSR) The total exposure time comprises the sum of the following times (as relevent to the type of CSR) SYNC1 AND SYNC2 DETAILS When the CSR is to use the SYNC1/2 inputs the following VAX inputs are needed: 1. Tsync-start for cs(n5) in seconds 2. PERIOD1 or 2 is the SYNC1 or 2 period (in seconds) needed if cs(n6) = 1 or 2 and should be entered by the astronomer to 6 dec places (i.e. 1us precision) PHASE DEFINITIONS Each phase should be regarded as a "shift then expose" operation, done in that order, with some attached conditions included in the phase definition. The cycle definition comprises a number of phase definitions built up in a table. Each phase definition is as follows (parameters to be quickly skipped ensuring high speed on non-shuttered phases and long decodes done only on the slower shuttered phases in the CSR): Px STPH, ACTIR, EXPTM, TINCR, UP, NVSHIFT, REPEATS, OFFSET where Px = PS for a start-up phase = PR for a running phase = PE for an end-up phase NB: The phase table must begin with a PI which initialises the new phase table, and end with a PT which terminates the phase table. Ultimately these may be inserted automatically by the VAX but initially they may need to be entered manually as part of the phase table. STPH = interrupt used to start next phase *** THIS PARAMETER IS ALWAYS SET TO ZERO IN THE EXPERIMENTAL STAGE OF THE PROJECT *** = 0 skip, I/R as set in cs command = 1 SYNC1 = 2 SYNC2 = 3 TINCR = 4 N.V.Shift = 5 EXPTM = 6 skip wait, no I/R set, don't set wait for next I/R flag ACTIR = action to be taken immed after phase start I/R =-1 enable trigger EXT device, set EXTFLAG and ACTIONFLAG = 0 no action, skip leaving ACTIONFLAG clear = 1 open shutter set ACTIONFLAG (for non-shuttered open) = 2 close shutter set ACTIONFLAG (for non-shuttered close) EXPTM = for use with shuttered phases = 0 repeat the already loaded EXPTM, set sh. open flag = 1 disable EXPTM-timed shutter opening this phase >= 2 load number into EXPTM counter and set a shutter open flag NB: Unsigned number, max value of EXPTM is 2^16-1 TINCR = 0 ignore, skip, repeats last TINCR = 1 >= 2 load the number into the TINCR counter NB: Unsigned number, max value of TINCR is 2^16-1 UP = 0 skip, ignore, don't change direction = 1 shift up, forward or + direction, toward readout reg =-1 shift down, reverse or - direction, away from RO reg NVSHIFT = 0 repeat already loaded Vshifts (1 or >=2), set VSFLAG =-1 do no Vshifts this phase, clear VSFLAG = 1 do one Vshift, set WC6 bit-0, and set VSFLAG >= 2 load the number into the N.V.SHIFT counter, set WC6 bit-1, and set VSFLAG NB: Signed number, NVSHIFT has a max value of 2^15-1 REPEAT = 0 ignore, skip, no repeats required >= 1 do this number of repeats OFFSET = 0 ignore, repeat the same PXn if REPEAT >=1 >= 1 is the offset to be subtracted off the current phase number to get to the phase number of the start of the repeat Extra parameters to allow extension of the Px command for a more complex run specification may be added in the future (or do we invent another command....) THE PHASE TABLE Cycle Definition: a set of running phase definitions, executed in the running sequence, that can be repeated. The phase definition has built into it a repeat line function so that a phase can be repeated a number of times. This will save lots of memory space and time in making some run definitions. Also, may want to repeat, say, a pair of lines a number of times so that the repeat function uses an offset to find the phase number (always a lower phase number) from which the repeat should start. The cycle definition table is sent to the CCD controller as a series of Px commands one for each line of the table. The downloading of the Phase Table entries must be preceded by sending the 'PI' command, which initialises the new Phase Table. Following the downloading of the Phase Table entries, the 'PT' command must be sent, which terminates the Phase Table. Phase Table Definition Rules: - the first phase table definition of any type (START, RUN or END), is not offsetable, i.e. cannot loop back. - phase definitions defined within a repeat loop are themselves not repeatable (i.e. no nested repeats or loops). - a phase definition in which the offset is > 0 must have a repeat count > 0. - the minimum number of cycles is 1; a cycle count of zero will result in inconsistent behaviour. - the maximum number of phase table entries (including start, run and end phases) is 256. - phase table entries must be made (i.e. downloaded) in order, i.e. START phases, followed by RUN phases, followed by END phases. - negative numbers for phase table entries need to be entered as 16-bit unsigned decimal 2's complement equivalents, (e.g. -1 will be entered as 65535, -2 as 65534, etc). NB: There is an important difference between the description of the Startup, Running and Endup sequences in thiss document and the implementation in the micro software. This is that the microcode makes no distinction in the processing of START, RUN and END phases. The only case where the type of phase is checked is if the 'sp' command is received, at the end of the current phase, a check is made to see if END phases are currently being executed, and if not to see if there are any END phases. THE "CS" COMMAND The charge shuffling readout cs command is to be the last command sent by the VAX and its functions are to send the final details of the exposure and to trigger the start of the CSR. The cs command is - cs n1, n2, n3, n4, n5, n6, n7, contr where n1 = number of cycles (1 to 65535) n2 = selects the C14 MMR, setting the TINCR and EXPTM clock rate = 0 loads C1B0 for max TINCR of < 65ms ................ 1us = 1 loads C1C0 for max TINCR between 65 and 650ms...... 10us = 2 loads C1D0 for max TINCR between 650ms and 6.5 sec. 100us = 3 loads C1E0 for max TINCR between 6.5 and 65 sec.... 1ms = 4 loads C1F0 for max TINCR between 65 and 650 sec.... 10ms n3 = minimum phase time for BFs, TINCRmin, loaded into TINCR counter. Value is appropriate to the selected clock rate represented by n2 above. n4 = TDEXT time to be loaded into the TDEXT counter, i.e. the comandeered N.VS CNTR. Value is appropriate to the selected clock rate represented by n2 above. n5 = start of exposure triggered by.... = 0 start immediately, don't wait for an I/R = 1 by SYNC 1 I/R (hardware start of the exposure) = 2 by SYNC 2 I/R (hardware start of the exposure) n6 = all phases triggered by ..... = 0 ignore and use the Px specification = 1 SYNC 1 I/R (hardware start of each phase) = 2 SYNC 2 I/R (hardware start of each phase) = 3 TINCR I/R (soft software start of each phase) NB: The SYNC signal used to start and/or stop the exposure must not be the one that triggers all running phases n7 = stop the exposure triggered by.... = 0 nothing extra, ie use cycle counter or sc command = 1 by SYNC 1 I/R (hardware stop of the exposure) = 2 by SYNC 2 I/R (hardware stop of the exposure) contr = control byte (in hex) containing bit 0 = required state of EN SHUTTER OPEN (bit 0 in WC4) for the duration of the CSR, bit 1 = required state of EO EXPTM CLOSES SHUTTER (bit 1 in WC4) for the duration of the CSR, bit 2 = set if BF to be done (DF and NP are determined by the bit 0 and bit 1 states) and must be cleared or ignored if NP being done, i.e. bit 0 is set bits 3-7 for future expansion of control word Bits 0 to 2 of the control word are to be set by the VAX from astronomer input. Bits 0 and 1 must be set into the bits 0 and 1 respectively of the WC4 write control register. They replace the downloaded state of these bits the state of which should be saved before being overwritten so that they may be restored at the completion of the CSR. The micro will interpret the three bits as follows - Astronomer Request Control uP Interpretation - write the bit 2 bit 1 bit 0 control bits to WC4 and C DO A EO EXPTM EN SH. O BF CLOSES OPEN D Shutter open SHUTTER E continuously mode (unshuttered phase) 1 - Normal exp (NP) 0 0 1 disarm EXPTM, use START/STOP EXP to open shutter at start and close at end of exp 0 - Dark frame (DF) 0 0 0 disarm EXPTM, use ST/ST EXP ineffective. sh. stays closed. phase timing as for NP 4 - Bias frame (BF) 1 0 0 disarm EXPTM, use ST/ST EXP ineffective. sh. stays closed. Use TINCRmim. Shutter opened and closed each phase (shuttered phase) 3 - Normal exp (NP) 0 1 1 EXPTM used, START EXP used each phase 2 - Dark frame (DF) 0 1 0 EXPTM used, START EXP used each phase EXPTM and phase times as for NP 6 - Bias frame (BF) 1 1 0 EXPTM used, START EXP used each phase EXPTM set = 2. Use TINCRmin The times for "Phase timing MINIMISED" will ultimately be computed by the VAX and are passed to the micro in the cs command parameter n3, TINCRmin. For the bias frames, set a BIASFLAG, whereapon the micro must override the phase definition's values of the TINCR counter value with TINCRmin and set the EXPTM values to 2 for the shuttered BF. There may be a problem with getting short phase times for a BF when hardware inputs SYNC1/2 are used to trigger phases or cycles. In this case the appropriate DF may have to do the job of the BF..... STATUS, ABORT and STOP COMMANDS The following VAX read status commands have been created to facilitate debugging the hardware and software. In order to preserve the timing of the CSR command the VAX may be prevented from issuing these commands once the cs command has been sent. The read status commands applicable to the CSR are - xs Exposure status, returning the status of the exposure as follows 0 = idle status where the hardware is in STBYM 1 = setting-up status of the CSR is underway 2 = start-up sequence of the CSR is underway 3 = running sequence is set just before the first phase definition is executed, ie the first start phase, PS, and remains set till last PE has completed. Thus, it does not reflect the PS, PR and PE conditions 4 = end-up status is set after the completion of the last phase definition 5 = wrap-up status is set after the completion of the wrapup sequence 0 = idle state, set after wrap-up when the exposure completes and the hardware is back in STBYM ready for the normal readout pc Phase count, returns the number of phases remaining to be executed. This is the TOTAL number of phases, taking into account repeated phases, number of cycles, offset repeated phases etc. This is the actual counter that the microprocessor uses to control phase execution. This command is in general of more use than the 'cc' command. cc Cycle count returning the current (decrementing) cycle count of the CSR Abort Commands applicable to the CSR and issued when the exposure is to be aborted with no saving of any accrued data are - ai Abort immediately. As soon as possible drops out of the current CSR, does the wrap-up without executing any further phases, and awaits an 'IN' command from the VAX to reload the VAX downloaded parameters and get into STBYM (thus cleaning out the CCD), and making itself ready for the specific parameters relating to the next CSR exposure. Cleans up any CSR states from the aborted run (alternatively, new runs always overwrite parameters that may have been left over from aborted runs) Stop command applicable to the CSR and issued to prematurely stop the exposure with a readout of the accrued data is: sc Stop at the end of the current cycle The micro on detecting an sc command should process this as rapidly as possible by merely setting a flag STOPFLAG which will be tested at the end of each CSR cycle and during the CYCLETEST part of forecasting the next phase. Flag set will then cause the CSR to go to end-up sequence irrespective of the current cycle count. The current cycle count should be saved for reading by the VAX. INHIBIT VAX COMMANDS DURING EXPOSURE The ability to perform all the VAX commands is essential for debugging purposes but clearly there are some exposure modes where these commands would get in the way. In nonshuttered exposures, where the phase timing, eg TINCR, determines the exposure, and in critically timed shuttered exposures (with a need for sample-time precision), the VAX status requests and TEL commands should be turned off. Otherwise, there will be a serious jitter problem (as found in the TSR) in the TINCR operation due to these commands being processed by the micro and holding up the start of a cycle. In TSR these commands were removed from non-shuttered TSRs and for shuttered use, I think??? In shuttered exposures (where the exposure time is accurately and unchangeably set by hardware counters) and where delays opening the shutter, as the CSR progresses, may be tolerable, the VAX status and TEL commands could be permitted. Thus, very long exposures could be monitored. A simple facility should be available in the VAX for turning on and off the VAX's ability to interrogate the micro during the exposure. If one could selectively bring up permitted VAX commands it would even be more useful, eg, permit st, permit both st and cc, permit st, cc and TEL, etc..... CSR EXPOSURE TIMES Since the VAX may not be allowed to poll the micro to determine the progress of the CSR it needs to be able to determine how long the CSR exposure will take so that polling may start once the exposure is completed. The method of calculating this time is described in a separate document "COMPUTING THE CSR EXPOSURE TIMES". The document also describes how the exposure times are shortened when the exposure is either stopped prematurely or aborted. GENERAL REQUIREMENTS AND DISCUSSION *********************************** - the VAX should send the cs command only if the CCD controller is in STBYM - In order to accurately generate short TINCR and EXPTM and TDEXT intervals and to provide greater resolution in the timing, the clocking frequency applied to the TINCR, EXPTM and the commandeered N.VS CNTR counters is altered. This is done by a software reconfiguration of of the counter chip at card location C14 to change the scaler output frequency, FOUT. FOUT of card C14 drives the TINCR clock directly. The clock source for the EXPTM counter is changed to use CK3 (SRC3) of counter chip C24 (see below). The MMR of C14 is also changed to deselect comparator function for counter 1 now used as the TDEXT counter, reflected in the last hex digit being set to 0. MAX TINCR TIME FREQ SCALER FREQU RESOLUTION COUNTER C14 cs TINCR REQUESTED OUTPUT MAX TIMING MMR (hex) command start ERROR n2 value up to 65 ms F1 1 MHz 1 us C1B0 0 20000 from 65 to 650 ms F2 100 kHz 10 us C1C0 1 2000 from 650 to 6.5 sec F3 10 kHz 100 us C1D0 2 200 from 6.5 to 65 sec F4 1 kHz 1 ms C1E0 3 20 from 65 to 650 sec F5 100 Hz 10 ms C1F0 4 3 - the operating mode of the TINCR counter is mode Q with a CMR of hex 92A1 (the ROM default value) which defines - active high level gate 2 operation - count on falling edge of CK2 (SRC2) - enable hardware retrigger off gate edge w/ [count]-->[hold] - reload from load register at ea TC - count repetitively - binary count - count down - active high TC pulse The LOAD register of this counter is loaded on the fly with the value required for the next phase. The new value is loaded into the counter at the TC. I suspect the desired value of TINCR should be loaded, i.e. not value-1, and that a software step is not needed (indeed probably can't be done anyway). - the MMR of counter card C24 needs to be changed from the normal CCD readout default value of hex C1DC to hex C1D8 (same as that used in TSR) in order to deselect the alarm comparator output on the EXPTM counter. - the operating mode of the EXPTM counter is mode E (rather than the default mode R and the hex '5125' for TSR) with a CMR of hex 5325 which defines - active high level gate 2 operation - count on falling edge of CK3 (SRC3) - disable special gate - reload from load register at ea TC - count repetitively - binary count - count down - active low TC pulse The LOAD register of this counter is loaded on the fly with the value required for the next phase. The new value is loaded into the counter at the TC. I suspect the desired value of EXPTM should be loaded, i.e. not value-1, and that a software step is not needed (indeed probably can't be done anyway). - The N.VS CNTR, counter 1 in C14 is to be commandeered for use in timing the TDEXT delay. This is needed only for shuttered CSR exposures and should not be used on non-shuttered exposures in order to keep the cycle times as short as possible. The MMR of C14, changed above for the FOUT clock, has also been changed to disable the comparator function for counter 1. Thus the MMR last hex digit changes from 4 to 0. The CMR of counter 1 will also be changed from hex D1AD to hex D225 for mode F operation of the TDEXT counter - the high state of the output and a low going TC being retained. Thus, TDEXT counter definition is - active high edge triggered using gate 1 - count on falling edge of CK2 (SRC2) - disable special gate - reload from load register at ea TC - count repetitively - binary count - count down - active low TC pulse This use of N.VS CNTR as the TDEXT counter is acceptable as there is no mode change within the CSR. Note that the counter TC clocks a flip-flop that must be hardware reset (this same reset may also edge trigger the counter) and there are several sources able to do this. NB. That if the EXT device is slow to operate compared with the Vshift time then Tmargin may have to be increased to ensure the EXT device has settled for a reasonable time before the end of the phase otherwise the exposure will be done with a non-settled EXT. VAX must sort this out as it determines the minimum TINCR time or phase trigger period but, initially, this will be hand coded into the phase definitions. The TDEXT counter is used by loading the TDEXT time into the load register, loading the counter and stepping the counter in set-up sequence. In running stage, the micro sends a !TRIG VS CNTR pulse (WP2,1) and can set up the PIA for the I/R or to poll for "VS CNTR TC" to indicate that the TDEXT counter has timed out. - an ENABLE CSR selective set/clear flip=flop, EN CSR, has been provided to enable the generation of V clocks in the WAIT mode condition that exists for the duration of the CSR exposure time. V clocks are normally prevented in WAITM during the EXPTM phase of standard CCD imaging. EN CSR should be set immediately after entering WAITM in the set-up sequence and it should be cleared in the wrap-up sequence just after the saved parameters have been reloaded to return the controller to normal and just before the loop is re-started. - normal readout of the CCD will also include the standard double windowing and horizontal and/or vertical binning facilities (including split binning) as defined by the standard OBSERVER CCD window facilities. - the VAX should ensure that the required time to perform EXPTM + VSHIFTS + computing time + delays fits within the TINCR time..... Refer to the document "Computing the CSR Readout Exposure Times" but in the experimental stage of the project these will be hand coded into the phase definitions. - once the VAX issues the cs command only an abort or a premature stop will affect the readout (hold, extend and continue will not be possible) - PTE (prepare to expose) sets up a non-standard configuration of stopped vertical clocks (high or low state) during exposure to establish under which electrodes the photocharge is accumulated. This is required to reduce defects, dark currents, hot top rows, etc. Fractional pixel shifts of the centre of the pixel are also provided with this facility. Some CCDs have PTE enabled by the downloaded parameter tables (bit 5 set of WC4) and the CCDs performance has been optimised using it. This facility is retained in full in CSR for three phase CCDs (all current AAT CCDs except Thomson). However, it is only partially available with four phase CCDs (Thomson CCD only) as there are complications in providing a glitch-free reversal of the vertical clocks as only three of the four phases are able to be switched. For the Thomson CCD, as a temporary experiment, the following must be done in order to both reverse the clocks and to do the limited PTE (a single stop midway in V shift sequence): - hardware swap PhiV4 and PhiV1 on the electronics box dewar connector - generate a (set of) new SPEED files for Thomson, red and/or blue CCD, with the timing of PhiV4 and 1 reversed, i.e. V1 8,9,14,9,5,15,24,3 changed to V1 2,9,14,9,5,15,24,3 MC 2,9,5,15,7,6,7,6 changed to MC 8,9,5,15,7,6,7,6 These changes route PhiV2 and 4 through the reversing network and whenever these two phases are high, either at the end of a full V shift triplet or at the PTE condition when PTE is enabled and with VS 3,10,30 changed to VS 12,10,30 they may be swapped so that subsequent clocking will be reversed. The state of the V clocks at the PTE condition and the correct WC7 command to use to reverse the V clocking direction is established in the CSR set-up sequence as described below. Thereafter, the first V shift of a CSR phase takes the V clocks out of the PTE condition and sequences them through to the non-PTE state found at the end of a normal vertical clock triplet. This return to the normal state is counted as one vertical shift. After the required number of vertical shifts for the CSR phase has been completed the micro will invoke an immediate shift to the PTE condition. This last action is NOT counted as a vertical shift. Whether or not the WC4 bit-5 (EN PTE ON SHUTTER OPEN) has been set and for all the possibilities of PTE, to change the vertical clock direction from the reversed condition to the forward direction the command WC7,1 must be issued. Sending WC7,1 will always ensure the vertical clocks are returned to a forward direction. However, the success of the direction change (wrt preserving the CCD image) relies on the clock phase swopping (that is done to get back to forward direction) involving two clocks that are in the same hi or lo state. This will be the case if an integer number of vertical shifts have been done in the reverse direction. If the EXPTM counter is not going to be used as in shutter open continuously mode the micro will need to test the EN. PTE ON SHUTTER OPEN bit in WC4 and, if found set, the micro should set bit 3 of all WC6 bytes written during the TSR. In practice, this can be done even if EXPTM is used as the hardware will look after the cases of PTE being set from the two sources (START EXP pulse or the micro triggered PTE). - apart from sending WC6,10 to establish the state of the V clocks at the PTE condition, described above, there are two possible WC6 commands that may be sent in the running sequence: - if NVSHIFTnext, the number of vertical shifts to be done in the next phase, is only one then the N.V.SHIFT counter is not used and, instead, WC6 bit 0 is set (along with bit 3, as described above, if PTE is required) with all other bits of the WC6 byte cleared. - if NVSHIFTnext is 2 or more then the N.V.SHIFT counter is used (and must be so loaded) and WC6 bit 1 is now set (along with bit 3, as described above, if PTE is required) with all other bits of the WC6 byte cleared. - the PhiVEXP function will also be preserved with CSR exposures and is activated if EN PhiV EXP bit-3 of WC4 is set. This causes the voltages applied to the CCD during exposure times (i.e. when not vertically shifting) to be set to more favourable levels to suppress dark currents, light emitting defects, etc. During vertical shifts, the voltages applied may be increased to improve the charge transfer characteristics. If this function is enabled in the normal downloaded parameters the CCD will have been characterised under these conditions, thus it is important to retain this facility in the CSR. This is retained by the micro ensuring that all writes to WC4 contain this bit set. - the stopped state high/low condition [[[or the running state (NO - NOT THE RUNNING STATE: THE LOOP WILL NOT RUN WITH THE EN FULL uP VSC BIT SET AS IT IS BLOCKED BY ENHWVS BEING FALSE ON SHEET 9/ELS40)]]] of the H and R electrodes during an exposure will be unchanged when doing the CSR and will be left as required by the downloaded parameters for the particular CCD being used. and this condition will not be changed by doing the CSR. Under uP FULL VSC, a cleared state of the uP VS BUSY flag invokes both PhiV EXP and PhiHR EXP if these conditions are enabled in the download. Thus if the micro is not busy V shifting then hardware sets these EXP conditions as required. - some of the micro commands to the hardware require the new condition to be OR'd into the existing condition, eg the WC4 and WC6 command. - The conditions existing before the start of the CSR exposure (before any changes are made) should be saved and used to restore the system to its pre-CSR state once the CSR exposure has finished. This is necessary to ensure that the CSR exposure remaining on the CCD is read out as expected, in the normal way, using the CCD controller ROM default parameter tables as modified by subsequent VAX downloaded parameter tables, speed and window files. Note that the pre-CSR conditions cannot be restored by means of an RE. or IN. command as this process temporarilly upsets the CCD clocks and would destroy the CSR generated image. - some sort of TEL function is essential considering that normally the CCD is interrogated regularly except during the CCD readout itself. The exposure times with the cs command can become very long and under these conditions there is both a great nead and plenty of time available to do the TEL. However there are times when is should not be done..... TEL should be done as per the TSR. TEL is done by the micro in shuttered exposures but I don't think the VAX asks for the TEL data?? LGW's Micro Command Summary says in TSR that acquisition done only while the shutter is open and it is disabled at all other times. In fact, TEL could be done after the last thing in the setting up of the next phase providing that there was at least 200 or 300ms left to the next TINCR or SYNC1/2 I/R. VAX could determine this. Could be a TEL enable bit in the cs command set if TEL can be done (no point in doing it if VAX can't access it, thus may only be useful in shuttered exposures whose timing is unaffected by micro delays.... ********* check this ****** - the lab HP360 should be able to implement the CSR OPERATION ********* The following sequence of operations is required to perform the charge shuffling readout in response to the cs command. This description outlines the sequence of events but not necessarily the order or the organisation of the micro software. SET-UP SEQUENCE *************** - astronomer starts OBSERVER and calls for method "shuffle" which downloads the charge shuffling micro-code. - idle status, xs = 0, where the hardware is in STBYM, sent to the VAX on demand - astronomer selects, and the VAX downloads, the CSR "speed" table that is appropriate to the CCD detector on the system. These will be the standard speed tables currently in the system except for the Thomson CCDs which require a small hardware mod and new speed tables (initially to be in JRBs account). - astronomer loads the (standard) window containing the required windowing and binning parameters for the readout of the CSR image. - astronomer input, resulting in PI, PS, PR, PE, PT and the cs command, are derived from: - type of shutter and ext device parameters to be used - type of run, eg normal, bias, dark, use of shutter - the cycle spec in the form of a table of phase definitions - required triggering modes, number of cycles, etc to be used - disabling some VAX interrogation during exposure - Ultimately, the VAX will test that the following timing conditions are met before downloading the CSR paramters: - Sigma time <= TINCR or SYNC1/2 I/R period - Tdexs < TINCR(min) <= TVshift? >= TVshift? - shutter maximum rates not exceeded and due allowance made for opening and closing times - VAX calculates and displays the total time of the exposure as it may not be able to poll for a status report during the CSR exposure. If the astronomer calls for a bias frame, the reduced EXPTM = 2 and minimum phase times, TINCRmin (TINCR or SYNC1/2), must be taken into account in this exposure time calculation. *** CAN THIS VAX CALCULATION BE AVOIDED IN THE EXPERIMENTAL STAGE OF THE PROJECT **** - the CSR exposure parameters (PI, PS, PR, PEand PT) are first sent by the VAX and are stored away in micro RAM as required. - finally the VAX sends the cs command with the last few run parameters and this indicates that the exposure is to be started. The cs command is accepted by the micro only if the controller is in STBYM. - the cs command parameters are saved in RAM - If requested by the astronomer, the VAX must avoid sending any further commands (apart from STOP and ABORT commands) until the expiry of the calculated exposure time. A subset, or all of the VAX commands may be sent on some types of exposures. - inhibit the hardware acquisition of TEL in this sequence - setting-up status, xs = 1, sent to the VAX on demand - Read and save the state of the following before any CSR action overwrites: - C14 MMR - C24 MMR - TINCR CMR - EXPTM CMR - N.VS CNTR CMR - WC1 - WC4 - WC6 - WC7 - test bit 5 of WC4 (EN. PTE ON SHUTTER OPEN bit). If set, arrange (by means of a WC6 mask) that each write to WC6 has bit 3 set so that after each micro triggered V shift the potentials on the V electrodes are left in the required condition for exposing. If bit 5 of WC4 was not set, each write of WC6 should have bit 3 clear. - command the hardware to a clean stop (WC8,0), i.e. get the controller into STOPM. This may take up to 10ms so do it first, go away and attend to other setup tasks and check the status word for the STOPM condition later. - set the EO EXPTM CLOSES SHUTTER and the EN SHUTTER OPEN bits in WC4 in accordance with bits 1 and 0, respectively, of the control byte contained in the cs command. This looks after DFs automatically by the EN SHUTTER OPEN bit being cleared. If bit 2 is set, set the BIASFLAG to indicate that a BF is required. - change the EXPTM counter to mode E (rather than the default mode R) and change it to use CK3 (SRC3) by loading its counter mode register with hex 5325. Deselect the EXPTM alarm comparator output by loading the MMR of counter card C24 with hex C1D8. - the MMR of counter chip C14 is changed from C1E4 to the hex value found in n2 of the cs command in order to set the clock rate corresponding to the max TINCR time required for the CSR. - the CMR of the commandeered N.VS CNTR counter 1 of card C14 is changed from hex D1AD to hex D225 for mode F counter TDEXT operation. Load TDEXT (n4 of the cs command) into the counter load register, load the counter register and step the counter. - Set up for the most efficient running sequence operation. If possible all processing should be optimised for minimum phase times for non-shuttered exposures. Test the cs parameters and other relevant parameters and set up a "run description" so that the "running sequence" software jumps straight to the relevant action with a minimum of time delay. As much as possible pre-determine all choices and options. For example: - if using SYNC1/2 I/R then the TINCR field of the phase definitions can be completely ignored. - if the exposure is non-shuttered, the EXPTM field can be ignored - initially skip the STPH field too - needn't test OFFSET if REPEAT is zero - don't use TDEXT delay (N.VS CNTR counter) in non-shuttered exposures - test that the hardware is in STOPM (status_byte bits 0, 1 and 2 all zero). Wait if not, in a hard loop. When in STOPM all hardware retriggering of the loop V shift/H shift ceases. - turn off fast scan, if it is on - set the CCD clocks forward by writing WC7,1 - set EN FULL uP VSC bit in the set/reset byte. This disables the hardware retriggering of V shifts and isolates the V counters so that they dont affect the windowing and V binning. - disarm XTRL/PPL counter and set its output high to force PhiVEN so that each micro triggered vertical shift will result in a CCD shift without the first few triggers being considered as extra lines (XTRL). - the WC7,REVERSE command for the CCD in use can now be established by performing the following sequence. Test (done via the WC6 mask that has been set up earlier) if WC4 bit-5 has been set (EN PTE ON SHUTTER OPEN) in the downloaded parameter table. - IF SET - write WC6,10 to set SHIFT TO PTE - send TRIG.VSHIFT write pulse - poll (hard loop) for end of uP VS BUSY using the PIA - continue into IF NOT SET - IF NOT SET - read PhiV_byte - if bits 0 and 1 same state, REVERSE = 2 - if bits 1 and 2 same state, REVERSE = 4 - if bits 0 and 2 same state, REVERSE = 8 - if all 3 bits same state, set REVERSE = 2 - set up to receive a stop or an abort (this condition is always the case and no specific setup is done). An abort should, as soon as possible, cause a drop-out from the CSR exposure, execute the wrap-up without executing any further phases, and awaits an 'IN' command from the VAX to reload the VAX downloaded parameters. A stop should probably set a STOPFLAG that is tested at the end of a running sequence cycle. - Get the controller from STOPM into WAITM and the loop restarted (NO: THE LOOP WILL NOT RUN WITH THE EN FULL uP VSC BIT SET AS IT IS BLOCKED BY ENHWVS BEING FALSE ON SHEET 9/ELS40) by requesting WAITR (WC8,01), then WC6,05 (complete one V shift followed by a H readout) OR'd with bit 3 set if PTE required, followed by a TRIG VSHIFT pulse. After the resulting shift of one row and its readout, the system will be in WAITM. This may take about 10ms to complete. Completion is indicated by the uPVS BUSY flag which can be polled from the PIA. It will be set on the TRIG VSHIFT pulse and be reset at the end of the H readout. - set the ENABLE CSR selective set/clear flip=flop, EN CSR, by writing to the selective set register SS 80. This enables the generation of V clocks in the WAIT mode condition that exists for the duration of the CSR exposure time. - this ends the set-up sequence START-UP SEQUENCE ***************** - prepare for start-up according to n5 of the cs command, i.e. - if n5 = 0 go immediately go to start-up sequence - if n5 = 1 set up the PIA with EXT H/W SYNC 1 as the I/R source - if n5 = 2 set up the PIA with EXT H/W SYNC 2 as the I/R source - wait for I/R, process I/R then - start-up status, xs = 2, sent to the VAX on demand - determine, from n7 of the cs command, if SYNC1 or SYNC2 is to be activated as a hardware stop of the exposure. Prepare the PIA for this possibility. In the same way as done with the VAX "sc" command, an I/R received here should set the STOPFLAG - determine, from n6 of the cs command, the required source for the interrupts that trigger the start of all running sequences phases and get into synch with them: (if n6 = 0 there may be more than one trigger source and this triggering preparation should be ignored and, instead, the required phase trigger as specified in PR phase definition's STPH field should be used *** NOT IN EXPERIMENTAL STAGE ***) if n6 is not = 0 AS IT WILL BE IN THE EXPERIMENTAL STAGE OF THE PROJECT, then ALL phases are started by the same I/R and IT SHOULD BE ARRANGED THAT THE PRn PHASE DEFINITION STPH SHOULD BE SKIPPED TO SAVE TIME DURING THE RUNNING SEQUENCE if n6 = 1 set up PIA for SYNC 1 and wait for next I/R = 2 set up PIA for SYNC 2 and wait for next I/R = 3 set up PIA for TINCR I/R, but first, get the TINCR counter going by loading a short time of about 20ms. The value loaded is a function of the TINCR counter clock frequency as set by the MMR loaded into counter C14 from the cs command n2. A table of TINCR start values is accessed as described above under the general requirements. While this is hapening... - Wait for the first TINCR I/R. - receive I/R and process it - set up three phase pointer registers, CURRENT, PNEXT and FUTURE. At the start of each phase, just after the interrupt, the contents of these three registers are shuffled. Overwrite CURRENT phase number with PNEXT phase number and overwrite PNEXT phase number with FUTURE phase number. Thus, in this new phase, the CURRENT phase number is the PNEXT number that was set up in the last phase and the new PNEXT number to be set up in this CURRENT phase is the FUTURE phase as determined in the previous phase. Later, in this CURRENT phase, the phase number to load into FUTURE will be determined after examining the REPEAT and OFFSET parameters of PNEXT and examining the cycle counter SCC, a REPEAT counter, and the STOPFLAG. REFER TO: PSEUDO CODE FOR CHARGE SHUFFLING EXPOSURE RUNNING SEQUENCE - 18/9/95 LGW appended below, for further details of the microcode that actually implements the running sequence..... - the NEXT and FUTURE are then worked out - *set up this NB: for the EXPTM counter, in order to look after the first time thru AND loading the counter when it is not counting (i.e. it is turned off for the phase) first load the EXPTM into the load register, immediately test is EXPTM (bit 5 of status_byte) is set. If not load the counter reg and step the counter. If so, skip out. - *forecast FUTURE - micro sets running status here - hit the hardware strobe R1 done here every phase - wait for the selected I/R [B] - receive I/R and process it - *shuffle phase pointer registers - *execute CURRENT phase as set up above - *set up new PNEXT - *forecast new FUTURE (the next entry in PS table or PR1 the first entry representing the first phase of the cycle described in the in the running definition table - we could allow repeats here too just as in running sequence) - is PNEXT still a PSn? - yes: stay in start-up sequence - wait for the selected I/R - loop to [B] - no: go to running sequence is imminent - wait for the selected I/R - receive I/R and process it - go immediately to running sequence - if not, load PNEXT with PR1 - *set up PR1 - *forecast FUTURE - wait for the selected I/R - receive I/R and process it - go immediately to running sequence * refer to the running sequence for a complete definition of these actions RUNNING SEQUENCE **************** SUMMARY [A] - receive the TINCR (or SYNC...) interrupt - test if PNEXT=PE1: should we gone to end-up sequence? if so, hop out to END2 to go the end-up sequence if not, proceed... - shuffle phase pointer registers - execute CURRENT phase - trigger EXT change if required (start timer, TDEXT, by issuing a !TRIG VS CNTR pulse (WP2,1) to cover this, but only if a shuttered CSR - send TRIG VSHIFT to do the N Vshifts, fwd/bwd direction, ending in a PTE as required - wait for EO uP BUSY I/R OR end of TDEXT timeout * - trigger the EXPTM if required - test if PNEXT=0: no phase definition to set up if so, hop out to END2 if not, proceed.... - set up PNEXT by - load TINCR for next phase, if used, unless BIASFLAG - load NVSHIFT or WC6 for next phase (and step counter?) # - load WC7 direction byte for next phase - determine if shutter is to open in next phase * - load EXPTM for next phase, if used, unless BIASFLAG NB: for the EXPTM counter, in order to look after the first time thru AND loading the counter when it is not counting (i.e. it is turned off for the phase) first load the EXPTM into the load register, immediately test is EXPTM (bit 5 of status_byte) is set. If not load the counter reg and step the counter. If so, skip out. - determine if EXT is to change state in next phase - forecast FUTURE phase (next, repeat or jump), cycle, test STOPFLAG, or whether change of sequence or wrap-up - hit the hardware strobe R1 done here every phase - wait for next TINCR (or SYNC...) interrupt - jump back to [A] - END2: - wait for next TINCR (or SYNC...) interrupt - enter end-up sequence # do this just on contents of PD, i.e. don't test whether changing is required or not - just write out fwd WC6 or rev WC6 acc to the pD - running status, xs = 3, sent to the VAX on demand [A]- wait for the required TINCR or SYNC1/2 interrupt, receive and cancel source. - test if PNEXT=PE1: should we go to end-up sequence? if so, hop out to END3 to quit running sequence if not, stay in running sequence and continue..... REFER TO: PSEUDO CODE FOR CHARGE SHUFFLING EXPOSURE RUNNING SEQUENCE - 18/9/95 LGW appended below, for further details of the microcode that actually implements the running sequence..... - SHUFFLE PHASE POINTER REGISTERS: overwrite CURRENT phase number with PNEXT phase number and overwrite PNEXT phase number with FUTURE phase number. Thus, in this new phase, the CURRENT phase number is the PNEXT number that was set up in the last phase and the new PNEXT number to be set up in this CURRENT phase is the FUTURE phase as determined in the previous phase. Later, in this CURRENT phase, the phase number to load into FUTURE will be determined after examining the REPEAT and OFFSET parameters of PNEXT and examining the cycle counter SCC, a REPEAT counter, and the STOPFLAG. - EXECUTE THE CURRENT PHASE, PCURRENT (triggering EXT and/or shutter, V Shifts, and operate shutter) in the following order: - trigger EXT change (if EXTFLAG and ACTIONFLAG set). Start TDEXT timer by issuing a !TRIG VS CNTR pulse (WP2,1) to cover the time EXT takes, but only if a shuttered CSR - if ACTIONFLAG set and EXTFLAG clear, then issue a START EXP pulse to open the shutter if ACTIRnext = 1 or issue a STOP EXP pulse to close shutter if ACTIRnext = 2 - if VSFLAG is set - send TRIG VSHIFT, to do the N Vshifts (N=1 or >=2, shifting forward or backward and ending in a PTE, as already set up in the set-up PNEXT part of the phase) - poll for EO uP BUSY - then, if this is a shuttered CSR (and even if it is a DF), poll for "VS CNTR TC" indicating that TDEXT has timed out - send START EXP if the SHUTTER_OPEN flag is set (irresp. of DF or BF) - clear the SHUTTER_OPEN flag - test if PNEXT=0: if so, hop out to END2 to quit running sequence if not, stay in running sequence and continue..... REFER TO: PSEUDO CODE FOR CHARGE SHUFFLING EXPOSURE RUNNING SEQUENCE - 18/9/95 LGW appended below, for further details of the microcode that actually implements the running sequence..... - SET UP PNEXT (set I/R, TINCR, N.V.SHIFT , direction, shutter use, EXT use for the next phase): - set up the interrupt used to start next phase, Pnext, by looking at the STPHnext of Pnext's phase definition if STPHnext = 0 skip and use I/R as set in cs command ** STPHNEXT = 0 ALWAYS DONE IN EXPERIMENTAL STAGE OF THE PROJECT *** = 1 set up for SYNC1 = 2 set up for SYNC2 = 3 set up for TINCR = 4 set up for N.V.Shift = 5 set up for EXPTM = 6 skip wait, no I/R set, set a NOWAIT flag - if BIASFLAG not set, load TINCR for the next phase, Pnext, by looking at the TINCRnext of Pnext's phase definition if TINCRnext = 0 ignore, don't load, it will repeat last TINCR = 1 >= 2 load TINCRnext into the TINCR counter - if BIASFLAG is set, load TINCRmin (from cs command) - load N.V.SHIFT for the next phase, Pnext, by looking at NVSHIFTnext of Pnext's phase definition if NVSHIFTnext = 0 repeat previous V.Shift set-up, set VSFLAG =-1 do no Vshifts this phase, clear VSFLAG = 1 do one Vshift, set WC6 bit-0 in WC6 mask and write it out, then set VSFLAG >= 2 load NVSHIFTnext into the N.V.SHIFT counter, issue a load command then #step the counter, set WC6 bit-1 in WC6 mask and write it out, and set VSFLAG # to make the count equal to that resulting from a hardware TC load from the hold register plus one count from the clock to end TC - load the WC7 direction byte for the next phase, Pnext, by looking at UPnext of Pnext's phase definition if UPnext = 0 skip, ignore, don't change direction = 1 shift up, forward or + direction, toward readout reg by sending a WC7,1 =-1 shift down, reverse or - direction, away from RO reg by sending a WC7,REVERSE, where REVERSE is as determined in the set-up sequence - if BIASFLAG not set, and if this is a shuttered CSR, load EXPTM and/or determine if shutter is to open in next phase if EXPTMnext >= 2 load EXPTMnext into EXPTM counter load register and set the SHUTTER_OPEN flag = 1 disable shutter opening this phase by clearing the SHUTTER_OPEN flag = 0 set the SHUTTER_OPEN flag (this will repeat the already loaded EXPTM) - if BIASFLAG is set, and if this is a shuttered CSR, load value 2 into EXPTM and set SHUTTER_OPEN flag - determine if EXT is to change state in next phase if ACTIRnext = 0 no action, skip leaving ACTIONFLAG clear =-1 enable trigger EXT device, set EXTFLAG and ACTIONFLAG = 1 open shutter set ACTIONFLAG (for non-shuttered open) = 2 close shutter set ACTIONFLAG (for non-shuttered close) - FORECAST FUTURE PHASE: ***FUTURE will be PNEXT+1 if PNEXTn has no REPEAT or it will be PNEXT-OFFSET if PNEXTn has a REPEAT. This will start another repeat unless the required number of repeats has been done in which case FUTURE will be PNEXT+1 ***if FUTURE has been set to PNEXT+1 do the CYCLETEST to determine if PNEXT+1 is greater than PRnmax (the last running sequence PRn) indicating the start of a new cycle may be required if the required number have not already been done and the STOPFLAG is not set. Otherwise end-up sequence or wrap-up is next and FUTURE will be set to PE1 or go straight to wrap-up. REFER TO: PSEUDO CODE FOR CHARGE SHUFFLING EXPOSURE RUNNING SEQUENCE - 18/9/95 LGW appended below, for further details of the microcode that actually implements the running sequence..... - is REPEATnext zero, indicating PNEXT is not a repeat pointing phase - yes, indicating take next sequential phase in table - set FUTURE=PNEXT+1 then go to CYCLETEST - no, indicating that this is a repeat pointing phase - is REPCNTR=0 (the repeat counter) - yes, indicating that this is the first time this repeat pointing phase has been encountered and is the start of a new repeat seq - load REPEATnext into REPCNTR - set FUTURE=PNEXT-OFFSETnext and go to END - no, indicating that this repeat pointing phase has been encountered recently and that the repeat loop may not be finished - decrement REPCNTR - is REPCNTR=0? test state of repeats - yes, indicating imminent completion of repeats - set FUTURE=PNEXT+1 then go to CYCLETEST - no, indicating another repeat needed - set FUTURE=PNEXT-OFFSETnext, go to END - CYCLETEST: test if FUTURE>PH_NUM_MAX? [PH_NUM_MIN loaded with PSnmin when in starting-sequence PRnmin when in running-sequence PEnmin when in end-sequence] [PH_NUM_MAX loaded with PSnmax when in starting-sequence PRnmax when in running-sequence PEnmax when in end-sequence] ******** DOESNT WORK AT END OF RUNNING WITH PE1 AND PE2 ABOUT TO OR ALREADY IN THE FUTURE REGISTER........ MAYBE DO THE CYCLETEST ONLY IF TESTING A PR AND NOT A PE???? ************* - no: indicating not close to the end of cycle - go to END - yes: indicating that end of cycle is imminent - decrement SCC the cycle counter - is SCC=0 - no: indicating another cycle should be started - but is STOPFLAG set? - yes, premature end of running sequence requested - set FUTURE=PE1 or set FUTURE=0 if come to the end of the phase table and go to END - no , need to start the next cycle - set FUTURE=PH_NUM_MIN and go to END - yes: indicating that end of running sequence is imminent - set FUTURE=PE1 or set FUTURE=0 if come to the end of the phase table and go to END - END... continue... - a strobe on pin B12/R1 could be issued at the start of the wait for interrupt in order to assess the spare time available. - enable TEL. if possible. The uP could actually do its part of TEL at this time without a VAX command (ie the part that reads the hardware and is prohibited during normal ROM because it interferes with the readout) and keep updating the results in its RAM. When the VAX asks for TEL the RAM values are sent without doing the uP/hardware part of TEL. *** NOT IN EXPERIMENTAL STAGE PERHAPS *** - disable TEL just before I/R due *** NOT IN EXPERIMENTAL STAGE PERHAPS *** - jump back to [A] above - END2: - wait for next TINCR (or SYNC...) interrupt - END3 immediately enter end-up sequence END-UP SEQUENCE *************** - end-up sequence status, xs = 4, sent to the VAX on demand End-up sequence is entered during the processing of the phase definition table after the phase start interrupt by one of two ways. PNEXT may be set to PE1 (before the register shuffle) indicating that there is at least one PE entry in the phase definition table to be executed in end-up sequence using the same phase processing code as for the running sequence. After the last PE line of the table is processed the code will set PNEXT to zero and thus processing should go straight to the micro code below Alternatively, PNEXT may already be set to zero on entering end-up sequence indicating that no PE phase definitions exist in the table after the running sequence and thus processing should go straight to the micro code below - END status set here - stop the TINCR counter, now that all PXn's have completed, by resetting the GATE TINCR bit of the set/reset register - test status_byte to determine if shutter is open. - if so, do a further STOP EXP pulse to close shutter - insert a 100ms wait loop before skipping to wrapup - if not, skip to wrapup WRAP-UP SEQUENCE **************** - wrap-up status, xs = 5, sent to the VAX on demand - clear EN FULL uP VSC bit in the set/reset byte. This will re-enable the hardware retriggering of V shifts - re-arm the XTRL/PPL counter and set its output low again. - re-store to normal using the saved list of changed parameters saved prior to run start the following - C14 MMR - C24 MMR - TINCR CMR - EXPTM CMR - N.VS CNTR CMR - WC1 - WC4 - WC6 - WC7 - the N.VS CNTR may need its alarm reg reloaded?? - reset the ENABLE CSR selective set/clear flip=flop, EN CSR, by writing to the selective reset register SR 80. This prevents the generation of V clocks in the WAITM condition returning the clock generation back to normal. - get the loop going now that the controller is back in hardware control and the normal parameters have been restored. Do this by saving WC6, writing WC6,01 (complete one V shift) followed by a TRIG VSHIFT pulse (this will start the loop with the uPTPhiV pulse). Finally, restore WC6 with the saved value. - issue a reset FIFO pulse - return TEL to normal - wrap-up complete status, xs = 0, sent to the VAX on demand - await the VAX "ro" command to start the normal CCD readout as per speed and window spec COMPUTING THE CSR EXPOSURE TIMES ******************************** Started 29/9/95 Updated 3/10/95 J.R.Barton ccd_charge_shuffling.txt The total exposure time is the time from when the micro receives the cs command to the time when the VAX is able to poll for status without interfering with the timing of the CSR, i.e. the CSR should have completed and is ready for the CCD readout. The following VAX inputs are required: 1. Tsync-start for cs(n5) in seconds 2. PERIOD1 or 2 is the SYNC1 or 2 period (in seconds) needed if cs(n6) = 1 or 2 and should be entered by the astronomer to 6 dec places (i.e. 1us precision) The total exposure time comprises the sum of the following times (as relevent to the type of CSR) WAITING FOR A SYNC1/2 START If cs(n5) = 0, Tsync-start = 0.001 sec, i.e. minimum delay to start If cs(n5) = 1 or 2 then an estimate must be made of the time that will elapse after issuing the cs command to when the SYNC1 or 2 exposure start interrupt will be received. Here, Tsync-start may be up to a full period if these interrupts oare periodical. Other wise they may occur at random or.... GETTING INTO SYNC If cs(n6) = 3 (TINCR triggers all phases) then Tget-in-sync= 0.040 sec If cs(n6) = 1 or 2 then Tget-in-sync= (from 1 to 2)*SYNC1/2 period, sec START SEQUENCE RUN TIME PSi=S PSm=i Tstart-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PSi=1 PSm=(i-OFFSETi) where PSi is the i-th start phase entry in the table starting at PS1 and containing a total of S start phase entries PSm are start phase entries involved in a repeat loop defined by the phase entry PSi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) RUNNING SEQUENCE RUN TIME PRi=R PRm=i Trun-sequ = CYCLES * SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PRi=1 PRm=(i-OFFSETi) where PRi is the i-th run phase entry in the table starting at PR1 and containing a total of R run phase entries PRm are run phase entries involved in a repeat loop defined by the phase entry PRi parameters REPEATi and OFFSETi. CYCLES is the number of run cycles given by cs(n1) If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) END SEQUENCE RUN TIME PEi=E PEm=i Tend-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PEi=1 PEm=(i-OFFSETi) where PEi is the i-th end phase entry in the table starting at PE1 and containing a total of E end phase entries PEm are end phase entries involved in a repeat loop defined by the phase entry PEi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) SHORTENED TIMES DUE TO A PREMATURE STOP When the CSR exposure is terminated prematurely the VAX should estimate as best as possible when to start polling for status prior to initiating the CCD readout. Premature stops occur either when the cs command is invoked or, when cs(n7) is set to 1 or 2, by SYNC1/2 being used to stop the exposure and both terminate the CSR after completing the current run cycle. For the sc command, the VAX is able to delay the start of polling until a further single run sequence cycle time plus end sequence run time has expired after the sc command was issued. If the cycle time is very long, the VAX should be able to improve on the estimated time to start polling by estimating how far through the cycle the CSR has progressed at the time the sc command was sent. The SYNC1/2 case presents a problem for the VAX if it does not know when these SYNC stops will occur. Maybe those CSRs with cs(n7) set to 1 or 2 will need to be polled right from the start.... or after an estimated delay.... or maybe the VAX polling can be initiated from the keyboard as the observer will probably know when the SYNC1/2 happens - this could be done as a manually initiated readout (the VAX first polling for status before initiating the readout. SHORTENED TIMES DUE TO ABORTS Once the ai command is issued the VAX may start polling the exposure status for xs = 0, the idle state. The abort is recognised at the end of the current run phase, the end sequence is skipped and the wrapup is done before the idle state is set. Once xs = 0 is detected the VAX should issue an IN command. ___________________________________________________________________________ SYSTEM TESTS ************ FOR POCKET PUMPING - One flash for EXPTM and lots of shuffles with closed shutter - Flash between each shift. How does this compare with above - Change clock voltages affect traps? - trapped charge vs number of shifts - trapped charge vs intensitiy for one flash and multi flash inputs above - traps vs PTE setting PSEUDO CODE FOR CHARGE SHUFFLING EXPOSURE RUNNING SEQUENCE - 18/9/95 LGW ************************************************************************* On Receipt of 'PT' command ... Calculate Total Number of Start Phases to be Executed Calculate Total Number of Run Phases to be Executed Calculate Total Number of End Phases to be Executed Using the formula: Total X Phases = Sigma (((1 + X Phase i Repeats) x (1 + X Phase i Offset)) - X Phase i Offset)) i = 1 to Number of X Phase Entries X = Start, Run, End On Receipt of 'cs' command (which specifies Cycles) Total Phases to Execute = Total Start Phases to Execute + Total Run Phases to Execute x Cycles + Total End Phases to Execute The following pseudo code describes execution of the Running Sequence in Charge Shuffling Exposure Mode. Set Running Status (xs == 2) if cs_Start_Phase_Trigger = TINCR then Kick Start TINCR Wait for Phase Sync Interrupt Cycle Count = Cycles Next Phase = First Phase Entry Offset Phase Count = 0 Phase Repeat Count = Next Phase Repeat Count if Next Phase == Last Run Phase and Cycle Count > 1 then begin Future Phase = First Run Phase Cycle Count = Cycle Count - 1 end else begin Future Phase = Next Phase + 1 end Wait for First Phase Sync Interrupt while Total Phases to Execute > 0 and Abort Flag False begin Current Phase = Next Phase Next Phase = Future Phase Execute Current Phase Setup Next Phase if Phase Repeat Count == 0 then begin if Next Phase Offset > 0 then begin Offset Phase Count = Next Phase Offset + 1 Phase Repeat Count = Next Phase Repeat Count Future Phase = Next Phase - Next Phase Offset end else {Next Phase Offset == 0} begin if Next Phase Repeat Count > 0 then begin Phase Repeat Count = Next Phase Repeat Count Offset Phase Count = 0 Future Phase = Next Phase end else begin Phase Repeat Count = 0 Offset Phase Count = 0 if Next Phase == Last Run Phase and Cycle Count > 1 then begin Future Phase = First Run Phase Cycle Count = Cycle Count - 1 end else begin Future Phase = Next Phase + 1 end end end end else {Phase Repeat Count > 0} begin if Offset Phase Count > 0 then begin Offset Phase Count = Offset Phase Count - 1 if Offset Phase Count == 0 then begin Phase Repeat Count = Phase Repeat Count - 1 if Phase Repeat Count == 0 then begin if Next Phase == Last Run Phase and Cycle Count > 1 then begin Future Phase = First Run Phase Cycle Count = Cycle Count - 1 end else begin Future Phase = Next Phase + 1 end end else begin Future Phase = Next Phase - Next Phase Offset Phase Count = Next Phase Offset + 1 end end else begin if Next Phase == Last Run Phase and Cycle Count > 1 then begin Future Phase = First Run Phase Cycle Count = Cycle Count - 1 end else begin Future Phase = Next Phase + 1 end end end else begin Phase Repeat Count = Phase Repeat Count - 1 if Phase Repeat Count == 0 then begin if Next Phase == Last Run Phase and Cycle Count > 1 then begin Future Phase = First Run Phase Cycle Count = Cycle Count - 1 end else begin Future Phase = Next Phase + 1 end end else begin Future Phase = Next Phase end end end Total Phases To Execute = Total Phases To Execute - 1 Test External Sync Input if Stop At End of Cycle Flag True then begin Reset Stop At End of Cycle Flag if Cycle Count > 1 then begin if Total Phases to Execute > (Total Run Phases to Execute x Cycles + Total End Phases To Execute) then begin Total Phases To Execute = Total End Phases to Execute - Total Run Phases To Execute x (Cycles - 1) Cycle Count = 1 end else if Total Phases To Execute > Total End Phases To Execute then begin Total Phases To Execute = Total End Phases to Execute - Total Run Phases To Execute x (Cycle Count - 1) Cycle Count = 1 end end end Wait for Next Phase Sync Interrupt end where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) RUNNING SEQUENCE RUN TIME PRi=R PRm=i Trun-sequ = CYCLES * SIGMA (PHTshuffle_2.txt��������������������������������������������������������������������������������������� 664 � 516 � 17 � 46414 6430203351 6556� �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� VAX INPUTS TO THE CSR ********************* Started 4/10/95 Updated 4/10/95 J.R.Barton csr_vax_inputs.txt LIST OF VAX COMMANDS PHASE TABLE Named and saved in an astronomer editable file Modifiable by the observer, ie contains exposure times, for example Downloaded to the CCD controller in the same way as a new speed, i.e. when the phase table file is selected it is downloaded THE "CS" COMMAND Generated by the observer, saved somehow, and modified automatically according to observer requirements of NP, BF, DF and # cycles Output to the CCD controller when RUN commanded STATUS, ABORT AND STOP COMMANDS The sending of status "xs", phase count "pc", cycle count "cc" and TELEMETRY requests should be selectively enabled/disabled by the observer so that if all of these are turned off the VAX prevents all communication with the CCD controller for the duration of the exposure time. OTHER INPUTS These are needed to compute the exposure times used when communication to the controller is disabled and are as follows: The SNYC1 or 2 periods, PERIOD1 or 2 Estimated delay in receiving Tsync-start after the cs command is issued Refer to the document "COMPUTING THE CSR EXPOSURE TIMES" for details DEFINITIONS *********** The following list of VAX commands has been plucked out of the CSR DRAFT ISSUE document: The CSR requires the following to be defined. To the astronomer these would ultimately be presented as a definition table that is able to be changed at will. To the CCD controller they will be passed from the VAX as a series of command lines... INITIAL TIMING AND DELAY SPEC Initially the VAX will do no timing checks. Timing restrictions will be taken into account when when constructing the phase definitions and the cs command during the "experimental" stage of the CSR project, i.e. - which shutter is in use and the opening, Tdsho, and closing, Tdshc, times are reflected in the phase period and EXPTM values. - EXT device's time to settle, TDEXT, is needed and is sent as part of the cs command in the "experimental" stage of the CSR project. - other delays, eg micro processing times per phase, extra processing time per cycle, time to get started, Tmargin, etc are also reflected in the phase period and EXPTM values. in the "experimental" stage of the project ULTIMATELY CONSIDER Shutter definition (a choice of a few, eg small, large Uniblitz, Taurus, RGO spectr, UCLES, etc) each resulting in its own a delay to open, Tsho, and a delay to close, Tshc, used in the interactive setting of EXPTM and TINCR (or the phase timing from a SYNC source) done by the VAX. *** INITIALLY HAND CODED INTO PHASE DEFINITIONS *** External device definition (a choice of a few, eg etalon, polariser, chopping secondary, filter wheel, telescope settling time, etc) each resulting in a micro invoked delay to step 1, Tex1, delay to step 2, Tex2, delay to step 3, Tex3, etc, that may be sent to the controller. These delays are used in the interactive setting of EXPTM and TINCR (or the phase timing from a SYNC source) by the VAX. Initially, there is a need for a delay, TDEXT to be sent to the micro to cover the possibility that the EXT device takes longer to settle than the N Vshifts take to do, in which case the opening of the shutter must be delayed until TDEXT has expired. All the micro processing delays and Tmargin delays that must be used by the VAX are to be inputted and changed at any time to update the system.... SNThe total exposure time comprises the sum of the following times (as relevent to the type of CSR) The total exposure time comprises the sum of the following times (as relevent to the type of CSR) SYNC1 AND SYNC2 DETAILS When the CSR is to use the SYNC1/2 inputs the following VAX inputs are needed: 1. Tsync-start for cs(n5) in seconds 2. PERIOD1 or 2 is the SYNC1 or 2 period (in seconds) needed if cs(n6) = 1 or 2 and should be entered by the astronomer to 6 dec places (i.e. 1us precision) PHASE DEFINITIONS Each phase should be regarded as a "shift then expose" operation, done in that order, with some attached conditions included in the phase definition. The cycle definition comprises a number of phase definitions built up in a table. Each phase definition is as follows (parameters to be quickly skipped ensuring high speed on non-shuttered phases and long decodes done only on the slower shuttered phases in the CSR): Px STPH, ACTIR, EXPTM, TINCR, UP, NVSHIFT, REPEATS, OFFSET where Px = PS for a start-up phase = PR for a running phase = PE for an end-up phase NB: The phase table must begin with a PI which initialises the new phase table, and end with a PT which terminates the phase table. Ultimately these may be inserted automatically by the VAX but initially they may need to be entered manually as part of the phase table. STPH = interrupt used to start next phase *** THIS PARAMETER IS ALWAYS SET TO ZERO IN THE EXPERIMENTAL STAGE OF THE PROJECT *** = 0 skip, I/R as set in cs command = 1 SYNC1 = 2 SYNC2 = 3 TINCR = 4 N.V.Shift = 5 EXPTM = 6 skip wait, no I/R set, don't set wait for next I/R flag ACTIR = action to be taken immed after phase start I/R =-1 enable trigger EXT device, set EXTFLAG and ACTIONFLAG = 0 no action, skip leaving ACTIONFLAG clear = 1 open shutter set ACTIONFLAG (for non-shuttered open) = 2 close shutter set ACTIONFLAG (for non-shuttered close) EXPTM = for use with shuttered phases = 0 repeat the already loaded EXPTM, set sh. open flag = 1 disable EXPTM-timed shutter opening this phase >= 2 load number into EXPTM counter and set a shutter open flag NB: Unsigned number, max value of EXPTM is 2^16-1 TINCR = 0 ignore, skip, repeats last TINCR = 1 >= 2 load the number into the TINCR counter NB: Unsigned number, max value of TINCR is 2^16-1 UP = 0 skip, ignore, don't change direction = 1 shift up, forward or + direction, toward readout reg =-1 shift down, reverse or - direction, away from RO reg NVSHIFT = 0 repeat already loaded Vshifts (1 or >=2), set VSFLAG =-1 do no Vshifts this phase, clear VSFLAG = 1 do one Vshift, set WC6 bit-0, and set VSFLAG >= 2 load the number into the N.V.SHIFT counter, set WC6 bit-1, and set VSFLAG NB: Signed number, NVSHIFT has a max value of 2^15-1 REPEAT = 0 ignore, skip, no repeats required >= 1 do this number of repeats OFFSET = 0 ignore, repeat the same PXn if REPEAT >=1 >= 1 is the offset to be subtracted off the current phase number to get to the phase number of the start of the repeat Extra parameters to allow extension of the Px command for a more complex run specification may be added in the future (or do we invent another command....) THE PHASE TABLE Cycle Definition: a set of running phase definitions, executed in the running sequence, that can be repeated. The phase definition has built into it a repeat line function so that a phase can be repeated a number of times. This will save lots of memory space and time in making some run definitions. Also, may want to repeat, say, a pair of lines a number of times so that the repeat function uses an offset to find the phase number (always a lower phase number) from which the repeat should start. The cycle definition table is sent to the CCD controller as a series of Px commands one for each line of the table. The downloading of the Phase Table entries must be preceded by sending the 'PI' command, which initialises the new Phase Table. Following the downloading of the Phase Table entries, the 'PT' command must be sent, which terminates the Phase Table. Phase Table Definition Rules: - the first phase table definition of any type (START, RUN or END), is not offsetable, i.e. cannot loop back. - phase definitions defined within a repeat loop are themselves not repeatable (i.e. no nested repeats or loops). - a phase definition in which the offset is > 0 must have a repeat count > 0. - the minimum number of cycles is 1; a cycle count of zero will result in inconsistent behaviour. - the maximum number of phase table entries (including start, run and end phases) is 256. - phase table entries must be made (i.e. downloaded) in order, i.e. START phases, followed by RUN phases, followed by END phases. - negative numbers for phase table entries need to be entered as 16-bit unsigned decimal 2's complement equivalents, (e.g. -1 will be entered as 65535, -2 as 65534, etc). NB: There is an important difference between the description of the Startup, Running and Endup sequences in thiss document and the implementation in the micro software. This is that the microcode makes no distinction in the processing of START, RUN and END phases. The only case where the type of phase is checked is if the 'sp' command is received, at the end of the current phase, a check is made to see if END phases are currently being executed, and if not to see if there are any END phases. THE "CS" COMMAND The charge shuffling readout cs command is to be the last command sent by the VAX and its functions are to send the final details of the exposure and to trigger the start of the CSR. The cs command is - cs n1, n2, n3, n4, n5, n6, n7, contr where n1 = number of cycles (1 to 65535) n2 = selects the C14 MMR, setting the TINCR and EXPTM clock rate = 0 loads C1B0 for max TINCR of < 65ms ................ 1us = 1 loads C1C0 for max TINCR between 65 and 650ms...... 10us = 2 loads C1D0 for max TINCR between 650ms and 6.5 sec. 100us = 3 loads C1E0 for max TINCR between 6.5 and 65 sec.... 1ms = 4 loads C1F0 for max TINCR between 65 and 650 sec.... 10ms n3 = minimum phase time for BFs, TINCRmin, loaded into TINCR counter. Value is appropriate to the selected clock rate represented by n2 above. n4 = TDEXT time to be loaded into the TDEXT counter, i.e. the comandeered N.VS CNTR. Value is appropriate to the selected clock rate represented by n2 above. n5 = start of exposure triggered by.... = 0 start immediately, don't wait for an I/R = 1 by SYNC 1 I/R (hardware start of the exposure) = 2 by SYNC 2 I/R (hardware start of the exposure) n6 = all phases triggered by ..... = 0 ignore and use the Px specification = 1 SYNC 1 I/R (hardware start of each phase) = 2 SYNC 2 I/R (hardware start of each phase) = 3 TINCR I/R (soft software start of each phase) NB: The SYNC signal used to start and/or stop the exposure must not be the one that triggers all running phases n7 = stop the exposure triggered by.... = 0 nothing extra, ie use cycle counter or sc command = 1 by SYNC 1 I/R (hardware stop of the exposure) = 2 by SYNC 2 I/R (hardware stop of the exposure) contr = control byte (in hex) containing bit 0 = required state of EN SHUTTER OPEN (bit 0 in WC4) for the duration of the CSR, bit 1 = required state of EO EXPTM CLOSES SHUTTER (bit 1 in WC4) for the duration of the CSR, bit 2 = set if BF to be done (DF and NP are determined by the bit 0 and bit 1 states) and must be cleared or ignored if NP being done, i.e. bit 0 is set bits 3-7 for future expansion of control word Bits 0 to 2 of the control word are to be set by the VAX from astronomer input. Bits 0 and 1 must be set into the bits 0 and 1 respectively of the WC4 write control register. They replace the downloaded state of these bits the state of which should be saved before being overwritten so that they may be restored at the completion of the CSR. The micro will interpret the three bits as follows - Astronomer Request Control uP Interpretation - write the bit 2 bit 1 bit 0 control bits to WC4 and C DO A EO EXPTM EN SH. O BF CLOSES OPEN D Shutter open SHUTTER E continuously mode (unshuttered phase) 1 - Normal exp (NP) 0 0 1 disarm EXPTM, use START/STOP EXP to open shutter at start and close at end of exp 0 - Dark frame (DF) 0 0 0 disarm EXPTM, use ST/ST EXP ineffective. sh. stays closed. phase timing as for NP 4 - Bias frame (BF) 1 0 0 disarm EXPTM, use ST/ST EXP ineffective. sh. stays closed. Use TINCRmim. Shutter opened and closed each phase (shuttered phase) 3 - Normal exp (NP) 0 1 1 EXPTM used, START EXP used each phase 2 - Dark frame (DF) 0 1 0 EXPTM used, START EXP used each phase EXPTM and phase times as for NP 6 - Bias frame (BF) 1 1 0 EXPTM used, START EXP used each phase EXPTM set = 2. Use TINCRmin The times for "Phase timing MINIMISED" will ultimately be computed by the VAX and are passed to the micro in the cs command parameter n3, TINCRmin. For the bias frames, set a BIASFLAG, whereapon the micro must override the phase definition's values of the TINCR counter value with TINCRmin and set the EXPTM values to 2 for the shuttered BF. There may be a problem with getting short phase times for a BF when hardware inputs SYNC1/2 are used to trigger phases or cycles. In this case the appropriate DF may have to do the job of the BF..... STATUS, ABORT and STOP COMMANDS The following VAX read status commands have been created to facilitate debugging the hardware and software. In order to preserve the timing of the CSR command the VAX may be prevented from issuing these commands once the cs command has been sent. The read status commands applicable to the CSR are - xs Exposure status, returning the status of the exposure as follows 0 = idle status where the hardware is in STBYM 1 = setting-up status of the CSR is underway 2 = start-up sequence of the CSR is underway 3 = running sequence is set just before the first phase definition is executed, ie the first start phase, PS, and remains set till last PE has completed. Thus, it does not reflect the PS, PR and PE conditions 4 = end-up status is set after the completion of the last phase definition 5 = wrap-up status is set after the completion of the wrapup sequence 0 = idle state, set after wrap-up when the exposure completes and the hardware is back in STBYM ready for the normal readout pc Phase count, returns the number of phases remaining to be executed. This is the TOTAL number of phases, taking into account repeated phases, number of cycles, offset repeated phases etc. This is the actual counter that the microprocessor uses to control phase execution. This command is in general of more use than the 'cc' command. cc Cycle count returning the current (decrementing) cycle count of the CSR Abort Commands applicable to the CSR and issued when the exposure is to be aborted with no saving of any accrued data are - ai Abort immediately. As soon as possible drops out of the current CSR, does the wrap-up without executing any further phases, and awaits an 'IN' command from the VAX to reload the VAX downloaded parameters and get into STBYM (thus cleaning out the CCD), and making itself ready for the specific parameters relating to the next CSR exposure. Cleans up any CSR states from the aborted run (alternatively, new runs always overwrite parameters that may have been left over from aborted runs) Stop command applicable to the CSR and issued to prematurely stop the exposure with a readout of the accrued data is: sc Stop at the end of the current cycle The micro on detecting an sc command should process this as rapidly as possible by merely setting a flag STOPFLAG which will be tested at the end of each CSR cycle and during the CYCLETEST part of forecasting the next phase. Flag set will then cause the CSR to go to end-up sequence irrespective of the current cycle count. The current cycle count should be saved for reading by the VAX. INHIBIT VAX COMMANDS DURING EXPOSURE The ability to perform all the VAX commands is essential for debugging purposes but clearly there are some exposure modes where these commands would get in the way. In nonshuttered exposures, where the phase timing, eg TINCR, determines the exposure, and in critically timed shuttered exposures (with a need for sample-time precision), the VAX status requests and TEL commands should be turned off. Otherwise, there will be a serious jitter problem (as found in the TSR) in the TINCR operation due to these commands being processed by the micro and holding up the start of a cycle. In TSR these commands were removed from non-shuttered TSRs and for shuttered use, I think??? In shuttered exposures (where the exposure time is accurately and unchangeably set by hardware counters) and where delays opening the shutter, as the CSR progresses, may be tolerable, the VAX status and TEL commands could be permitted. Thus, very long exposures could be monitored. A simple facility should be available in the VAX for turning on and off the VAX's ability to interrogate the micro during the exposure. If one could selectively bring up permitted VAX commands it would even be more useful, eg, permit st, permit both st and cc, permit st, cc and TEL, etc..... CSR EXPOSURE TIMES Since the VAX may not be allowed to poll the micro to determine the progress of the CSR it needs to be able to determine how long the CSR exposure will take so that polling may start once the exposure is completed. The method of calculating this time is described in a separate document "COMPUTING THE CSR EXPOSURE TIMES". The document also describes how the exposure times are shortened when the exposure is either stopped prematurely or aborted. R (hardware start of the exposure) n6 = all phases triggered by ..... = 0 ignore and use the Px specification = 1 SYNC 1 I/R (hardware start of each phase) = 2 SYNC 2 I/R (hashuffle_3.txt��������������������������������������������������������������������������������������� 664 � 516 � 17 � 13453 6430203360 6554� �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� COMPUTING THE CSR EXPOSURE TIMES ******************************** Started 29/9/95 Updated 3/10/95 J.R.Barton ccd_charge_shuffling.txt The total exposure time is the time from when the micro receives the cs command to the time when the VAX is able to poll for status without interfering with the timing of the CSR, i.e. the CSR should have completed and is ready for the CCD readout. The following VAX inputs are required: 1. Tsync-start for cs(n5) in seconds 2. PERIOD1 or 2 is the SYNC1 or 2 period (in seconds) needed if cs(n6) = 1 or 2 and should be entered by the astronomer to 6 dec places (i.e. 1us precision) The total exposure time comprises the sum of the following times (as relevent to the type of CSR) WAITING FOR A SYNC1/2 START If cs(n5) = 0, Tsync-start = 0.001 sec, i.e. minimum delay to start If cs(n5) = 1 or 2 then an estimate must be made of the time that will elapse after issuing the cs command to when the SYNC1 or 2 exposure start interrupt will be received. Here, Tsync-start may be up to a full period if these interrupts oare periodical. Other wise they may occur at random or.... GETTING INTO SYNC If cs(n6) = 3 (TINCR triggers all phases) then Tget-in-sync= 0.040 sec If cs(n6) = 1 or 2 then Tget-in-sync= (from 1 to 2)*SYNC1/2 period, sec START SEQUENCE RUN TIME PSi=S PSm=i Tstart-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PSi=1 PSm=(i-OFFSETi) where PSi is the i-th start phase entry in the table starting at PS1 and containing a total of S start phase entries PSm are start phase entries involved in a repeat loop defined by the phase entry PSi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) RUNNING SEQUENCE RUN TIME PRi=R PRm=i Trun-sequ = CYCLES * SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PRi=1 PRm=(i-OFFSETi) where PRi is the i-th run phase entry in the table starting at PR1 and containing a total of R run phase entries PRm are run phase entries involved in a repeat loop defined by the phase entry PRi parameters REPEATi and OFFSETi. CYCLES is the number of run cycles given by cs(n1) If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) END SEQUENCE RUN TIME PEi=E PEm=i Tend-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PEi=1 PEm=(i-OFFSETi) where PEi is the i-th end phase entry in the table starting at PE1 and containing a total of E end phase entries PEm are end phase entries involved in a repeat loop defined by the phase entry PEi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) SHORTENED TIMES DUE TO A PREMATURE STOP When the CSR exposure is terminated prematurely the VAX should estimate as best as possible when to start polling for status prior to initiating the CCD readout. Premature stops occur either when the cs command is invoked or, when cs(n7) is set to 1 or 2, by SYNC1/2 being used to stop the exposure and both terminate the CSR after completing the current run cycle. For the sc command, the VAX is able to delay the start of polling until a further single run sequence cycle time plus end sequence run time has expired after the sc command was issued. If the cycle time is very long, the VAX should be able to improve on the estimated time to start polling by estimating how far through the cycle the CSR has progressed at the time the sc command was sent. The SYNC1/2 case presents a problem for the VAX if it does not know when these SYNC stops will occur. Maybe those CSRs with cs(n7) set to 1 or 2 will need to be polled right from the start.... or after an estimated delay.... or maybe the VAX polling can be initiated from the keyboard as the observer will probably know when the SYNC1/2 happens - this could be done as a manually initiated readout (the VAX first polling for status before initiating the readout. SHORTENED TIMES DUE TO ABORTS Once the ai command is issued the VAX may start polling the exposure status for xs = 0, the idle state. The abort is recognised at the end of the current run phase, the end sequence is skipped and the wrapup is done before the idle state is set. Once xs = 0 is detected the VAX should issue an IN command. n ccd_charge_shuffling.txt The total exposure time is the time from when the micro receives the cs command to the time when the VAX is able to poll for statu���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� once the exposure is completed. The method of calculating this time is described in a separate document "COMPUTING THE CSR EXPOSURE TIMES". The document also describes how the exposure times are shortened when the exposure is either stopped prematurely or aborted. R (hardware start of the exposure) n6 = all phases triggered by ..... = 0 ignore and use the Px specification = 1 SYNC 1 I/R (hardware start of each phase) = 2 SYNC 2 I/R (hashuffle_3.txt��������������������������������������������������������������������������������������� 664 � 516 � 17 � 13453 6430203360 6554� �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������� COMPUTING THE CSR EXPOSURE TIMES ******************************** Started 29/9/95 Updated 3/10/95 J.R.Barton ccd_charge_shuffling.txt The total exposure time is the time from when the micro receives the cs command to the time when the VAX is able to poll for status without interfering with the timing of the CSR, i.e. the CSR should have completed and is ready for the CCD readout. The following VAX inputs are required: 1. Tsync-start for cs(n5) in seconds 2. PERIOD1 or 2 is the SYNC1 or 2 period (in seconds) needed if cs(n6) = 1 or 2 and should be entered by the astronomer to 6 dec places (i.e. 1us precision) The total exposure time comprises the sum of the following times (as relevent to the type of CSR) WAITING FOR A SYNC1/2 START If cs(n5) = 0, Tsync-start = 0.001 sec, i.e. minimum delay to start If cs(n5) = 1 or 2 then an estimate must be made of the time that will elapse after issuing the cs command to when the SYNC1 or 2 exposure start interrupt will be received. Here, Tsync-start may be up to a full period if these interrupts oare periodical. Other wise they may occur at random or.... GETTING INTO SYNC If cs(n6) = 3 (TINCR triggers all phases) then Tget-in-sync= 0.040 sec If cs(n6) = 1 or 2 then Tget-in-sync= (from 1 to 2)*SYNC1/2 period, sec START SEQUENCE RUN TIME PSi=S PSm=i Tstart-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PSi=1 PSm=(i-OFFSETi) where PSi is the i-th start phase entry in the table starting at PS1 and containing a total of S start phase entries PSm are start phase entries involved in a repeat loop defined by the phase entry PSi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) RUNNING SEQUENCE RUN TIME PRi=R PRm=i Trun-sequ = CYCLES * SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PRi=1 PRm=(i-OFFSETi) where PRi is the i-th run phase entry in the table starting at PR1 and containing a total of R run phase entries PRm are run phase entries involved in a repeat loop defined by the phase entry PRi parameters REPEATi and OFFSETi. CYCLES is the number of run cycles given by cs(n1) If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) END SEQUENCE RUN TIME PEi=E PEm=i Tend-sequ = SIGMA (PHTIMEi + SIGMA (PHTIMEm * REPEATi)) PEi=1 PEm=(i-OFFSETi) where PEi is the i-th end phase entry in the table starting at PE1 and containing a total of E end phase entries PEm are end phase entries involved in a repeat loop defined by the phase entry PEi parameters REPEATi and OFFSETi. If cs(n6) = 3 then PHTIMEi/m = TINCRi / 10exp(6 - cs(n2)) secs if cs(contr) = 0, 1, 2, or 3 (NP or DF) or else PHTIMEi/m = TINCRmin / 10exp(6 - cs(n2)) secs if cs(contr) = 4 or 6 (BF) where TINCRmin = cs(n3) If cs(n6) = 1 or 2 and indep of cs(contr) PHTIMEi/m = PERIOD1 or 2 where PERIOD1/2 is the SYNC1/2 interrupt period (secs) SHORTENED TIMES DUE TO A PREMATURE STOP When the CSR exposure is terminated prematurely the VAX should estimate as best as possible when to start polling for status prior to initiating the CCD readout. Premature stops occur either when the cs command is invoked or, when cs(n7) is set to 1 or 2, by SYNC1/2 being used to stop the exposure and both terminate the CSR after completing the current run cycle. For the sc command, the VAX is able to delay the start of polling until a further single run sequence cycle time plus end sequence run time has expired after the sc command was issued. If the cycle time is very long, the VAX should be able to improve on the estimated time to start polling by estimating how far through the cycle the CSR has progressed at the time the sc command was sent. The SYNC1/2 case presents a problem for the VAX if it does not know when these SYNC stops will occur. Maybe those CSRs with cs(n7) set to 1 or 2 will need to be polled right from the start.... or after an estimated delay.... or maybe the VAX polling can be initiated from the keyboard as the observer will probably know when the SYNC1/2 happens - this could be done as a manually initiated readout (the VAX first polling for status before initiating the readout. SHORTENED TIMES DUE TO ABORTS Once the