Personal configuration Nick Hauser Personalised configuration. extraconfig.tcl You can add your own variables and functions to sics. Start by opening /usr/local/sics/extraconfig.tcl in a text editor (this is on the ics computer). The purpose of the extraconfig.tcl file is to allow instrument scientists and users to create personal configurations, that can be stored in the user's home directory and reused later if required. It also allows users to experiment with additional features, that once proven, can be migrated to an appropriate configuration file Edit the file using the patterns provided below. For the changes to take effect, you'll need to save the file and stop and restart sics. Adding a procedure To add a procedure to SICS. Say you want to add the procedure movdet to sics and set by a user, proc movedet {pos} { drive dhv1 600 drive det $pos drive dhv1 2350 } publish movedet user This function will drive the high voltage controller to 600 volts, move the motor det to position pos and drive the high voltage controller to 2350 volts publish is a SICS manager command which makes a Tcl command or procedure visible in the SICS interpreter. publish provides a special wrapper for a Tcl command, which first checks the user rights of the client connection which wants to execute the Tcl command. If the user rights are appropriate the command is invoked in the Tcl–interpreter. Adding a variable To add a variable, use the mkVar procedure. mkVar is a Tcl wrapper for the SICS function VarMake. These 2 functions share the same first 3 parameters. To view these settings, use hlistprop name ::utility::mkVar name type access_privilege long_name nxsave class control data name name on the sics command line type text, int, float access_privilege spy, user, manager, internal, readonly long_name long name nxsave saves to NeXus file true, false (default). class node under which this variable is saved and controlled e.g. instrument, sample control will appear in the Gumtree table tree if this is set to true true, false (default) data will appear in the data node of NeXus file if this is set to true. nxsave must also be set to true. true, false (default) Example ::utility::mkVar starttime Text user start true experiment true true creates a variable called starttime, which is a text variable requiring user privilege to set. The long_name is start, it will be saved to the NeXus file under the 'experiment' node and appear in the Gumtree table tree.