sics manual for the sans i instrument › sites › default › files › import › sinq ›...

55
SICS manual for the SANS I instrument Dr. Joachim Kohlbrecher Dr. Mark Könnecke Dr. Ronny Vavrin

Upload: others

Post on 25-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

SICS manual for the SANS I instrument

Dr. Joachim Kohlbrecher

Dr. Mark Könnecke

Dr. Ronny Vavrin

Page 2: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

SICS manual for the SANS I instrumentby Dr. Joachim Kohlbrecher, Dr. Mark Könnecke, and Dr. Ronny Vavrin

Published 20.April 2007

Abstract

This manual describes how to set up the small angle neutron scattering (SANS) instrument at the SINQ spallationsource at PSI and gives a short reminder of important commands. This document can be downloaded(http://kur.web.psi.ch/sans1/SANSDoc/SICS4SANS1.pdf) as a pdf file.

Page 3: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Table of Contents1. Quick reference Guide...........................................................................................................................1

1.1. Instrument control programs.......................................................................................................11.2. The token command..................................................................................................................11.3. Executing a macro.......................................................................................................................11.4. Logging executed commands......................................................................................................21.5. Driving a motor ...........................................................................................................................21.6. Motor handling............................................................................................................................31.7. Special commands (e.g. st, dt ...)..............................................................................................41.8. Sample environment devices.......................................................................................................51.9. Beam shutter ...............................................................................................................................61.10. Neutron Velocity Selector .........................................................................................................71.11. Positioning an attenuator...........................................................................................................71.12. Changing collimation................................................................................................................81.13. Positioning the detector.............................................................................................................81.14. Positioning the beam stop .........................................................................................................91.15. Sample table ..............................................................................................................................91.16. Bruker electro magnet .............................................................................................................101.17. Sample holder for electro magnet ...........................................................................................111.18. Haake C25P temperature controller ........................................................................................111.19. Eurotherm controller ...............................................................................................................111.20. Analogue and digital input and output ....................................................................................121.21. Counter handling.....................................................................................................................121.22. Histogram Memory .................................................................................................................131.23. Data acquisition.......................................................................................................................151.24. XY table ..................................................................................................................................151.25. Useful commands....................................................................................................................16

2. How to start ..........................................................................................................................................172.1. Log in on the SANS computer ..................................................................................................172.2. Start the SINQ instrument control software SICS ....................................................................17

2.2.1. Command control line client ........................................................................................172.2.2. SANS status display .....................................................................................................182.2.3. Variable watcher varwatch .........................................................................................18

2.3. Instrument preparation before the first measurement ...............................................................19

3. Instrument control commands ...........................................................................................................213.1. Some basic SICS commands and concepts...............................................................................21

3.1.1. The token command ...................................................................................................213.1.2. How to execute Macros ................................................................................................213.1.3. Logging the executed commands .................................................................................223.1.4. Some variables for documentation ...............................................................................233.1.5. Drive commands...........................................................................................................233.1.6. SICS motor handling ....................................................................................................233.1.7. Special SANS commands.............................................................................................253.1.8. Sample Environment Devices.......................................................................................263.1.9. General Commands UnderStood by All Sample Environment Devices ......................28

3.2. TCL command language interface ............................................................................................30

iii

Page 4: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

3.2.1. set - Read and Write variables....................................................................................313.2.2. expr - Evaluate an expression .....................................................................................313.2.3. if - Execute scripts conditionally ................................................................................323.2.4. for - "For" loop ...........................................................................................................323.2.5. while - Execute script repeatedly as long as a condition is met .................................33

3.3. Instrument settings ....................................................................................................................333.3.1. Beam shutter .................................................................................................................333.3.2. Neutron velocity selector..............................................................................................343.3.3. Positioning an attenuator ..............................................................................................363.3.4. Changing the collimation .............................................................................................363.3.5. Positioning the detector ................................................................................................363.3.6. Positioning the beam stop.............................................................................................373.3.7. Calculating the q range.................................................................................................393.3.8. Estimating the measurement time ................................................................................39

3.4. Sample environments ................................................................................................................403.4.1. Sample table .................................................................................................................403.4.2. Bruker electromagnet ...................................................................................................413.4.3. Sample holder for electro magnet.................................................................................423.4.4. Haake C25P temperature controller .............................................................................433.4.5. Eurotherm temperature controller ................................................................................44

3.5. Data handling and acquisition...................................................................................................443.5.1. File naming conventions and storing data ....................................................................453.5.2. Data acquisition ............................................................................................................453.5.3. XY table........................................................................................................................493.5.4. Status of the actual acquisition process ........................................................................50

4. Other programs ...................................................................................................................................514.1. Grasp .........................................................................................................................................514.2. BerSANS software package......................................................................................................514.3. SASfit program .........................................................................................................................51

iv

Page 5: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.1. Instrument control programs

startsics &

starts the SICS server.

killsics &

kills the SICS server.

sics &

starts the SICS command line client.

sansstatus &

starts the SANS status display.

varwatch &

starts the variable watcher.

1.2. The token command

token grab

reserves control over the instrument to the client issuing this command.

token release

releases the token.

token force <passwd>

This command forces an exiting grab on a token to be released (manager privileges required).

1

Page 6: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.3. Executing a macro

exe BatchPath [<path>]

defines directory for script files executed by exe.

exe <filename>

executes script file <filename> located in directory defined by exe BatchPath. This commandallows enhanced batch control through the SICSBatchEditor.

ClientPut <text>

writes <text> to the client in which this command was written.

BroadCast <text>

writes <text> to all clients.

in a terminal window: sanscheck <filename>

checks the batchfile <filename> for errors and calculates the total of Monis to be measured.

TCL command language interface

is implemented in the SICS server.

1.4. Logging executed commands

commandlog new <filename>

starts a new commandlog writing to file <filename> (file stored in /home/SANS/log).

commandlog

displays status of commandlog.

commandlog close

closes the command log.

commandlog auto

switches the automatic log on.

commandlog tail <n>

prints the last <n> lines of the log file.

2

Page 7: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.5. Driving a motor

run <mot1> <val1> [<mot2> <val2> ...]

starts motion of the motors to the new values without waiting for the requested operation to finish.

drive <mot1> <val1> [<mot2> <val2> ...]

drives the motors and waits until movement is finished.

success

waits and blocks the command connection until all pending operations have finished.

<mot> list

lists all the motor <mot> parameters.

1.6. Motor handling

<motor> list

lists all motor parameters.

<motor> reset

resets motor parameters to default values.

<motor> position

prints actual position.

<motor> interest

prints position changes.

<motor> hardlowerlim

prints hardware lower limit.

<motor> hardupperlim

prints hardware upper limit

<motor> softlowerlim [<val>]

prints/sets software lower limit.

<motor> softupperlim [<val>]

prints/sets software upper limit.

3

Page 8: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

<motor> softzero [<val>]

prints/sets software zero.

<motor> fixed [<val>]

fixes motor for <val> ≥ 0 or releases it for <val> < 0.

<motor> interruptmode [<val>]

defines interrupt issued if motor movement fails.

<motor> precision [<val>]

denotes the positioning precision.

<motor> accesscode [<val>]

specify user privileges of <motor>.

<motor> speed

defunct.

<motor> sign [<val>]

reverses operation sense.

1.7. Special commands (e.g. st, dt ...)

<cop>

lists current position.

<cop> back

drives component to last position.

<cop> pos <name>

defines a name for actual position.

<cop> <name>

drives component to named position.

<cop> drop <name>

deletes named position.

<cop> drop all

deletes all named positions.

4

Page 9: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

<cop> list

lists all named position.

<cop> find

returns name of actual position.

<cop> <axis> [=] <val> ...

drive component to new position.

1.8. Sample environment devices

EVFactory new <ED> <type> <par> ...

creates a new sample environment device called <ED>.

EVFactory del <ED>

deletes sample environment device <ED>.

emon list

lists all registered environment devices.

emon register <ED>

registers environment device <ED>.

emon unregister <ED>

unregisters environment device <ED>.

<ED> Tolerance [<val>]

allowed deviation from preset.

<ED> Access [<val>]

changes access to device.

<ED> Lowerlimit [<val>]

lower limit for controller.

<ED> Upperlimit [<val>]

upper limit for controller.

<ED> ErrHandler [<val>]

error handler to use for this controller.

5

Page 10: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

<ED> Interrupt [<val>]

interrupt to issue when an error is detected.

<ED> SafeValue [<val>]

The value to drive the controller to when an error is detected and safe error handling is set.

<ED> send <par> [<par> ...]

sends everything after send directly to the controller and returns its response.

<ED> list

lists all parameters.

<ED> [<val>]

returns current value or will drive device to new value <val>.

<ED> log on/off

switches logging on/off.

<ED> log clear

clears all recorded time stamps and values.

<ED> log gettime

retrieves list of all recorded time stamps.

<ED> log getval

retrieves list of all recorded values.

<ED> log getmean

calculates mean value and standard deviation of logged values.

<ED> log frequency [<val>]

specifies the time intervall in seconds between log records.

1.9. Beam shutter

shutter

returns status of instrument shutter.

shutter open

opens beam shutter.

6

Page 11: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

shutter close

closes beam shutter.

1.10. Neutron Velocity Selector

lambda

prints the current wavelength in nm.

drive lambda <val>

changes wavelength to value <val> in nm.

lambda rot <val>

calculates the rotation speed for the wavelength given by <val>.

lambda wl <val>

calculates the wavelength for the rotation speed given by <val>.

nvs status

prints status summary.

nvs list

displays rotation speed and tilt angle.

nvs [rot=<val1>] [tilt=<val2>]

sets a new tilt angle and/or rotation speed.

nvs rotinteres

enables printing of status message about the current state of the selector when it is driven.

nvs loss

start a loss current measurement.

nvswatch [<par>] ...

is the object for monitoring the velocity selector and understands the commands for sampleenvironment devices.

7

Page 12: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.11. Positioning an attenuator

att

prints the current positioned attenuator.

att <val>

positions attenuator <val>. Allowed attenuator numbers are: 0, 1, 2, 3, 4 and 5.0 : square 50 mm x 50 mm slit, attenuation = 11 : circular 41 x diameter 0.4 mm slit, attenuation = 1/4852 : circular 9 x diameter 2 mm slit, attenuation = 1/883 : circular 20 mm diameter slit, attenuation = 1/84 : circular 30 mm diameter slit, attenuation = 1/3.55 : circular 15 mm diameter slit, attenuation = 1/??

1.12. Changing collimation

coll

prints the current collimatin length.

coll <val>

positions the collimation <val>. Allowed collimation lengths are: 1, 1.4, 2, 3, 4.5, 6, 8, 11, 15 and18.

1.13. Positioning the detector

detectorx

motor to change sample detector distance (x).

detectory

motor for lateral displacement (y).

detectorrotation

motor for detector rotation (phi).

dt [x=<val1>] [y=<val2>] [phi=<val3>]

special SANS command for controlling all three detector axes together.

8

Page 13: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.14. Positioning the beam stop

beamstopx

motor for horizontal movement.

beamstopy

motor for vertical movement.

bs [x=<val1>] [y=<val2>]

special SANS command for controlling both beam stop axes together.

bsout

moves beam stop out of detecion area.

bsin

moves beam stop back into position.

bscfree

releases the beam stop motors.

bschange [<val>]

changes beam stop size, without parameter it returns the beam stop type.1 for beam stop size of 40 mm x 40 mm2 for beam stop size of 70 mm x 70 mm3 for beam stop size of 85 mm x 85 mm4 for beam stop size of 100 mm x 100 mm

bscslot

returns value of the beam stop type.

1.15. Sample table

saz

motor for vertical translation (z).

9

Page 14: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

say

motor for horizontal translation parallel to neutron beam (y).

sax

motor for horizontal translation perpendicular to neutron beam (x).

som

motor for rotation around vertical axis (phi).

gtheta

motor for rotation around horizontal axis (theta).

sposi

horizontal translation for linear translator (posi).

st [<axis n>=<val n>] ...

is a special SANS command for controlling all seven sample axes together. <axis n> can be x,y, z, omega, phi, theta, posi.

1.16. Bruker electro magnet

evfactory new magnet bruker

lnsa10.psi.ch 4000 9

initialisation sequence.

magnet

is a valid sample environment device if initialised as above.

magnet polarity

prints polarity of magnet.

magnet polarity <val>

sets polarity, <val> can be plus or minus.

magnet mode

prints the mode of the controller.

magnet mode <val>

sets mode, <val> can be field or current.

10

Page 15: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

magnet field

prints the magnetic field.

magnet current

prints the current.

1.17. Sample holder for electro magnet

mz

motor for vertical movement (z).

mom

motor for rotation around vertical axis (omega).

msh [z=<val1>] [omega=<val2>]

is a special SANS command for controlling both axes of the magnet sample holder together.

1.18. Haake C25P temperature controller

start_sea

starts the sea server from SICS.

temperature

reads out the current temperature.

drive temperature <val>

changes the set temperature of the thermostat to the value <val>.

in a terminal window: sea

starts the sea server client from a terminal. Choose Haake as device. The sea server client is the bestway to control and monitor the thermostat manually. Please refer to the SEA Wiki page(http://lns00.psi.ch/sinqwiki/Wiki.jsp?page=Sea) for more information.

11

Page 16: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.19. Eurotherm controller

evfactory new temperature euro

lnsa10.psi.ch 4000 <port>

initialisation sequence. <port> is the serial port number at sans.psi.ch where the controller isconnected (usually port 13).

temperature

is a valid sample environment device if initialised as above.

temperature list

overview of the temperature controller parameters. Use ’emon unregister temperature’ to avoid outof range error messages.

1.20. Analogue and digital input and output

init_adios.tcl

initialisation sequence.

AO <channel> <value>

sends an analogue signal (-10V -> 10V) to channel 0 or 1.

AI <channel>

reads the tension at channels 0 to 7. Channels 0 and 1 are reserved for the CJC and thethermocouple readout.

temp <type>

returns the temperature as measured by a thermocouple (tc) or a resistor (pt).

log <time interval> <channel1> <channel2> ...

stores the values measured at the specified channels into a file in the speficied time interval. Up to 4channels can be logged simultanuously. The temperature can be logged using channel 1.

log stop

stops logging the data.

12

Page 17: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.21. Counter handling

counter SetPreset <val>

sets the preset to <val>.

counter GetPreset

prints the current preset value.

counter SetExponent <val>

sets exponent for Monitor mode.

counter GetExponent

prints current exponent used in Monitor mode.

counter SetMode <val>

sets counting mode. Allowed modes are Timer and Monitor.

counter GetMode

prints the current mode.

counter GetCounts

prints counts gathered in the last run.

counter GetMonitor <n>

prints counts gathered by monitor <n> in the last run.

counter Count <preset>

starts counting with preset <preset>.

counter Status

prints the counter status.

counter GetTime

retrieves the actual time the counter counted for.

counter GetThreshold <n>

retrieves the threshold of monitor <n>.

counter SetThreshold <n> <val>

sets the threshold for monitor <n> to <val> and also sets the active monitor for the threshold to<n>.

13

Page 18: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

1.22. Histogram Memory

banana configure HistMode <val>

sets the mode of operation (Transparent, Normal, TOF, Stroposcopic).

banana configure OverFlowMode <val>

determines how bin overflow is handled (Ignore, Ceil, Count).

banana configure Rank <val>

defines number of histograms in memory.

banana configure Length <val>

gives length of individual histogram.

banana configure BinWidth <val>

determines size of single bin in histogram memory in bytes.

banana timebin

prints actual time binning aray.

banana genbin <start> <step> <n>

determines size of single bin in histogram memory in bytes.

banana setbin <inum> <val>

configuring unequally spaced time binnings.

banana clearbin

deletes the binning informations.

banana preset [<val>]

prints/sets preset Timer or Monitor.

banana exponent [<val>]

prints/sets exponent for Monitor preset.

banana CountMode [<mode>]

prints/sets count mode (Monitor, Timer).

banana init

transfers configuration from host to the actual histogram memory.

banana count

starts counting.

14

Page 19: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

banana initval <val>

initialises histogram memory to value <val>.

banana get <i> <istart> <iend>

retrieves a part of histogram memory.

banana sum <d0min> <d0max> <d1min> <d1max>

returns the sum of counts on an area of the detector.

1.23. Data acquisition

StoreData

writes current instrument status to a NeXus file.

count [<mode> <preset>]

start count operation in mode <mode> with preset <preset>.

repeat <num> [<mode> <preset>]

calls <num> times count.

1.24. XY table

xydata clear

clears all entries in the x-y table.

xydata list

lists the entries in the x-y table on the screen.

xydata write <filename>

writes the x-y list to the disk file <filename>. This file resides on the machine running the SICSserver.

xydata uuget

sends the x-y list in an uuen-coded format. This is the command to give to the VarWatch SICS clientin order to make it display the x-y list.

15

Page 20: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 1. Quick reference Guide

xydata add <xval> <yval>

creates a new x-y list entry with the values <xval> and <yval>.

1.25. Useful commands

gc <measMonis> <totalCounts>

GuessCount: executes a measurement of <measMonis> Monis and extrapolates the measurementtime and Monis for a final value of <totalCounts> counts. A useful tool to estimate the measurementtime for a sample. Example: gc 5 1E7 forces the instrument to measures for 5 Monis andestimates the measurement time and Monis for 10’000’000 counts.

qrange [x <detdist>] [wl <lambda>]

calculates the q range of the current setting. The detector distance x (in mm) and the wavelength wl(in nm) can be varied with the optional parameters. Examples: qrange prints the q range of thecurrent setting, qrange x 6000 wl 0.8 prints the q range of the current setting with forcedvalues for the detector distance (6000mm) and the wavelength (0.8nm).

sinq

prints the SINQ status in the SICS client which issued the command.

in a terminal window: sanscheck <filename>

checks the batchfile <filename> for errors and calculates the total of Monis to be measured.

16

Page 21: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 2. How to start

2.1. Log in on the SANS computer

After starting up an X-Terminal click on the XDMCP button and choose the computer lnsa10.psi.ch.Login with your <username> and <password> (case sensitive, this is a Unix machine). Wait for theCommon Desktop Environment to start up. Open a terminal window (dtterm). You will be asked for yourlast name and if this is your first login a subdirectory /data/lnsg/<lastname> will be created.

2.2. Start the SINQ instrument control software SICS

SICS is a client server system. This means there are at least two programs necessary to run theexperiment. The first is the server program, which runs for the SANS instrument on the lnsa10.psi.chworkstation. A user rarely needs to bother about this program as it meant to run all the time. Secondly aclient program is needed, through which the user can interact with the instrument control server. Its mainpurpose is to forward commands to the server and to display the answers. For the SANS instrument threeSICS clients are available:

1. command line control client (sics &)

2. status display (sansstatus &)

3. variable watcher (varwatch)

Any of the SICS clients first have to be connected to a SICS server before it becomes active.Therefor youfirst have to establish a connection through the [Connect] menu of the client.

2.2.1. Command control line client

The command line control client allows you after connecting to the instrument server to read outinstrument parameters like motor positions, temperatures, magnetic field, etc. In order to move a motoror to start a data aquisition you need access privileges. The SICS server supports autorisation on differentlevels to protect the instrument against unauthorized hackers or accidental change of the instrumentadjustment of less knowledgable user. Four different levels of access to the instrument are supported.

1. Spy: you may read out any instrument value, but may not change anything

2. User: you are privileged to perform a certain amount of operations necessary to run the instrument

3. Manager: you have the permission to do almost everything

4. Internal: is not accessible to the outside world and is used to circumvent protection for internal uses

To change the privileges select [Set Rights] from the [User Parameter] menu. With an validusername and the corresponding password you will get the privileges to change the instrument set-up.Please do not use this privileges on any other terminal than the one in the SANS cabine. For more

17

Page 22: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 2. How to start

information click on [Help] button on the top right corner of the command line client. A list of the mostneeded SICS commands is given in Chapter 3. If you start the sics client the first time you should fill outthis items in the menu [New Experiment] for documentation of your data.

2.2.2. SANS status display

The SANS status display is an application for displaying the status of a SANS measurement at SINQ.The application can be stated by the command sansstatus &. First a connection to the SICS server hasto be established. You can choose between two data display areas. The first form shows a large colourmapped image of the detector. The second form shows a couple of selected instrument parameters.Switching between the two displays is achieved through the buttons [Detector] and [Parameter] ofthe tool bar.

The displayed data window can be updated either manually or automatic. By default manual update isenabled. Manual update happens when hitting the red button at the bottom. Automatic update can beenabled by checking the CheckBox labelled [Automatic Update] in the [Update] menu. The updateintervall can be configured with a dialog which shows up when the [Set Update Intervall] menuselection is clicked. Automatic updates impose a high network load. Use with care and only whennecessary. For this reason, automatic updates are disabled in the applet version of this program. Anupdates take approximatly 5 seconds. Consequently update intervalls shorter than that are nonsense.Speeding this up an [Turbo Update] button has been introduced. In this modus the client doesn’tcommunicate with the SICS server to recieve the detector information, but it communicates directly withthe histograming memory. This speeds the update frequency up to a few frames per second. [TurboUpdate] will continuously poll the histogram memory for new histogram data. This is only limited byCPU, network and histogram memory performance. Thus [Turbo Update] tends to overload yoursystem. It should only be used while adjusting the beamstop, otherwise its use is a waste of systemresources which will eventually slow down your data reduction chores. Do NOT forget to switch this offwhen you are done. The system will automatically switch to [Auto Update] mode after 20 minutes.

The detector display has a lot of options. Below the colour picture there is a line which displays thecurrent detector coordinate and the data value at the current mouse position. By choosing the [Open

Old File] item in the [File] menu you can load an old data set, i.e. you can use the SANS statusdisplay as a viewer for old SANS data files. A double clicking on the colour display brings up a dialogwhich allows to configure the colour mapping of the detector display. By holding down the mouse buttonand dragging the mouse a rectangular area of the detector display can be selected. When releasing themouse button, the selected region is summed and displayed as a X-Y graph in a separate window. In thetitle of this plot the total counts in the selected rectangular area on the detector is printed. Dragging themouse downwards in this new window allows to zoom in into details of the histogram. Dragging themouse upwards zooms out again. At the bottom of the window is a dismiss button which removes thehistogram window. The histogram in the histogram window will NOT be automatically updated whennew data arrives.

18

Page 23: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 2. How to start

2.2.3. Variable watcher varwatch

This little SICS client allows to plot the value of a variable in a SICS server against time. This willprobably be mostly used for watching the temperature stability of a temperature controller. But it is notrestricted to temperature variables, all numeric SICS variables can be monitored that way.

The configuration of the variable watcher involves two steps:

1. Select your favourite SICS server from the choices in the [Connect] menu. [Custom] allows tospecify a SICS server directly by host name and port number.

2. Configure the variable to watch using the [Configure] item in the [Plot] menu. Threeparameters are relevant:

a. The watch frequency, which is the time in minutes between plot updates.

b. The backlog, which is the number of values which will be plotted.

c. The SICS variable to watch. This text must be a valid SICS command which returns a reply inthe form blabla = <number> .

Further user interface elements are two buttons below the plot. These allow to start and stop the recordingof the variables value. The yellow text field besides these buttons displays the current operation of thevariable watcher which can be one of Inactive or Recording. Below is a line showing the current status ofthe SICS server. Please note, that the most recent value is always at the right hand side of the plot.

The plot can be zoomed into by dragging downwards with the left mouse button. Zooming out isachieved by dragging outwards with the mouse or with the [Reset] or [Rescale Y] options in the[Plot] menu. The plot can be printed using the [Print] option in the [Plot] menu. Next to plottinga variable in a SICS server against time the variable watcher can be used to display a XYTable which is aclass maintaining a list of x-y values. If a XYTable object is available in the system under the name<xydata> the command <xydata> uuget has to be given to the varwatch SICS client in order tomake it display the x-y list. More information about handling a XYTable can be found in Section 3.5.3.

2.3. Instrument preparation before the first measurement

Before you can start with your first data aquisition be aware of a few things. For running a measurementyou need at least to run two programs: the SANS status display (sansstatus &) and the command lineclient (sics &). After connecting both clients to the SANS server and authorizing the command lineclient at the server with user privileges you are ready to change the instrument set-up. The initial step atthe beginning of your measurement are the following:

1. Check if beam is closed, if not than do it now.

19

Page 24: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 2. How to start

2. Set the experiment informations via the dialog box [New Experiment].

3. Define the directory, where you intend to store your batch files with exe batchpath

/data/lnsg/<username>[/<batchdir>].

4. Choose the needed instrument settings like sample detector distance, collimation, wavelength, etc.

5. Adjust the beam stop by performing the following steps:

• Move in an attenuator with an attenuation factor larger than 100.

• Put a strong forward scatterer into the beam, e.g. teflon

• Center the beam stop roughly by the SICS command bs x 0 y 0.

• Open the beam.

• Use the command banana preset 1000 and banana count to start an aquisition withoutstoring the result.

• Adjust the beam stop with the bs-command.

• After each beam stop movement you can reset the histograming memory of the detector bybanana initval 0.

• Remove the attenuator.

• Perform a fine adjustment of the beam stop with an unattenuated beam if neccessary.

• Stop the data aquisition by pressing the [Interrupt] button in the lower left corner of thecommand line client.

20

Page 25: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.1. Some basic SICS commands and concepts

3.1.1. The token command

In SICS any client can issue commands to the SICS server. This is a potential cause for trouble withusers issuing conflicting commands without knowing. In order to deal with this problem a tokenmechanism has been developed. A connection can grab a token and then has full control over the SICSserver. Any other connection will not be privileged to do anything useful, except for looking at things. Atoken can be released manually with a special command or is automatically released when theconnection dies. Another command exists which allows a SICS manager to force his way into the SICSserver. The commands in more detail:

token grab

Reserves control over the instrument to the client issuing this command. Any other client cannotcontrol the instrument now. However, other clients are still able to inspect variables.

token release

Releases the control token. Now any other client can control the instrument again. Or grab thecontrol token.

token force <password>

This command forces an existing grab on a token to be released. This command requires managerprivilege. Furthermore a special password must be specified as third parameter in order to do this.This command does not grab control though.

3.1.2. How to execute Macros

SICS has a built in macro facility. This macro facility is aimed at instrument managers and users alike.Instrument managers may provide customised measurement procedures in this language, users may writebatch files in this language. The macro language is John Ousterhout’s(http://cseng.awl.com/authordetail.qry?AuthorID=69) Tool Command Language (TCL)(http://www.tcltk.com). A set of important Tcl commands are described in section Section 3.2. Toexecute batch files, the following commands are available:

exe BatchPath [<pathname>]

By this command the directory name, in which SICS is searching for a batch file, is stored in theSICS variable exe BatchPath. Calling exe BatchPath without parameters will return the actual

21

Page 26: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

contents of the variable.

exe <filename>

This command tries to open the file filename located in the directory defined by exe BatchPath

and executes the script in this file. This command allows enhanced batch control through theSICSBatchEditor.

If you want to print information from a macro script to a client (about the progress of the batch job forexample), special commands are available:

ClientPut some text ...

This command writes everything after ClientPut to the client which started the script.

BroadCast some text ...

This command writes everything after BroadCast to all clients.

To check a batchfile for errors and to estimate the total Monis to be measured, a special program can beexecuted in a terminal window. Navigate to the folder containing the batchfile and execute the followingcommand

in a terminal window: sanscheck <filename>

checks the batchfile <filename> for errors and calculates the total of Monis to be measured.

3.1.3. Logging the executed commands

Some users wish to have all communication of the SICS server with all the clients having user ormanager privileges being collected in a file for further review. This is implemented via the commandlogcommand. This log allows to retrace each step of an experiment. It is usually switched off and must beconfigured by the instrument manager. commandlog understands the following syntax:

commandlog new <filename>

starts a new commandlog writing to <filename>. The log file can be found for the SANS server inthe directory /home/SANS/log.

commandlog

without further parameters displays the status of the commandlog.

commandlog close

closes the command log file.

If the user wishes a transscript of the SICS session of the command line client he is just working with, hecan use the [Open Logfile] option in the [File] menu. It will allow you to specify a file on yourlocal disk area, where all input/output is logged to. You will get everything which appears in the client’sI/O window. The input is prepended with ???. In contrast to the commandlog, which log communication

22

Page 27: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

of all clients connected to the server, the [Open Logfile] option of the client only allows you to logthe communication of its own to a local file.

3.1.4. Some variables for documentation

SICS supports a couple of variables for documentation of a measurement. Currently available are:

user, adress, phone, fax, email, title, subtitle, environment, sample,

comment

Each variable can be inquired by just typing its name. It can be set by typing the name followed by thenew name, e.g. title nanocrystalline Fe. These variables can also be set by the [SetExperiment] dialog box, which can be started via the [New Parameter] option of the [UserParameter] menu item in the command line client. The user is required to fill this variables withutmost care, because if you want us to retrieve your data in ten years time you will be happy that theinformation will be there.

3.1.5. Drive commands

Many objects in SICS are drivable. This means they can run to a new value. Obvious examples aremotors. Less obvious examples include composite adjustments such as setting a wavelength or atemperature. This class of ob jects can be operated by the drive, run , success family of commands.These commands cater for blocking and non-blocking modes of operation.

run <var> <newval> [<var> <newval> ...]

Can be called with one to n pairs of object new value pairs. This command will set the variables inmotion and return to the command prompt without waiting for the requested operations to finish.This feature allows to do things to the instrument while for example a slow device is running intoposition.

success

Waits and blocks the command connection until all pending operations have finished (or an’interrupt’ occured).

drive <var> <newval> [<var> <newval> ...]

can be called with one to n pairs of ob ject new value pairs. This command will set the variables inmotion and wait until the driving has finished. A drive can be seen as a sequence of a run commandas stated above immediatetly followed by a Success command.

23

Page 28: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.1.6. SICS motor handling

In SICS each motor is an object with a name. Motors may take commands which basically come in theform <motorname> <command>. Most of these commands deal with the plethora of parameters whichare associated with each motor. The syntax for manipulating variables is, again, simple. <motorname><parametername> will print the current value of the variable. <motorname> <parametername>

<newval> will set the parameter to the new value specified. A list of all parameters and their meaningsis given below. The general principle behind this is that the actual (hardware) motor is kept as stupid aspossible and all the intracacies of motor control are dealt with in software. Besides the parametercommands any motor understands these basic commands:

<motorname> list

gives a listing of all motor parameters

<motorname> reset

resets the motor parameters to default values.

<motorname> position

prints the current position of the motor.

<motorname> interest

initiates automatic printing of any position change of the motor. This command is mainly interestingfor implementors of status display clients.

Please note that the actual driving of the motor is done via the drive or run command described in thelast Section 3.1.5

The motor parameters:

HardLowerLim

is the hardware lower limit. This is read from the motor controller and is identical to the limit switchwelded to the instrument. Can usually not be changed.

HardUpperLim

is the hardware upper limit. This is read from the motor controller and is identical to the limit switchwelded to the instrument. Can usually not be changed.

SoftLowerLim

is the software lower limit. This can be defined by the user in order to restrict instrument movementin special cases.

SoftUpperLim

is the software upper limit. This can be defined by the user in order to restrict instrument movementin special cases.

24

Page 29: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

SoftZero

defines a software zero point for the motor. All further movements will be in respect to thiszeropoint.

Fixed

can be greater 0 for the motor being fixed and less than zero for the motor being movable.

InterruptMode

defines the interrupt to issue when the motor fails. Some motors are so critical for the operation ofthe instrument that all operations shall be stopped when there is a problem. Others are less critical.This criticallity is expressed in terms of interrupts, denoted by integers in the range 0 - 4 translatinginto the interrupts: continue, AbortOperation, AbortScan, AbortBatch and Halt. This parameter canusually only be set by managers.

Precision

denotes the precision to expect from the motor in positioning. Can usually only be set by managers.

AccessCode

specifies the level of user privilege necessary to operate the motor. Some motors are for adjustmentonly and can be harmful to move once the adjustment has been done. Others must be moved for theexperiment. Values are 0 - 3 for internal, manager , user, and spy. This parameter can only bechanged by managers.

Speed

defunct.

Sign

allows to reverse the operating sense of the motor. For cases where electricians and not physicistshave defined the operating sense of the motor. Usually a parameter not to be changed by ordinaryusers.

3.1.7. Special SANS commands

This section describes some commands special to SANS. One feature of SANS is that components areused as a whole rather than refering to single motors. For SANS the beamstop, the detector and thesample table is managed like this. Within a component each axis can be adressed specifically by using anaxis = value pair. Axis defined for each component will be listed below. Additionally thesecomponents support common commands as well. These mainly deal with named positions. A namedposition is a set of values which can be driven to by just specifying its name. For instance: bsPositionA drives the BeamStop bs to the position defined as PositionA. All component drivecommands do not block, i.e. you can type further commands. If it is needed to wait for a component toarrive, use the Success command right after your command.

25

Page 30: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

Commands supported by all components (in the following, the name of the component will berepresented by <COP>):

<COP>

The name of the component alone will yield a listing of the current position of the component. Thisis also a way how to find out which axis the component supports.

<COP> back

drives the component back to the position before the last command. Please note, that back does notoperate on itself, i.e. two times <COP> back will not do a trick.

<COP> pos <name>

This command promotes the current position of the component to a named position <name>.Afterwards this position can be reached by typing: <COP> <name> .

<COP> drop <name>

deletes the named position specified as second parameter.

<COP> find

returns the name <name> of the actual position of the component if the position was named beforeby <COP> pos <name>.

<COP> <axis 1> [=] <val 1> [<axis 2> [=] <val 2> ...]

drives the component to the new position specified by 1-n sets of <axis n> = <val n> pairs. Theequal sign is not mandatory and can be left out. The axis refers to the internal axis of the componentwhich is seen in a listing as created by typing <COP>. A relative movement of an axis can beperformed if an ++ or -- precedes the value for <val n>. A value ++10, for example would meanan increase of the actual axis position by 10.

The components which follow the component syntax described above are bs (beam stop), dt (detector),st (sample table), and msh (magnet sample holder). They are described in more detail in later sections.

3.1.8. Sample Environment Devices

3.1.8.1. SICS Concepts for Sample Environment Devices

SICS can support any type of sample environment control device if there is a driver for it. This includestemperature controllers, magnetic field controllers etc. The SICS server is meant to be left runningcontinuously. Therefore there exists a facility for dynamically configuring and deconfiguringenvironment devices into the system. This is done via the EVFactory command. It is expected thatinstrument scientists will provide command procedures for configuring environment devices and settingreasonable default parameters.

26

Page 31: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

In the SICS model a sample environment device has in principle two modes of operation. The first is thedrive modus. The device is monitored in this modus when a new value for it has been requested. Thesecond modus is the monitor modus. This modus is entered when the device has reached its target value.After that, the device must be continously monitored throughout any measurement. This is done throughthe environment monitor or emon. The emon command understands a few commands of its own.

Within SICS all sample environment devices share some common behaviour concerning parameters andabilities. Thus any given environment device accepts all of a set of general commands plus someadditional commands special to the device.

In the next paragraphs the EVFactory, emon and the general commands understood by any sampleenvironment device will be discussed. Reading this is mandatory for understanding SICS environmentdevice handling. Then there will be another section later on in this manual discussing the special devicesknown to the system.

3.1.8.2. Sample Environment Error Handling

A sample environment device may fail to stay at its preset value during a measurement. This conditionwill usually be detected by the emon. The question is how to deal with this problem. The requirementsfor this kind of error handling are quite differentiated. The SICS model therefore implements severalstrategies for handling sample environment device failure handling. The strategy to use is selected via avariable which can be set by the user for any sample environment device separatetly. Additional errorhandling strategies can be added with a modest amount of programming. The error handling strategiescurrently implemented are:

Lazy

Just print a warning and continue.

Pause

Pauses the measurement until the problem has been resolved.

Interrupt

Issues a SICS interrupt to the system.

Safe

Tries to run the environment device to a value considered safe by the user.

3.1.8.3. General Sample Environment Commands

EVFactory command:

27

Page 32: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

EVFactory is responsible for configuring and deconfiguring sample environment devices into SICS.The syntax is simple:

EVFactory new <name> <type> <par> [<par> ...]

Creates a new sample environment device. It will be known to SICS by the name specified assecond parameter <name>. The <type> parameter decides which driver to use for this device. Thetype will be followed by additional parameters which will be evaluated by the driver requested.

EVFactory del <name>

Deletes the environment device <name> from the system.

emon command:

The environment monitor emon takes for the monitoring of an environment device during measurements.It also initiates error handling when appropriate. The emon understands a couple of commands.

emon list

This command lists all environment devices currently registered in the system.

emon register <name>

This is a specialist command which registers the environment device <name> with the environmentmonitor. Usually this will automatically be taken care of by EVFactory.

emon unregister <name>

This is a specialist command which unregisters the environment device <name> with theenvironment monitor. Following this call the device will no longer be monitored and out oftolerance errors on that device no longer be handled.

3.1.9. General Commands UnderStood by All SampleEnvironment Devices

Please note that each command discussed below MUST be prepended with the <name> of theenvironment device as configured in EVFactory! The general commands understood by anyenvironment controller can be subdivided further into parameter commands and real commands. Theparameter commands just print the name of the parameter if given without an extra parameter or set if aparameter is specified. For example:

Temperature Tolerance prints the value of the variable Tolerance for the environment controller Temperature.Temperature Tolerance 2.0 sets the parameter Tolerance for Temperature to 2.0.

28

Page 33: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

Parameters known to ANY envrironment controller are:

Tolerance

Is the deviation from the preset value which can be tolerated before an error is issued.

Access

Determines who may change parameters for this controller. Possible values are:0 only internal1 only Managers2 Managers and Users3 Everybody, including Spy

LowerLimit

The lower limit for the controller.

UpperLimit

The upper limit for the controller.

Errhandler

The error handler to use for this controller. Possible values:0 is Lazy1 for Pause2 for Interrupt3 for SafeFor an explanantion of these values see the section about error handling above.

Interrupt

The interrupt to issue when an error is detected and interrupt error handling is set. Valid values are:0 for continue1 for abort operation2 for for abort scan3 for abort batch processing4 halt system5 exit serverFor an explanantion of these values see the section about error handling above.

SafeValue

The value to drive the controller to when an error has been detected and safe error handling is set.

Additionally the following commands are understood:

<name> send <par> [<par> ...]

Sends everything after send directly to the controller and return its response. This is a generalpurpose command which allows to manipulate controllers and controller parameters directly. Theprotocoll for these commands is documented in the documentation for each controller. Ordinaryusers should not tamper with this. This facility is meant for setting up the device with calibrationtables etc.

29

Page 34: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

<name> list

lists all the parameters for this controller.

<name>

When only the name of the device is typed it will return its current value.

<name> <val>

will drive the device to the new value <val>. Please note that the same can be achieved by using thedrive command.

<name> log on

Switches logging on. If logging is on, at each cycle in the <emon> the current value of theenvironment variable will be recorded together with a time stamp. Be careful about this, for eachlog point a bit of memory is allocated. At some time the memory is exhausted! <name> log

clear frees it again and log frequency (both below) allows to set the logging time intervall.

<name> log of

Switches logging off.

<name> log clear

Clears all recorded time stamps and values.

<name> log gettime

This command retrieves a list of all recorded time stamps.

<name> log getval

This command retrieves all recorded values.

<name> log getmean

Calculates the mean value and the standard deviation for all logged values and prints it.

<name> log frequency [<val>]

With a parameter <val> sets, without a parameter requests the logging intervall for the log created.This parameter specifies the time intervall in seconds between log records. The default is 5 minutes.A value of 0 means a record for each cycle of the SICServer.

3.2. TCL command language interface

The macro language implemented in the SICS server is John Ousterhout’s(http://cseng.awl.com/authordetail.qry?AuthorID=69) Tool Command Language (TCL)(http://www.tcltk.com). Tcl has control constructs, variables of its own, loop constructs, associativearrays and procedures. Tcl is well documented by several books

30

Page 35: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

(http://www.cica.indiana.edu/cica/faq/tcl/tcl.html), online tutorials and manuals(http://www.scriptics.com/man/tcl8.0/contents.htm). For getting further informations on Tcl have a lookon the TCL WWW Info (http://www.sco.com/Technology/tcl/Tcl.html) of Tcl Web server(http://www.tcltk.com). All SICS commands are available in the macro language. Some potentiallyharmful Tcl commands have been deleted from the standard Tcl interpreter. These are: exec, source,puts, vwait, exit, gets and socket. Below only a small subset of the most important Tcl commandslike assigning variables, evaluating expressions, control and loop constructs are described. For completedescription of Tcl command have a look on the manual pages(http://www.scriptics.com/man/tcl8.0/contents.htm) or on one of the many books about Tcl/Tk.

3.2.1. set - Read and Write variablesSynopsis. set varName ?value?

Description. Returns the value of variable varName. If value is specified, then set the value ofvarName to value, creating a new variable if one doesn’t already exist, and return its value. If varNamecontains an open parenthesis and ends with a close parenthesis, then it refers to an array element: thecharacters before the first open parenthesis are the name of the array, and the characters between theparentheses are the index within the array. Otherwise varName refers to a scalar variable.

3.2.2. expr - Evaluate an expressionSynopsis. expr arg ?arg arg ...?

Description. Concatenates arg’s (adding separator spaces between them), evaluates the result as a Tclexpression, and returns the value. The operators permitted in Tcl expressions are a subset of the operatorspermitted in C expressions, and they have the same meaning and precedence as the corresponding Coperators. Expressions almost always yield numeric results (integer or floating-point values). Forexample, the expression

expr 8.2 + 6

evaluates to 14.2. Tcl expressions differ from C expressions in the way that operands are specified. Also,Tcl expressions support non-numeric operands and string comparisons. For some examples of simpleexpressions, suppose the variable a has the value 3 and the variable b has the value 6. Then the commandon the left side of each of the lines below will produce the value on the right side of the line:

expr 3.1 + $a 6.1

expr 2 + "$a.$b" 5.6

expr 4*[llength "6 2"] 8

expr {{word one} < "word $a"} 0

Math functions. Tcl supports the following mathematical functions in expressions:

31

Page 36: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

acos cos hypot sinh

asin cosh log sqrt

atan exp log10 tan

atan2 floor pow tanh

ceil fmod sin

Each of these functions invokes the math library function of the same name; see the manual entries forthe library functions for details on what they do. Tcl also implements the following functions forconversion between integers and floating-point numbers and the generation of random numbers:

abs(arg), double(arg), int(arg), rand(), round(arg), srand(arg).

3.2.3. if - Execute scripts conditionallySynopsis. if expr1 ?then? body1 elseif expr2 ?then? body2 elseif ... ?else?

?bodyN?

Description. The if command evaluates expr1 as an expression (in the same way that expr evaluatesits argument). The value of the expression must be a boolean (a numeric value, where 0 is false andanything is true, or a string value such as "true" or "yes" for true and "false" or "no" for false); if it is truethen body1 is executed by passing it to the Tcl interpreter. Otherwise expr2 is evaluated as anexpression and if it is true then body2 is executed, and so on. If none of the expressions evaluates to truethen bodyN is executed. The then and else arguments are optional "noise words" to make the commandeasier to read. There may be any number of elseif clauses, including zero. BodyN may also be omittedas long as else is omitted too. The return value from the command is the result of the body script thatwas executed, or an empty string if none of the expressions was non-zero and there was no bodyN.

3.2.4. for - "For" loopSynopsis. for start test next body

Description. For is a looping command, similar in structure to the C for statement. The start,next, and body arguments must be Tcl command strings, and test is an expression string. If acontinue command is invoked within body then any remaining commands in the current execution ofbody are skipped; processing continues by invoking the Tcl interpreter on next, then evaluating test,and so on. If a break command is invoked within body or next, then the for command will returnimmediately. The operation of break and continue are similar to the corresponding statements in C.For returns an empty string.

for {set x 0} {$x<10} {incr x} {

puts "x is $x"

}

32

Page 37: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.2.5. while - Execute script repeatedly as long as a conditionis metSynopsis. while test body

Description. The while command evaluates test as an expression (in the same way that exprevaluates its argument). The value of the expression must be a proper boolean value; if it is a true valuethen body is executed by passing it to the Tcl interpreter. Once body has been executed then test isevaluated again, and the process repeats until eventually test evaluates to a false boolean value.Continue commands may be executed inside body to terminate the current iteration of the loop, andbreak commands may be executed inside body to cause immediate termination of the while command.The while command always returns an empty string.

set x 0

while {$x<10} {

puts "x is $x"

incr x

}

3.3. Instrument settings

3.3.1. Beam shutter

Every instrument area in the SINQ neutron guide hall is controlled by the Local Beam Controlsystem(LBC). It uses fixed installed barriers to prevent entry to the area around the active beam duringexperimental work. If the user carries out his work in accordance with the operating instructions, he willbe protected from direct beam radiation. A danger zone which is subject to the LBC interlocking systemhas two beam shutters

1. the neutron guide main shutter which only can be opended by the radiation safety officer

2. and a secondary shutter to close the beam at the instrument separately from the others if more thenone instrument is build up at the same neutron guide.

33

Page 38: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

The secondary shutter for the instrument is the one the user can handle. Normally the secondary shuttercan only be operated if the experimental area (yellow fence) of the instrument is locked. The shutter canthen be opened and closed by a button on the key box at the entrance door of the instrument area and alsoby the SICS command shutter which has the following syntax:

shutter

without parameter yields the actual status of the shutter which can be shutter is open,

shutter is closed, or Enclosure is broken. The last status message is returned if theLBC system wouldn’t allow to open the beam. If this message is returned the shutter is closed.

shutter close

closes the secondary beam shutter.

shutter open

opens the secondary beam shutter.

3.3.2. Neutron velocity selector

The neutron velocity selector is a high-speed rotor. Blades inserted in the rotor are only transparent forneutrons which manage pass the rotor in a time intervall defined by the rotation speed of the selector.Thus neutrons in a certain speed range (wavelength range) are selected. The wavelength distribution ofneutrons is also dependent of the tilt angle between the rotation axis and the neutron beam. Extensivetime-of-flight measurements have been done to determine the wavelength λ and resolution ∆λ/λ as afunction of selector speed and tilting angle. The dependency of the wavelength λ [nm] on the rotationspeed ν [RPM] can well be described by

λ(ν,ξ)= A(ξ)/ν+B(ξ)

where A(ξ) ans B(ξ) are parameters depending on the tilting angle ξ. The experimentally determinedrelationships A(ξ) and B(ξ) are

B(ξ)= 0.0122+3.61x10-4ξ+3.14 x10-4ξ2 +3.05x10-5ξ3 +9.32x10-7ξ4

The wavelength resolution ∆λ/λ of the selector should be independent of the rotation speed and only bedependent of the tilting angle ξ. However, this is only true for long collimations. For short collimationlengths a slight dependency of the resolution on the rotaion speed could be measured. Also the shape ofthe resolution function is than not necessarily triangular. If the wavelength resolution of the selector isnot so important for the refinement of your data analysis you can use the values given in the followingtable for the dependency of the wavelength resolution ∆λ/ λ on the tilting angle ξ.

ξ ∆λ/λ A(ξ) B(ξ)-15 0.12 19812 0.0218

34

Page 39: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

ξ ∆λ/λ A(ξ) B(ξ)-10 0.115 17774 0.0182-5 0.095 15493 0.01630 0.1 12716 0.010975 0.155 9342 0.026910 0.3 5293 0.0869

A high speed-device like a velocity selector has to account for gyroscopic forces when moving thedevice. In praxis this means that the selector must be stopped before the tilt angle can be changed.Furthermore there are forbidden areas of rotation speeds. In these areas the velocity selector is indestructive resonance with itself. For controlling the neutron velocity selector three command areavailable: nvs , nvswatch, and lambda which are described below.

lambda

The name of the variable alone prints the current wavelength in nm.

lambda rot <value>

calculates the rotation speed for the wavelength given by <value>.

lambda wl <value>

calculates the wavelength for the rotation speed given as parameter <value>.

drive lambda <newval>, run lambda <newval>

The lambda variable can be driven using the normal drive and run commands.

nvs status

Prints a status summary of the velocity selector.

nvs list

Displays rotation speed and tilt angle of the velocity selctor.

nvs [rot=<newval>] [tilt=<newval>]

This command sets a new tilt angle and/or rotation speed for the velocity selector. Either one orboth of the keywords tilt or rot may be given, followed by a number.

nvs rotinterest

Enables printing of status messages about the current state of the selector when it is driven.

nvs loss

Starts a loss current measurement on the velocity selector and prints the result.

The commands described so far cover the actual handling of the velocity selector. During a measurementusers might want to use further functions such as:

35

Page 40: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

• Monitor the rotation speed of the velocity selector.

• Log the rotation speeds of the velocity selector.

• Initiate error handling when the velocity selector fails to stay within a predefined tolerance of rotationspeeds.

Now, these are tasks usually connected with sample environment devices. Now, the SICS programmershave been lazy. Moreover they wanted to avoid duplicating code (and bugs). Consequently, they trickedthe velocity selector to be a sample environment device as well.

This means besides the actual velocity selector object (in this case called nvs) there exists another objectfor monitoring the velocity selector. The name of this device is the name of the velocity selector objectwith the string watch appended. For example if the velocity selector has the SICS name nvs, the monitorobject will be nvswatch. The commands understood by the watch object are fully decribed in thesection about sample environment devices. Please note, that all driving commands for the watch objecthave been disabled. Driving can only be achieved through the velocity selector object or the lambdacommand.

3.3.3. Positioning an attenuator

att

prints the current positioned attenuator.

att <val>

positions attenuator <val>. Allowed attenuator numbers are 0, 1, 2, 3, 4 and 5.0 : square 50 mm x 50 mm slit, attenuation = 11 : circular 41 x diameter 0.4 mm slit, attenuation = 1/4852 : circular 9 x diameter 2 mm slit, attenuation = 1/883 : circular 20 mm diameter slit, attenuation = 1/84 : circular 30 mm diameter slit, attenuation = 1/3.55 : circular 15 mm diameter slit, attenuation = 1/??

3.3.4. Changing the collimation

coll

prints the current collimation length.

coll <val>

sets the collimation <val>. Allowed collimation lengths are 1, 1.4, 2, 3, 4.5, 6, 8, 11, 15 and 18.

36

Page 41: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.3.5. Positioning the detector

The detector can be moved via three motors named detectorx , detectory, anddetectorrotation. These motors can be driven by the run or drive commands described in Section3.1.5. The commands how to change motor parameters like Precision, SoftZero etc. are described inSection 3.1.6. The axes of the detector motors are defined as:

detectorx

An increasing value moves the detector away and a decreasing value towards the sample position.

detectory

moves the detector laterally by a maximum of 480 mm in order to increase the accessible q-range atany detector position.

detectorrotation

rotates the detector around its vertical axis to reduce parallaxes effects.

Warning

The BerSANS software package for the primary data reduction does nothandle the detector rotation.

Instead of driving the motors individually one can refer to all motors as a whole by the dt command. Thecommand dt without other parameters will yield a listing of the current position of the detector:

dt

Status listing for dt

dt.x = 18800.048828

dt.y = 0.004000

dt.phi = 0.414000

To move the detector you can call dt with parameters defining the new position of the motors, e.g.

dt x = 800 y = ++100 phi 0

The = sign is not mandatory and can be left out. The command above drives the motor detectorx to theposition 800, the motor detectory to a position 100 mm further into y-direction, the motordetectorrotation to position 0. All the three movements are done parallel. Relative movements canbe performed by preceding an -- or ++ to the motor position. The whole set of parameters valid for thedt command is described in the Section 3.1.7 about special SANS commands.

37

Page 42: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.3.6. Positioning the beam stop

The beam stop can be adjusted by two motors named beamstopx and beamstopy. They can be drivenby the run or drive commands which are described in Section 3.1.5. The commands how to changemotor parameters like Precision, SoftZero etc. are described in Section 3.1.6. The axes of the beamstop motors are defined as:

beamstopx

moves the beam stop horizontally.

beamstopy

moves the beam stop vertically.

Instead of driving the motors individually one can refer to both motors as a whole by the bs command.The command bs without other parameters will yield a listing of the current position of the beam stop:

bs

Status listing for bs

bs.x = 0.300000

bs.y = 2.500000

To move the beam stop you can call bs with parameters defining the new position of the motors, e.g.

bs x = 2 y ++10

The = sign is not mandatory and can be left out. The command above drives the motor beamstopx to theposition 2 and the motor beamstopy to a position 10 mm further into y-direction. Both movements aredone parallely. Relative movements can be performed by preceding an -- or ++ to the motor position.The whole set of parameters valid for the bs command is described in the Section 3.1.7 about specialSANS commands.

Additionally to the commands for the movement of the two beam stop axes a few other commands havebeen established:

bsout

moves the beam stop out of the detection area, so that there is nowhere a shadow of the beam stopon the detector. This position is outside the software limits of the motors in the area of the beamstop magazines. In this area an uncontrolled movement could lead to a collisioni with themagazines. Therefore one can not move the beam stop anymore with the bs command after callingbsout, because the motors are fixed automatically.

38

Page 43: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

bsin

releases the beam stop motors and moves them back to the previous position. After calling bsout

you have to call first bsin to continue with the movement of the beam stop with the bs command.

bsfree

is a manager command, which releases the beam stop motors, if they are still in the bsout-position.This command should only be used when something went wrong with the SICS server during thetime the beam stop was in bsout-position.

bschange [<val>]

allows the user to change the size of the beam stop. Four different sizes are available and can beselected by the parameter <val>. Valid values for <val> are:1 for beam stop size of 40 mm x 40 mm2 for beam stop size of 70 mm x 70 mm3 for beam stop size of 85 mm x 85 mm4 for beam stop size of 100 mm x 100 mm

The bschange command automatically recognizes the actually used beam stop size, puts it into theempty magazine and picks up the new beam stop. bschange automatically closes the instrumentbeam shutter, if it was open, but it doesn’t reopen it again afterwards. Calling bschange without aparameter returns the number of the actually used beam stop size.

3.3.7. Calculating the q range

The q range of the current setting can comfortably be calculated with the following command:

qrange [x <detdist>] [wl <lambda>]

calculates the q range of the current setting. The detector distance x (in mm) and the wavelength wl(in nm) can be varied with the optional parameters. Examples: qrange prints the q range of thecurrent setting, qrange x 6000 wl 0.8 prints the q range of the current setting with forcedvalues for the detector distance (6000mm) and the wavelength (0.8nm).

3.3.8. Estimating the measurement time

The measurement time of a sample depends on many factors and needs to be estimated for each sampleindividually. This procedure is simplified with the command GuessCount.

gc <measMonis> <totalCounts>

GuessCount: executes a measurement of <measMonis> Monis and extrapolates the measurement

39

Page 44: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

time and Monis for a final value of <totalCounts> counts. Example: gc 5 1E7 forces theinstrument to measures for 5 Monis and estimates the measurement time and Monis for 10’000’000counts.

3.4. Sample environments

3.4.1. Sample table

One standard sample set-up is the sample table with a vertical translator, a xy-table and a rotation table.Optionally, another linear translator stage or a double goniometer can be mounted on the rotation table.The available motor axes for the sample table are defined as follows:

saz

vertical translation of the sample table

say

horizontal translation parallel to the neutron beam direction

sax

horizontal translation perpendicular to the neutron beam

som

rotation around the vertical axis ω

gphi

rotation around the horizontal axis Φ

gtheta

rotation around the horizontal axis Θ, Θ ⊥ Φ ⊥ ω

sposi

horizontal translation. Linear translation stage can be mounted on the rotation table and is used forthe movement of the temperature controlled (Haake temperature controler, Section 3.4.4) sampleholder.

The motors can be driven by the drive or run commands described in Section 3.1.6. Instead of drivingthe motors individually one can refer to all motors as a whole by the st command. The command st

without parameters will yield a listing of the current positions of the sample table motors:

st

Status listing for st

40

Page 45: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

st.omega = 0.504000

st.x = 12.965000

st.y = -18.992001

st.z = 106.121002

st.posi = 173.875000

The axes are named x, y, z, posi, omega, phi and theta which move the motors sax, say, saz, spos,som, gphi and gtheta, respectively. In the above example the optional linear translator stage wasmounted on the rotation table so that the position of the motor spos is listed but not those of the motorsgphi and gtheta. The whole set of parameters valid for the st command are described in Section 3.1.7about special SANS commands. A frequently used parameter for st is the pos parameter. The command

st pos P1

reads out the actual positions of all the motors of the sample table and defines for it the name P1.Afterwards this position can be reached by typing simply st P1. Instead of remembering the positionsof all the motors one only has to remember the name P1 to bring the sample in position.

3.4.2. Bruker electromagnet

This is the controller for the large magnet at SANS. The controller is a box the size of a chest of drawers.This controller can be operated in one out of two modes: in field mode the current for the magnet iscontrolled via an external hall sensor at the magnet. In current mode, the output current of the device iscontrolled. This magnet can be configured into SICS with a command syntax like this:

evfactory new <name> bruker <Mac-PC> <Mac-port> <Mac-channel>

<name> is a placeholder for the name of the device within SICS. A good suggestion (which will be usedthroughout the rest of the text) is magnet. bruker is the keyword for selecting the bruker driver.<Mac-PC> is the name of the Macintosh PC to which the controller has been connected, <Mac-Port> isthe port number at which the Macintosh-PC’s serial port server listens. <Mac-channel> is the RS-232channel to which the controller has been connected. For example (at SANS):

evfactory new magnet bruker lnsa10.psi.ch 4000 9

creates a new command magnet for a Bruker magnet Controller connected to serial port 9 at lnsa10.

41

Page 46: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

In addition to the standard environment controller commands this magnet controller understands thefollowing special commands:

magnet polarity

Prints the current polarity setting of the controller. Possible answers are plus, minus and busy.The latter indicates that the controller is in the process of switching polarity after a command hadbeen given to switch it.

magnet polarity <val>

sets a new polarity for the controller. Possible values for <val> are minus or plus. The meaning isself explaining.

magnet mode

Prints the current control mode of the controller. Possible answers are field for control via hallsensor or current for current control.

magnet mode <val>

sets a new control mode for the controller. Possible values for <val> are field or current. Themeaning is explained above.

magnet field

reads the magnets hall sensor independent of the control mode.

magnet current

reads the magnets output current independent of the control mode.

Warning

There is a gotcha with this. If you type only magnet a value will bereturned. The meaning of this value is dependent on the selected controlmode. In current mode it is a current, in field mode it is a magneticfield. This is so in order to support SICS control logic. You can readvalues at all times explicitly using magnet current or magnet field.

3.4.3. Sample holder for electro magnet

Another standard sample seup is a vacuum chamber, which is directly connected to the collimator anddetector tubes, so that the SANS can be operated at about 10-2 mbar in a single vacuum without windowsor with thin aluminium or sapphire windows to work at ambient pressure or at vacuum conditions downto 10-6 mbar. The chamber is large enough to carry an electromagnet. For this setup a sample changer

42

Page 47: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

with an optional heated sample position is available. This sample changer can be moved vertically by245 mm and can also be rotated by ±10 degree. The two available motors are defined as follows:

mz

moves the electromagnet sample holder in vertical direction.

mom

rotates the sample around the vertical axis ω by ±10 degree.

The motors can be driven by the run or drive command described in Section 3.1.6. Instead of drivingthe motors individually one can refer to both motors as a whole by the msh command. The commandmsh without parameters will yield a listing of the current position of the electromagnet sample holder:

msh

Status listing for msh

msh.z = 0.000000

msh.omega = 0.000000

The axes of the sample holder mz and mom are named in the msh command z and omega. The whole setof parameters valid for the msh command are described in Section 3.1.7 about special SANS commands.

3.4.4. Haake C25P temperature controller

This is sort of a bucket full of water equipped with a temperature control system. It is connected with ablue ethernet cable to the port nr. 8 of the SANS terminal. The SEA software written by Markus Zollikeris the best way to control and monitor the thermostat manually; it is started from a terminal window withsea. Please refer to the SEA Wiki page (http://lns00.psi.ch/sinqwiki/Wiki.jsp?page=Sea) for moreinformation.

To add an external Pt100 sensor, plug in the sensor and restart the thermostat and the sea client (choose’Haake’ as device and check the box ’has sample sensor’). If the external sensor should be used asreference to control the thermostat, check the box ’control on sample’.

start_sea

starts the sea server from SICS.

temperature

reads out the current temperature.

drive temperature <val>

changes the set temperature of the thermostat to the value <val>.

43

Page 48: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

in a terminal window: sea

starts the sea server client from a terminal. Choose Haake as device.

3.4.5. Eurotherm temperature controller

At SANS there is a Eurotherm temperature controller for the sample heater available. This and probablyother Eurotherm controllers can be configured into SICS with the following command. The Eurothermneeds to be connected with a nullmodem adapter.

EVFactory new <name> euro <computer> <port> <channel>

<name> is a placeholder for the name of the device within SICS. A good suggestion is temperature.euro is the keyword for selecting the Eurotherm driver. computer is the name of the Macintosh PC towhich the controller has been connected, <port> is the port number at which the Macintosh-PC’s serialport server listens. <channel> is the RS-232 channel to which the controller has been connected.

Warning

The Eurotherm needs a RS-232 port with an unusual configuration: 7bits, evenparity, 1 stop bit. Currently only the SANS Macintosh port 13 (the last in the upperserial port connection box) is configured like this! Thus, an example for SANS andthe name temperature looks like:

EVFactory new temperature euro lnsa10.psi.ch 4000 13

There are two further gotchas with this thing:

• The Eurotherm needs to operate in the EI-bisynch protocoll mode. This has to be configured manually.For details see the manual coming with the controller.

• The weird protocol spoken by the Eurotherm requires very special control characters. Therefore thesend functionality usually supported by a SICS environment controller could not be implemented.

44

Page 49: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

3.5. Data handling and acquisition

3.5.1. File naming conventions and storing data

Data files are stored by the SICS server on the lnsa10.psi.ch workstation in the directory defined by theSICS variable SICSDataPath. By default this directory is /home/SANS/data/. The file name of a datafile is composed of four parts:

1. the prefix stored in the variable SICSDataPrefix, by default sans

2. the run number stored in the variable SICSDataNumber, which is incremented before each storingprocess and has 5 digits (leading 0)

3. the actual year (4 digits)

4. and the post-fix stored in the variable SICSDataPostfix, by default .hdf

A typical data file name would be /home/SANS/data/sans123452006.hdf. All data files are writtenin NeXus format.

3.5.2. Data acquisitionSICS counter handling. The SICS counter concept may include several monitors per counter. At theSANS instrument two monitors are installed: one between beam shutter and neutron velocity selector,which is used for normalizing the SANS measurement on the incident neutron flux, and a second oneafter the selector just in front of the attenuator. For the SANS instrument only one counter is handledwhich is named counter. A few words have to be lost about the SICS handling of preset values forcounters. Two modes of operation have to be distinguished: counting until a timer has passed, forexample counting for 20 seconds. This mode is called Timer mode. In the other mode, counting iscontinued until a control monitor has reached a certain preset value. This mode is called Monitor mode.At the SANS instrument the first monitor between beam shutter and neutron selector is used in thismode. The preset values in Monitor mode are usually very large. Therefore the counter has an exponentdata variable. Values given as preset are effectively 10 to the power of this exponent. For instance if thepreset is 25 and the exponent is 6, then counting will be continued until the monitor has reached 25million. Note, that this scheme with the exponent is only in operation in Monitor mode. The commandsunderstood are:

counter SetPreset <val>

sets the counting preset to <val>.

counter GetPreset

prints the current preset value.

counter SetExponent <val>

sets the exponent for the counting preset in monitor mode to <val>.

45

Page 50: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

counter GetExponent

prints the current exponent used in monitor mode.

counter SetMode <val>

sets the counting mode to <val>. Possible values are Timer for timer mode operation andMonitor for waiting for a monitor to reach a certain value.

counter GetMode

prints the current mode.

counter GetCounts

prints the counts gathered in the last run.

counter GetMonitor <n>

prints the counts gathered in the monitor number <n> in the last run.

counter Count <preset>

starts counting in the current mode and the preset <preset>.

counter status

prints a message containing the preset and the current monitor or time value. Can be used tomonitor the progress of the counting operation..

counter GetTime

retrieves the actual time the counter counted for. This excludes time where there was no beam orcounting was paused.

Histogram memory. The histogram memory is used in order to control the large area sensitive detector.It takes care of putting counts detected in the detector into the proper bin in memory. Next to aconventional mode of a SANS measurement where all detected neutrons are accumulated for a giventime or monitor count, also a time of flight mode and a stroboscopic mode are available, where there isfor each detector pixel a row of memory locations mapping the time bins. As usual in SICS the syntax isthe name of the histogram memory followed by qualifiers and parameters. For the SANS the name of thehistogram memory is banana.

The histogram memory has a plethora of configuration options coming with it which define memorylayout, modes of operation, handling of bin overflow and the like. Additionally there are histogrammemory model specific parameters which are needed internally in order to communicate with thehistogram memory. In most cases the histogram memory will already have been configured at SICSserver startup time. However, there are occasion where these configuration options need to be enquiredor modified at run time. The command to enquire the current value of a configuration option is: bananaconfigure <option>, the command to set it is: banana configure <option> <newvalue>. Alist of common configuration options and their meaning is given below:

46

Page 51: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

HistMode

describes the modes of operation of the histogram memory. Possible values are:

Transparent

counter data will be written as is to memory. For debugging purposes only.

Normal

neutrons detected at a given detector will be added to the apropriate memory bin.

TOF

time of flight mode, neutrons found in a given detector will be put added to a memory locationdetermined by the detector and the time stamp.

Stroboscopic

This mode serves to analyse changes in a sample due to an varying external force, such as amagnetic field, mechanical stress or the like. Neutrons will be stored in memory according todetector position and phase of the external force.

OverFlowMode

This parameter determines how bin overflow is handled. This happens when more neutrons getdetected for a particular memory location then are allowed for the number type of the histogrammemory bin. Possible values are:

Ignore

overflow will be ignored, the memory location will wrap around and start at 0 again.

Ceil

the memory location will be kept at the highest posssible value for its number type.

Count

as Ceil, but a list of overflowed bins will be maintained.

Rank

defines the number of histograms in memory.

Length

gives the length of an individual histogram.

BinWidth

determines the size of a single bin in histogram memory in bytes.

47

Page 52: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

For time of flight mode the time binnings can be retrieved and modified with the following commands.Note that these commands do not follow the configure syntax given above. Please note, that the usage ofthe commands for modifying time bins is restricted to instrument managers.

banana timebin

prints the currently active time binning array.

banana genbin <start> <step> <n>

generates a new equally spaced time binning array. Number <n> time bins will be generated startingfrom <start> with a stepwidth of <step>.

banana setbin <inum> <value>

Sometimes unequally spaced time binnings are needed. These can be configured with thiscommand. The time bin <iNum> is set to the value <value>.

banana clearbin

Deletes the currently active time binning information.

banana preset [<val>]

with a new value <val> sets the preset time or monitor for counting. Without <val> prints thecurrent value.

banana exponent [<val>]

with a new value <val> sets the exponent to use for the preset time in Monitor mode. Without<val> prints the current value.

banana CountMode [<mode>]

with a new value <mode> sets the count mode. Possible values are Timer for a fixed counting timeand Monitor for a fixed monitor count which has to be reached before counting finishes. Without avalue for <mode> the command prints the currently active value.

banana init

after giving the configuration commands this needs to be called in order to transfer the configurationfrom the host computer to the actual histogram memory.

banana count

starts counting using the currently active values for CountMode and preset. This command doesnot block, i.e. in order to inhibit further commands from the console, you have to give Successafterwards.

banana Initval <val>

initialises the whole histogram memory to the value <val>. Usually 0 in order to clear thehistogram memory.

48

Page 53: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

banana get <i> <iStart> <iEnd>

retrieves the histogram number <i>. A value of -1 for <i> denotes retrieval of the whole histogrammemory. <iStart> and <iEnd> are optional and allow to retrieve a subset of a histogram between<iStart> and <iEnd>.

banana sum <d0min> <d0max> <d1min> <d1max> ...<dnmin> <dnmax>

calculates the sum of an area on the detector. For each dimension a minimum and maximumboundary for summing must be given.

Storing Data and starting a SANS measurement. Instead of initializing and starting a measurement bythe banana command a few other commands have been introduced to take care for those things:

StoreData

This command does what it says. It writes the current state of the instrument including counts to aNeXus data file.

count [<mode> <preset>]

starts a count operation in mode <mode> with a preset <preset>. <mode> can have the valuesTimer or Monitor. The parameters are optional. If they are not given, the count operation will bestarted with the current setting in the histogram memory object banana. Before the count operationis started, the count command waits until all other commands executed earlier are finished. Duringthe count operation no other commands can be executed. After the count, StoreData will beautomatically called.

repeat <num> [<mode> <preset>]

calls num times count. num is a required parameter. The other two are optional and are handled asdescribed above for count.

3.5.3. XY table

XYTable is a class which maintains a list of X-Y values. These can be plotted in the VarWatch SICSclient by configuring it with a special command. Before you may use an XYTable object it had to beinstalled into the system by the SICS administrator. This can be done by the command MakeXYTable

<xydata> in the SANS initialization file. For this documentation it is assumed that this has happenedalready and a XYTable object is available in the system under the name <xydata>.

Interaction with the XYTable object happens through the following commands:

<xydata> clear

clears all entries in the x-y table.

49

Page 54: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 3. Instrument control commands

<xydata> list

lists the entries in the x-y table on the screen.

<xydata> write <filename>

writes the x-y list to the disk file filename. This file resides on the machine running the SICS server.

<xydata> uuget

sends the x-y list in an uuencoded format. This is the command to give to the VarWatch SICS clientin order to make it display the x-y list.

<xydata> add <xval> <yval>

creates a new x-y list entry with the values <xval> and <yval>.

3.5.4. Status of the actual acquisition process

A webpage (http://lns00.psi.ch/sicszone/sansstatus?instrument=sans) with the actual instrument status isavailable (only inside the PSI network).

sinq

prints the SINQ status in the SICS client which issued the command.

50

Page 55: SICS manual for the SANS I instrument › sites › default › files › import › sinq › ... · returns current value or will drive device to new value

Chapter 4. Other programs

4.1. Grasp

Grasp stands for ’Graphical Reduction and Analysis SANS Program for Matlab’ which was developedby Charles Dewhurst at the Institut Laue-Langevin (ILL) in Grenoble, France. Please refer to the Graspwebpage (http://www.ill.fr/lss/grasp/grasp_main.html).

4.2. BerSANS software package

The BerSANS data reduction software has been developed by Uwe Keiderling at theHahn-Meitner-Institut (HMI) in Berlin, Germany. The Manual of the BerSANS Software Package can bedownloaded (http://kur.web.psi.ch/sans1/BerSANS/SANS-Manual.pdf) as pdf file.

4.3. SASfit program

SASfit for analyzing and plotting small angle scattering data has been written by Joachim Kohlbrecher atthe Paul Scherrer Institute (PSI) in Villigen, Switzerland. Please refer to the SASfit webpage(http://kur.web.psi.ch/sans1/SANSSoft/sasfit.html).

51