12.07.2015 Views

spec - Local Sector 7 web page

spec - Local Sector 7 web page

spec - Local Sector 7 web page

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

KeyboardInterr uptsOn UNIX systems, two different asynchronous signals can be sent from the keyboardto programs. These signals are interrupt and quit. A ˆC is usually used to generatethe interrupt signal. A ˆ\ generates a quit on many versions of UNIX, although ˆV isused on some others. The control key assignments are arbitrary and can be changedusing the stty command from the UNIX shell. A common problem for new users isthat their default UNIX environment has either no keys or archaic keys assigned tothese signals. To display the current key assignments on BSD-type systems, typestty everything from the shell. On System V systems, type stty -a .With <strong>spec</strong>, the interrupt key halts all activity, including asynchronous motor motionor counting, and closes all command files. All output files and devices (except log,dlog and elog files) are closed. On keyboard interrupts (and command and syntaxerrors), cleanup macros, as described below may be run.Typing the quit character will asynchronously terminate <strong>spec</strong> without saving theuser ’s state. However, ifmotors are moving, the program will wait for them to haltand then update the settings file.Cleanup MacrosOn keyboard interrupts (and command and syntax errors), if macros named cleanupor cleanup1 have been defined, their definitions are read as input. Typical uses ofthe cleanup macro are to return motors to starting positions and/or to insert commentsin data files after aborted scans. After running the cleanup and/or cleanup1macros, <strong>spec</strong> gives the standard prompt and waits for the next command from thekeyboard. If there is another ˆC interrupt or error while the commands contained inthe cleanup or cleanup1 macros are being executed, the macro definitions areremoved.As of release 4.03.13, the additional cleanup_once and cleanup_always macronames are recognized. Each, if defined, will be pushed on to the input stream on ˆCinterrupts and command and syntax errors, as above. The cleanup_once definition,though, is always removed before the next main prompt is issued. On the otherhand, the cleanup_always definition will never be automatically removed. Definitionsfor these macros should be constructed using the cdef() (chained macro) function(described on <strong>page</strong> 91) in order to allow various clean-up actions to be added andremoved during the flow of arbitrary statement blocks.54 REFERENCE MANUAL INTERIM WORK-IN-PROGRESS (8/16/01) NOT FOR GENERAL DISTRIBUTION

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!