## Rünbuffer Commands

LNS scientists have got used to using Rünbuffers for instrument control. A Rünbuffer is an array of SICS commands which typically represent a measurement. This Rünbuffer can be edited at run time. This is very similar to a macro. In contrast to a macro only SICS commands are allowed in Rünbuffers. When done with editing the Rünbuffer it can be entered in a Rünlist. This is a stack of Rünbuffers which get executed one by one. While this is happening it is possible (from another client) to modify the Rünlist and edit and add additional Rünbuffers on top of the stack. This allows for almost infinite measurement and gives more control than a static batch file. In order to cater for this scheme three commands have been defined:

The Buf object is responsible for creating and deleting Rünbuffers. The syntax is:

- Buf new name creates a new empty Rünbuffer with the name name. name will be installed as a SICS object afterwards.
- Buf copy name1 name2 copies Rünbuffer name1 to buffer name2.
- Buf del name deletes the Rünbuffer name.

After creation, the Rünbuffer is accessible by his name. It then understands the commands:

- NAME append what shall we do with a drunken sailor will add all text after append as a new line at the end of the Rünbuffer.
- NAME print will list the contents of the Rünbuffer.
- NAME del iLine will delete line number iLine from the Rünbuffer.
- NAME ins iLine BimBamBim inserts a new line after line iLine into the Rünbuffer. The line will consist of everything given after the iLine.
- NAME subst pattern newval replaces all occurences of pattern in the Rünbuffer by the text specified as newval. Currently this feature allows only exact match but may be expanded to Unix style regexp or shell like globbing.
- NAME save filename saves the contents of the Rünbuffer into file filename.
- NAME load filename loads the Rünbuffer with the data in file filename.
- NAME run executes the Rünbuffer.

The Rünlist is accessible as object stack . Only one Rünlist per server is permitted. The syntax:

- stack add NAME adds Rünbuffer name to the top of the stack.
- stack list lists the current Rünlist.
- stack del iLine deletes the Rünbuffer iLine from the Rünlist.
- stack ins iLine NAME inserts Rünbuffer name after Rünbuffer number iLine into the Rünlist.
- stack run executes the Rünlist and returns when all Rünbuffers are done.
- stack batch executes the Rünlist but does not return when done but waits for further Rünbuffers to be added to the list. This feature allows a sort of background process in the server.