Next: Retrieving detector parameters Up: SLS Detector text clients Previous: Acquisition
Subsections

- Standard commands
- Postprocessing commands
  - Angular conversion
- Acquisition
- Advanced commands
  - Calibration
  - Acquisition
  - Configuration
  - Receiver - GOTTHARD/EIGER
  - Postprocessing
  - Testing - EIGER specific
- Detector settings
- Debug

# Detector setup

`sls\_detector\_put [j-][i:]var arg`

is used to configure the detector parameters `var` with the value `arg`.
It returns the actual value of the variable, as when calling `sls\_detector\_get` with the same command.

## Standard commands

config fname
  Load the configuration file fname.
  Examples of configuration files are available in the directory `examples`. This should be done every time the configuration of the detectors(s) changes or the control PC is rebooted. Must be executed on all the control PCs, before executing other commands.
parameters fname
  Load the parameter file fname.
  The syntax of the commands in the parameter file is exactly the same as for the command line interface. Can be used to load a standard mode of acquisition and/or to hide advanced parameters from the final user. Examples of parameter files are available in the directory `examples`.
settings sett
  Configures the settings of the detector. Refer to detailed detector documentation for more details:
  for MYTHEN sett can be: standard, fast, highgain;
  for GOTTHARD sett can be: veryhighgain, highgain, mediumgain, lowgain, dynamicgain;
  for EIGER sett can be: standard, highgain, lowgain.
threshold ev
  For photon counting detectors, sets the detector threshold in eV. The detector should be properly calibrated, otherwise standard calibration coefficients are used, which can give an uncertainty up to a few keVs.
timing sync
  Sets the timing mode of the detector. Can be auto, gating (works only if at least one of the signals is configured as gate_in), trigger (works only if at least one of the signals is configured as trigger_in), ro_trigger (works only if at least one of the signals is configured as ro_trigger_in), triggered_gating (works only if one of the signals is configured as gate_in and one as trigger_in).
  Refer to the detailed documentation to understand how the different timing modes work.
outdir path
  Defines the path where the output files will be saved to.
fname prefix
  Defines the prefix of the file name for the data output.
  The final file name will be:
  `prefix[_d` d`][_S` v0`][_s` v1`][_p` p`][_f` f`]_`i`.`ext
  where:
  d is the controller index, in case of data receiver and more than one controller;
  v0 is the scan0 variable with the desired precision, if scan0 is enabled;
  v1 is the scan1 variable with the desired precision, if scan1 is enabled;
  p is the position index, if different positions are configured;
  f is the frame index of the first frame stored in the file, if many frames and cycles are configured;
  i is the file index;
  ext is the file extension e.g. .raw for MYTHEN and EIGER raw data, .dat for MYTHEN processed data.
index i
  Sets the starting index of the file i at the beginning of the acquisition (automatically incremented for each measurement).
enablefwrite b
  Enables (1) or disables (0) file writing.
exptime ts
  Sets the exposure time of a single acquisition to ts (in s). It is overridden in case the detector is in gating mode.
  Refere to detailed documentation to understand how the different timing modes work.
subexptime ts
  Sets the subexposure time of a single subacquisition to ts (in s) in EIGER autosumming mode (=dr 32). Refer to detailed documentation to understand how the different timing modes work.
period ts
  Sets the frames period (in s). It is overridden in case the detector is in gating mode.
  Refer to detailed documentation to understand how the different timing modes work.
delay ts
  Sets the delay after trigger in triggered mode (in s).
  Refer to the detailed documentation to understand how the different timing modes work.
gates n
  Sets the number of gates per frame in gated (stroboscopic) mode.
  Refer to the detailed documentation to understand how the different timing modes work.
frames n
  Sets the number of frames acquired sequentially per cycle (e.g. after each trigger), with the exposure time defined by exptime and the period defined by period (unless in gated mode). The frame index in the output file name will automatically be incremented.
  Note that the total number of images will be frames times cycles. Refer to detailed documentation to understand how the different timing modes work.
cycles n
  Sets the number of cycles (e.g. number of triggers). The frame index in the output file name will automatically be incremented.
  Note that the total number of images will be by frames times cycles. Refer to the detailed documentation to understand how the different timing modes work.
probes
  Sets the number of probes to accumulate for stroboscopic measurements.
  Refer to detailed documentation to understand how the different timing modes work.
measurements
  Sets the number of repetitions of the acquisitions (non real time!). The file index in the file name will be automatically incremented.
  Refer to detailed documentation to understand how the different timing modes work.
