Interrupting SICS Ferdi Franceschini 2006-09-04 15:50 The SICS programmers guide. converted to docbook using htlatex. converted to docbook5 by xslt in Oxygen. SINQ specific content removed Safety SICS is NOT a safety system! It will allow you to do tasks that may damage persons and the instruments. DO use the STAR principle. STOP. THINK. ACT. REVIEW Familiarise yourself the location of the Emergency Stop buttons located near the cabin exit, or in several places within the instrument enclosure. Familiarise yourself with the instrument and its safe operation. DO NOT do anything with SICS that may risk damage to persons or the instrument. DO NOT rely on these commands to stop motors or close shutters. If in any doubt, use the Emergency Stop button. The commands in this chapter may fail for a variety of reasons. SICS has crashed Your network connection to the SICS is blocked, due to network congestion or failure The motor controller is no longer accepting connections or has a rogue process running stopexe command The stopexe command will stop drivable objects. It will NOT stop scans or batch files. For that you'll have to use an interrupt as found in the next section. stopexe device interrupts a drive or run command. In the case of motors, the motor will decelerate. It won't stop immediately, as this can cause damage to the instrument This will not interrupt a scan e.g. runscan. SICS will continue to accept commands from a client stopexe all interrupts all devices. In the case of motors, the motor will decelerate. It won't stop immediately, as this can cause damage to the instrument This will not interrupt a scan e.g. runscan. SICS will continue to accept commands from a client Interrupting SICS On occasion, you as the user, or a SICS object may come to the conclusion that an error is so bad that the measurement needs to be stopped. Clearly a means is needed to communicate this to upper level code. This means is setting an interrupt on the connection. The current active interrupt is located at the connection object (note for SICS programmers, this can be retrieved with SCGetInterrupt and set with SCSetInterrupt. Interrupt codes are defined in interrupt.h). These codes are ordered into a hierarchy INT1712 0 Continue. Everything is just fine. eContinue INT1712 1 Abort Operation. Stop the current scan point or whatever is done, but do not stop altogether. eAbortOperation INT1712 2 Abort Scan. Abort the current scan, but continue processing of further commands in buffers or command files. eAbortScan INT1712 3 Abort Batch. Aborts everything, operations, scans and batch processing and leaves the system ready to enter new commands. eAbortBatch INT1712 4 Halt System. As eAbortBatch, but lock the system. eHaltSystem INT1712 5 Free System Unlocks a system halted with eHaltSystem. eFreeSystem INT1712 6 For internal usage only Makes the SICS server run down and exit. . Higher level SICS objects may come to the conclusion that the error reported by lower level code is actually not that critical and clear any pending interrupts by setting the interrupt code to eContinue and thus consume the interrupt.