CountersFerdi Franceschini2006-08-16 16:24Beam monitors have not been documented completely in either the PSI source code
or on the Bragg Institute Plone CMS. Therefore, this document is a standalone document,
not edited from another source. Beam monitorsWhen you are doing an experiment with the main detector, you don't address beam
monitors directly. You would normally select and configure the beam monitor to control
your experiment using the histmem command.However, you may want to use a scan command with a beam monitor and without the main
detector. This can be done with bmonscan which is a SICS scan object.
For more detail on bmonscan, see the chapter "Simple Scans". Instruments often have more than one beam monitor. SICS has a multicounter interface
named bm, which is a list of all the beam monitors on the instrument,
usually 2 or 3 beam monitors with names bm1, bm2 and bm3. You must select which beam
monitor will control your experiment. When you run the experiment using bm, all the beam
monitors on the instrument will count, and with most instrument configurations, the
values will be saved to the data file - you should check this is the case if you need
these values. Selecting a beam monitor for bmbmonscan setchannelnSets the active beam monitor. n = 0 is bm1, n
=1 is bm2 etc. This is the preferred command when doing a
bmonscanbm setchannelnSets the active beam monitor. n = 0 is bm1, n
=1 is bm2 etc. This is the alternate command when using
bmonscanhistmem modeMONITOR_nSets the active beam monitor. n = 1 is bm1, n
=2 is bm2 etc.Use this command when using histmemrunscan also has an argument to select the beam monitor. Do not use these interchangably e.g. do not use bm setchanneln to set histmem modeMONITOR_n. It will not work. Since there are four commands for selecting beam monitor, you have to be careful
to use the right one. Be explicit with your selection of beam monitor when using
these commands. Don't assume. If you are using histmem to control the detector, set the beam
monitor using histmem mode. If you are using bmonscan set the beam monitor using
bm setchannel or bmonscan setchannelIf you are using runscan set the beam monitor with the
mode setting in the runscan arguments.Setting modes for the beam monitorsThe mode for a beam monitor, either or
can be set using bm mode, where bm can
be bm, bm1, bm2 etc. The mode of the mulitcounter bm may be
different from the mode of the selected beam monitor e.g. bm1
mode. Even if you select bm1 using bm setchannel 0 or
bmonscan setchannel 0, changing the mode of bm1 e.g.
bm1 mode monitor will not change bm mode.bm mode is set by the most recent bmonscan
run. Active beam monitor commands (bm)The active beam monitor bm has the following commands. These
commands are get onlybm_presetscalar value at which an acquisition will be stopped. Used in
conjunction with modeget onlytree interface /monitor/presetbm_modemode to stop acquisitions, either or
get onlyReturn values: will stop acquisition preset
seconds after the acquisition is started will stop acquisition
preset counts after the acquisition is startedtree interface /monitor/modetree interface onlygets the scalar value for the instantaneous time of the beam monitor
selected to control the experiment. get onlyUnits: secondstree interface /monitor/timetree interface onlygets the scalar value for the instantaneous counts of the beam monitor
selected to control the experiment. get onlyUnits: countstree interface /monitor/databm is available in the tree interface under the /monitor node,
and attributes can be set and get using the hget and
hset commands. Specific beam monitor commands (bm1)Each beam monitors are accessible as SICS objects, and in the tree interface under
the /monitor node. They can be addressed by name, or using the hget commands when
using the tree interface. There are generally either 1, 2 or 3 monitor per
instrument, and the commands are of the formbm1_...where 1 can be 1, 2 or 3For simplicity, all the command descriptions below will use bm1bm1_countsreturns the instanteous value of the number of countsUnits: countstree interface /monitor/bm1_countsbm1_event_ratereturns the instanteous value of the count rateUnits: counts per secondtree interface
/monitor/bm1_event_ratebm1_timereturn the instantaneous time on this beam monitor. Each beam monitor
can have a unique time value. Units: secondstree interface /monitor/bm1_timebm1_statusReturn values: Beam monitor is enabled Beam monitor is disabledtree interface /monitor/bm1_statusCommands used on both active (bm) and specific (bm1) beam monitorsUse the commands on either bm or bm1Please replace bm1 with the beam monitor you want to
control. A setting on bm will not change the setting on the
selected beam monitor e.g. bm1bm1 preset valueget or set a preset value for
bm1. This is the value at which the
acquisition will be stopped. Used in conjunction with
modebm1 mode valueget or set the mode to stop acquisitions, either
or value must be one of these options will stop acquisition preset
seconds after the acquisition is started will stop acquisition
preset counts after the acquisition is startedbm1 statusreturns the monitor status. e.g. bm1.CountStatus = 10000 0 Beam: 0 E6= preset, current control value, current counts. The current counts may be high by 10 times. To be tested and fixed.
bm1 count valueSets the preset to value and runs the
counter to the preset.Use hget with the tree interface e.g. hget
/monitor/bm1_counts. hget /monitor/bm1_counts will return the same value as
bm1_countsThese attributes are get only e.g. hget /monitor/bm1_countsThe next section refers to histmem which is most commonly used.
The second section will refer to bm, and how it interacts with
histmemConfiguring countersCounters must be configured into the SICS server with the MakeCounter command, they
cannot be added dynamically to a running server. The MakeCounter command has the
following syntax MakeCounternametype[parameters]The list of parameters depends on the type of counter that is being created.