dr n
  Sets the dynamic range n (in bits) of the data for a photon counting detector. For EIGER it can be set to 4, 8, 16 (but the real counter depth will still be limited to 12 bits) or 32 when one wants to activate the internal subframe summing mode.

flags s
  Sets some particular flags for your detector. For MYTHEN s can be none, storeinram (for buffered readout) or tot (for time over threshold). For EIGER, s can be continous (for continous readout- still buffer on memories happens), storeinram (for buffered readout. Do not use as has no graet advantages), parallel for parallel exposure to the next frame and readout of the previous frame, nonparallel to decouple sequentially readout and exposure, safe (rowclock interleaved).
help cmd
  Returns the help for command cmd.
lock
  Locks (1) or unlocks (0) the detector to this particular control PC. An be unlocked again only from the same PC or by rebooting the detector.
nmod n
  Sets the number of modules for the detector to n for partial readout. Will be replaced by ROI.

## Postprocessing commands

flatfield fname
  Sets the flat field file name. File ffdir/fname will be used to calculate the flat field coefficients. none to unset flat field corrections.
ratecorr ns
  Sets the deadtime to be used for rate corrections in ns. 0 to unset, -1 to use default dead time for the actual settings.In the case of EIGER, as online data rate correctiosn are applied, then a correction table has to be calculated every time the rate correction is changed, activated, or the subexposure time is changed.

### Angular conversion

fineoff deg
  Sets the fine offset for the experiment.
samplex mm
  Sets the sample displacement from the center of the diffractometer in the X-ray direction, to improve angular conversion (unused).
sampley mm
  Sets the sample displacement from the center of the diffractometer in the ortogonal direction, to improve angular conversion (unused)

## Acquisition

See SLS Detectors Documentation for a detailed description of the acquisition flow.

positions n p1 p2...pn
  Sets the number of positions n and their value.
startscript s
  Sets the script to be executed at the beginning of each measurement. none unsets.
startscriptpar p
  Sets the parameter to be passed to the start script
stopscript s
  Sets the script to be executed at the end of each measurement. none unsets.
stopscriptpar p
  Sets the parameter to be passed to the stop script.
scriptbefore s
  Sets the script to be executed before each acquisition. none unsets.
scriptbeforepar p
  Sets the parameter to be passed to the script before.
scriptafter s
  Sets the script to be executed after each acquisition. none unsets.
scriptafterpar p
  Sets the parameter to be passed to the script after.
headerbefore s
  Sets the script to be executed to acquire the header of the acquisition. none unsets.
headerbeforepar p
  Sets the parameter to be passed to the header before.
headerafter s
  Sets the script to be executed to append to the header of the acquisition. none unsets.
headerafterpar p
  Sets the parameter to be passed to the header after.
scan0scripts s
  Sets the script to execute at scan 0 level. none unsets, threshold, energy, trimbits, position perform the corresponding scans without need of a custom script.
scan0par p
  Sets a parameter to be passed to the scan 0 level script.
scan0prec i
  Sets the number of decimal digits for the scan0 level parameter in the file name (default is 0).
scan0steps n s1 s2..sn
  Sets the number of scan 0 level steps n and their value.
scan0range min max step
  Sets the minimum, the maximum and the step for the scan 0 level steps (easier to use than scan0steps if equally spaced steps in a range)
scan1script s
  Sets the script to execute at scan 1 level. none unsets, threshold, energy, trimbits, position perform the corresponding scans without need of a custom script.
scan1par p
  Sets a parameter to be passed to the scan 1 level script.
scan1prec i
  Sets the number of decimal digits for the scan1 level parameter in the file name (default is 0).
scan1steps n s1 s2...sn
  Sets the number of scan 0 level steps n and their value.
scan1range min max step
  Sets the minimum, the maximum and the step for the scan 0 level steps (easier to use than scan0steps if equally spaced steps in a range)

## Advanced commands

### Calibration

This operations should be performed only rarely to configure the detector

trim:mode fname
  Trims the detector according to mode (can be noise, beam, improve, fix) and saves the resulting trimbits to file fname. Take care to set a proper exptime and vthreshold before trimming.
encallog b
  Sets (1) or unsets (0) the logging for energy calibration.
angcallog b
  Sets (1) or unsets (0) the logging for angular calibration.

### Acquisition

It is normally recommended to use `sls\_detector\_acquire [j-]`, which takes care of everything

status s
  Starts (start) or stops (stop) the detector acquisition.
online b
  Sets the detector in online (1) or offline (0) mode.
resetctr i
  GOTTHARD- ADVANCED- resets counter in detector, restarts acquisition if i=1
resmat i
  EIGER- ADVANCED - resets counter in detector before the following acquisition. Default settings is resmat 1. resmat 0 does not reset the counter bit before the acquisition. Note that in EIGER the counter is always reset after the acquisition.

### Configuration

Advanced commands to configure the detector system. Should be left to the configuration file

type s
  Sets the types of detector controllers in the system. Can be Mythen, Gotthard, EIGER and multiple controllers should be catenated with a + (e.g. Mythen+Mythen for 2 Mythen controllers).
d:hostname s
  Sets the hostname or IP address for the controller d, where d is the controller index within the detector structure.
d:extsig:i s
  Configures the usage of the external IO signals to synchronize the detectors. s can be: off, gate_in_active_high, gate_in_active_low, trigger_in_rising_edge, trigger_in_falling_edge, ro_trigger_in_rising_edge, ro_trigger_in_falling_edge, gate_out_active_high, gate_out_active_low, trigger_out_rising_edge, trigger_out_falling_edge, ro_trigger_out_rising_edge, ro_trigger_out_falling_edge, sync.
  Usually left to the configuration file. Gating, triggering etc. are enabled only by calling the timing command.
  Please refer to SLS Detectors FAQ documentation for more detailed information about the usage.

master i
  Sets the master of a multi-controller detector to the controller with index i. -1 removes master. Setting a master is useful only if the controllers are synchronized via hardware using the external IO signals. Usually left to the configuration file. Please refer to SLS Detectors FAQ documentation for more detailed information about the usage.
sync s
  Sets the synchronization mode of the various controller within a detector structure. s acn be none, gating, trigger, complementary. Check that the detectors are correctly connected to avoid freezing of the acquisition. Usually left to the configuration file. Please refer to SLS Detectors FAQ documentation for more detailed information about the usage.
trimdir s
  Obsolete. Same ad settingsdir.
settingsdir s
  Sets the path of the drectory where the trim/settings files are stored. Usually left to the configuration file.
caldir s
  Sets the path of the drectory where the calibration files are stored. Can be the same as settingsdir. Usually left to the configuration file.
trimen n e1 e2 ...en
  Unused. Sets the list of energies for which trimfiles exist.
port p
  Sets the port used by the sockets to control the detector. Do not change! Usually left to the configuration file.
stopport p
  Sets the port used by the sockets to stop/get the status of the detector. Do not change! Usually left to the configuration file.
add s
  Avoid using it. Adds the controller s to the detector structure.
remove i
  Avoid using it. Removes the controller in position i from the detector structure.
id:i l
  Avoid using it. configures the id of the detector structure. i is the detector position in a multi detector system and l is the id of the detector to be added.
free i
  Avoid using it. Frees the shared memory.
exitserver
  Avoid using it. Turns off the communication server on the detector.

### Receiver - GOTTHARD/EIGER

detectormac mac
  sets the mac of the detector udp interface to mac (if configurable). Should be left to the configuration file.
rx_tcpport i
  sets the communication port between client and receiver. Should be left to the configuration file.
rx_udpport i
  sets the communication port between detector and receiver. Should be left to the configuration file.
rx_hostname s
  sets the hostname (or IP address) of the receiver for the TCP/IP interface with the client.
rx_udpip ip
  sets the IP address of the receiver for the UDP interface with the detector.
rx_fifodepth v
  sets receiver fifo depth to value v. Default for EIGER is 100 frames betweeen listening and writing.
r_online b
  sets the receiver in online (1) or offline (0) mode.
r_lock b
  Locks (1) or unlocks (0) the receiver to this PC.
receiver s
  starts/stops the receiver to listen to detector packets. - can be start or stop

### Postprocessing

Some advanced commands to configure data postprocessing.

ffdir dir
  Sets the directory where the flat field files are stored. Normally left to the configuration file.
darkimage fname
  GOTTHARD- ADVANCED- Sets fname as dark image file for the detector.
gainimage fname
  GOTTHARD- ADVANCED- Sets fname as gain image file for the detector.
badchannels fname
  Sets the bad channel file to fname. Bad channels will be omitted in the .dat file. none to unset. Normally left to the configuration file.
threaded b
  Avoid changing it. Sets if the data are written to disk in parallel with the acquisition (1) or after the acquisition (0). Normally left to the configuration file.

Angular conversion

globaloff deg
  Sets the offset of the beamline i.e. angular position of channel 0 when angular encoder at 0. Normally left to the configuration file.
angconv fname
  Sets the file with the coefficients for angular conversion. none disables angular conversion. Normally left to the configuration file.
binsize deg
  Sets the size of the angular bins for angular coversion. Normally left to the configuration file.
angdir i
  Sets the angular direction of the detector (1 means channel number in the same direction as the angular encoder, -1 different direction). Normally left to the configuration file.
d:moveflag i
  Related to a single controller d. 1 if the detector modules move with the angular encoder, 0 if they are static (useful for multidetector systems). Normally left to the configuration file.

### Testing - EIGER specific

Some VERY ADVANCED testing functions implemented for EIGER:

pulsechip n
  sets the chip into test mode with resmat = 0 and externalenable =1. Pulses chip by togglying the enable n number of times. The acquire is then done with no pixel matrix reset before the acquisition. If n, the chip will be set into normal mode. This is necessary to restore normal chip operations after the test.
pulse n x y
  Pulses pixel at coordinates (x,y) n number of times.
pulsenmove n x y
  Pulses pixel n number of times and moves relatively by x value (x axis) and y value (y axis)

## Detector settings

Advanced settings changing the analog or digital performance of the acquisition. Use them only if you are sure of what you are doing!

vthreshold n
  Sets the DAC value of the detector threshold to n.
vcalibration n
  Sets the DAC value of the calibration pulse amplitude to n.
vtrimbit n
  Sets the DAC value defining the trimbits LSB size to n.
vpreamp n
  Sets the DAC value of the preamp feedback to n.
vshaper1 n
  Sets the DAC value of the shaper1 feedback to n.
vshaper2 n
  Sets the DAC value of the shaper2 feedback to n.
vhighvoltage n
  Sets the DAC value of the high voltage to n (in V).
vapower n
  CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
vddpower n
  CHIPTEST BOARD ONLY - Sets the DAC value of the analog voltage to n.
vshpower n
  CHIPTEST BOARD ONLY - Sets the comparator power supply in dac units (0-1024).
viopower n
  CHIPTEST BOARD ONLY - Sets the FPGA I/O power supply in dac units (0-1024).
vref_ds n
  Sets vrefds
vcascn_pb n
  Sets vcascn_pb
vcascp_pb n
  Sets vcascp_pb
vout_cm n
  Sets vout_cm
vcasc_out n
  Sets vcasc_out
vin_cm n
  Sets vin_cm
vref_comp n
  Sets vref_comp
ib_test_c n
  Sets ib_test_c
vsvp n
  Sets vsvp DAC to n
vsvn n
  Sets vsvn DAC to n
vtr n
  Sets vtr DAC to n
vrf n
  Sets vrf DAC to n
vrs n
  Sets vrs DAC to n
vtgstv n
  Sets vtgstv DAC to n
vcmp_ll n
  Sets vcmp_ll DAC to n
vcmp_lr n
  Sets vcmp_lr DAC to n
vcmp_rl n
  Sets vcmp_rl DAC to n
vcmp_rr n
  Sets vcmp_rr DAC to n
vcall n
  Sets vcall DAC to n
rxb_rb n
  Sets rxb_rb DAC to n
rxb_lb n
  Sets rxb_rb DAC to n
vcp n
  Sets vcp DAC to n
vcn n
  Sets vcn DAC to n
vis n
  Sets vis DAC to n
iodelay n
  Sets iodelay to n
reg a d
  Write to register of address a the data d
clkdivider n
  Sets the clock divider for the readout. Can be increased for longer cables. For EIGER options are 0 (full speed), 1 (half speed), 2 (quarter speed), and 3 (slow).
setlength n
  Changes the length of the set/reset signals in the acquisition. Never reduce it!
waitstates n
  Sets the wait states for CPU/FPGA communication. Do not change it!
totdivider n
  Sets the tot clock divider.
totdutycycle n
  Sets the tot duty cycle.
setup s
  Loads the setup files to the detector (config, parameters, trimbits etc.).
trimbits fn
  Loads the trimbit files fn.snxxx to the detector

## Debug

digibittest i
  only for GOTTHARD. If i=1, the acquisition will return a unique channel identifier, instead of data, if i=0 normal acquisition.

Next: Retrieving detector parameters Up: SLS Detector text clients Previous: Acquisition