previous.gif Internal features - Top - Data format next.gif

The Midas system provides several off-the-shelf programs to control, monitor, debug the data aquisition system. Starting with the main utility (odbedit) which provide access to the Online data base and run control.


Midas Frontend application

The purpose of the Midas Frontend application is to collect data from hardware and transmit this information to a central place where data logging and analysis can be performed. This task is achieved with a) a specific code written by the user describing the sequence of action to acquire the hardware data and b) a framework code handling the data flow control, data transmission and run control operation. From Midas version 1.9.5 a new argument (-i index) has been introduced to facilitate the multiple frontend configuration operation required for the Event Builder Functions.


odbedit task

odbedit refers to the Online DataBase Editor. This is the main application to interact with the different components of the Midas system.

See ODB Structure for more information.

[local:midas:Stopped]/>help
Database commands ([] are options, <> are placeholders):

alarm                   - reset all alarms
cd <dir>                - change current directory
chat                    - enter chat mode
chmod <mode> <key>      - change access mode of a key
                          1=read | 2=write | 4=delete
cleanup                 - delete hanging clients
copy <src> <dest>       - copy a subtree to a new location
create <type> <key>     - create a key of a certain type
create <type> <key>[n]  - create an array of size [n]
del/rm [-l] [-f] \<key>  - delete a key and its subkeys
  -l                      follow links
  -f                      force deletion without asking
exec <key>/<cmd>        - execute shell command (stored in key) on server
find <pattern>          - find a key with wildcard pattern
help/? [command]        - print this help [for a specific command]
hi [analyzer] [id]      - tell analyzer to clear histos
ln <source> <linkname>  - create a link to <source> key
load <file>             - load database from .ODB file at current position
ls/dir [-lhvrp] [<pat>] - show database entries which match pattern
  -l                      detailed info
  -h                      hex format
  -v                      only value
  -r                      show database entries recursively
  -p                      pause between screens
make [analyzer name]    - create experim.h
mem                     - show memeory <b> Usage </b>
mkdir <subdir>          - make new <subdir>
move <key> [top/bottom/[n]] - move key to position in keylist
msg [user] <msg>        - compose user message
old                     - display old messages
passwd                  - change MIDAS password
pause                   - pause current run
pwd                     - show current directory
resume                  - resume current run
rename <old> <new>      - rename key
rewind [channel]        - rewind tapes in logger
save [-c -s] <file>     - save database at current position
                          in ASCII format
  -c                      as a C structure
  -s                      as a #define'd string
set <key> <value>       - set the value of a key
set <key>[i] <value>    - set the value of index i
set <key>[*] <value>    - set the value of all indices of a key
set <key>[i..j] <value> - set the value of all indices i..j
scl [-w]                - show all active clients [with watchdog info]
shutdown <client>/all   - shutdown individual or all clients
sor                     - show open records in current subtree
start [number] [now] [-v]   - start a run [with a specific number], [without question]
                           [-v verbose the transaction to the different clients]
stop [-v]                   - stop current run
                           [-v verbose the transaction to the different clients]
trunc <key> <index>     - truncate key to [index] values
ver                     - show MIDAS library version
webpasswd               - change WWW password for mhttpd
wait <key>              - wait for key to get modified
quit/exit               - exit


mstat task

mstat is a simple ASCII status display. It presents in a compact form the most valuable information of the current condition of the Midas Acquisition system. The display is composed at the most of 5 sections depending on the current status of the experiment. The section displayed in order from top to bottom refer to:


analyzer task

analyzer is the main online / offline event analysis application. analyzer uses fully the ODB capabilities as all the analyzer parameters are dynamically controllable from the Online Database editor odbedit task.

For more detailed information see MIDAS Analyzer


mlogger task

mlogger is the main application to collect data from the different frontends under certain conditions and store them onto physical device such as disk or tape. It also acts as a history event collector if either the history flags are enabled in the frontend equipment (see The Equipment structure or if the ODB tree /History/Links is defined (See History system). See the ODB /Logger Tree for reference on the tree structure.


lazylogger task

lazylogger is a midas application for saving midas files created by mlogger to permanent storage such as tape media, DCACHE and CASTOR HSM systems, USB disks, etc and for managing the disk space used by mlogger. One can think of lazylogger as a light weight HSM manager.

Because most external data storage devices are "not real time" in the sense that they are subject to arbitrary delays when tapes need to be changed or when network connections to an HSM system become congested, a typical midas daq system will be configured with mlogger writing midas data files to a local disk, often configured as a raid array for improved performance, and with lazylogger copying these files to permanent storage and deleting old files to make space for new data.

Multiple lazylogger programs can used at the same time to make multiple copies of midas data files to different locations. Each copy of lazylogger would use a different channel name specified by the "-c" command line switch. When using multiple lazyloggers, one should take care to check that only one of them is configured to delete old data files.

When one output device cannot keep up with data, multiple lazylogger programs can used to write data to multiple outputs in parallel. For example, using the ODB "Modulo.Position" option, one can configure the 1st lazylogger to write the odd runs to the first tape drive and the 2nd lazylogger to write even runs to the second tape drive.

lazylogger implements several methods for writing files, controlled by ODB "/Lazy/.../Settings/Backup type":

To reduce load on the daq system, lazylogger implements several "stay-behind" schemes, controlled by ODB "/Lazy/.../Settings/Stay behind":

When using the mlogger subrun feature, where multiple midas output files are created for each run, please configure midas as following:

For each lazylogger channel, configuration is stored in ODB under /Lazy/<channel_name>/... as explained below.


mdump task

This application allows to "peep" into the data flow in order to display a snap-shot of the event. Its use is particularly powerful during experiment setup. In addition mdump has the capability to operate on data save-set files stored on disk or tape. The main mdump restriction is the fact that it works only for events formatted in banks (i.e.: MIDAS, YBOS bank).


mevb task

mevb is an event builder application taking several frontends Midas data source and assembles a new overall Midas event.

In the case where overall data collection is handled by multiple physically separated frontends, it could be necessary to assemble these data fragments into a dedicated event. The synchonization of the fragment collection is left to the user which is done usually through specific hardware mechanism. Once the fragments are composed in each frontend, they are sent to the "Event Builder" (eb) where the serial number (pheader->serial_number) of each fragment is compared one event at a time for serial match. In case of match, a new event will be composed with its own event ID and serial number followed by all the expected fragments. The composed event is then sent to the next stage which is usually the data logger (mlogger).

The mhttpd task will present the status of the event builder as an extra equipment with its corresponding statistical information.


mspeaker, mlxspeaker tasks

mspeaker, mlxspeaker are utilities which listen to the Midas messages system and pipe these messages to a speech synthesizer application. mspeaker is for the Windows based system and interface to the FirstByte/ProVoice package. The mlxspeaker is for Linux based system and interface to the Festival. In case of use of either package, the speech synthesis system has to be installed prior to the activation of the mspeaker, mlxspeaker.


mcnaf task

mcnaf is an interactive CAMAC tool which allows "direct" access to the CAMAC hardware. This application is operational under either of the two following conditions:
  1. mcnaf has been built against a particular CAMAC driver (see CAMAC drivers).
  2. A user frontend code using a valid CAMAC driver is currently active. In this case the frontend acts as a RPC CAMAC server and will handle the CAMAC request. This last option is only available if the frontend code (mfe.c) from the Building Options has included the HAVE_CAMAC pre-compiler flag.

Thu> cd /midas/utils
Thu> make -f makefile.mcnaf DRIVER=kcs2927
gcc -O3 -I../include -DOS_LINUX -c -o mcnaf.o mcnaf.c
gcc -O3 -I../include -DOS_LINUX -c -o kcs2927.o ../drivers/bus/kcs2927.c
gcc -O3 -I../include -DOS_LINUX -o miocnaf mcnaf.o kcs2927.o  ../linux/lib/libmidas.a -lutil
gcc -O3 -I../include -DOS_LINUX -c -o wecc32.o ../drivers/bus/wecc32.c
gcc -O3 -I../include -DOS_LINUX -o mwecnaf mcnaf.o wecc32.o  ../linux/lib/libmidas.a -lutil 
gcc -O3 -I../include -DOS_LINUX -c -o camacrpc.o ../drivers/bus/camacrpc.c
gcc -O3 -I../include -DOS_LINUX -o mcnaf mcnaf.o camacrpc.o  ../linux/lib/libmidas.a -lutil 
gcc -O3 -I../include -DOS_LINUX -c -o camaclx.o ../drivers/bus/camaclx.c
gcc -O3 -I../include -DOS_LINUX -o mdrvcnaf mcnaf.o camaclx.o  ../linux/lib/libmidas.a -lutil 
rm *.o


melog task

Electronic Log utility. Submit full Elog entry to the specified Elog port.


mhdump task

History file dump application.

Usage: mhdump [-h] [-L] [-n] [-t] [-E event_id] [-T tag_name] file1.hst file2.hst ...

To run mhdump, give it any number of history file names. By default mhdump will print all information available in the file in a human-readable and computer-parsable format.

Derivative from mhdump are utilities mh2sql for importing history files into an SQL database and mhrewrite for changing the structure of history files.

To limit the output to given events and tags, use the "-E" and "-T" command line switches. To only see event definitions, use the "-L" command line switches. Other available command line switches and options are listed here:

Switches:
  -h --- print this help message
  -L --- list tag definitions only
  -t --- omit tag definitions
  -n --- omit variable names

Examples:
  To list all existing tags: mhdump -L file1.hst file2.hst ...
  To show data for all events, all tags: mhdump file1.hst file2.hst ...
  To show all data for event 0: mhdump -E 0 file1.hst file2.hst ...
  To show data for event 0, tag "State": mhdump -n -E 0 -T State file1.hst file2.hst ...
  To show data for event 3, tag "MCRT", array index 5: mhdump -n -E 3 -T MCRT[5] file1.hst file2.hst ...

Example:

./linux/bin/mhdump ~/alpha/alphacpc09-elog-history/history/081101.hst
...
Event 6001, "labview/LTMP", size 680, 17 tags.
  Tag 0: "TMP.SOL.IGBT"[1], type "DOUBLE" (10), type size 8, offset 0+8
  Tag 1: "TMP.SOL.Diode"[1], type "DOUBLE" (10), type size 8, offset 8+8
  Tag 2: "TMP.SOL.DiodeOut"[1], type "DOUBLE" (10), type size 8, offset 16+8
  Tag 3: "TMP.SOL.PosBus"[1], type "DOUBLE" (10), type size 8, offset 24+8
  Tag 4: "TMP.USTR.IGBT"[1], type "DOUBLE" (10), type size 8, offset 32+8
  Tag 5: "TMP.USTR.Diode"[1], type "DOUBLE" (10), type size 8, offset 40+8
  Tag 6: "TMP.USTR.CrossOver"[1], type "DOUBLE" (10), type size 8, offset 48+8
  Tag 7: "TMP.USTR.PosBus"[1], type "DOUBLE" (10), type size 8, offset 56+8
  Tag 8: "TMP.OCT.IGBT"[1], type "DOUBLE" (10), type size 8, offset 64+8
  Tag 9: "TMP.OCT.Diode"[1], type "DOUBLE" (10), type size 8, offset 72+8
  Tag 10: "TMP.OCT.CrossOver"[1], type "DOUBLE" (10), type size 8, offset 80+8
  Tag 11: "TMP.OCT.PosBus"[1], type "DOUBLE" (10), type size 8, offset 88+8
  Tag 12: "TMP.DSTR.IGBT"[1], type "DOUBLE" (10), type size 8, offset 96+8
  Tag 13: "TMP.DSTR.Diode"[1], type "DOUBLE" (10), type size 8, offset 104+8
  Tag 14: "TMP.DSTR.CrossOver"[1], type "DOUBLE" (10), type size 8, offset 112+8
  Tag 15: "TMP.DSTR.PosBus"[1], type "DOUBLE" (10), type size 8, offset 120+8
  Tag 16: "LTMP_Timestamp"[1], type "DOUBLE" (10), type size 8, offset 128+8
6001 1225494000  TMP.SOL.IGBT=22.7  TMP.SOL.Diode=23.1  TMP.SOL.DiodeOut=24.1  TMP.SOL.PosBus=24  TMP.USTR.IGBT=23.3  TMP.USTR.Diode=23.2  TMP.USTR.CrossOver=23.
5  TMP.USTR.PosBus=23.8  TMP.OCT.IGBT=23.5  TMP.OCT.Diode=23.2  TMP.OCT.CrossOver=23.9  TMP.OCT.PosBus=23.8  TMP.DSTR.IGBT=22  TMP.DSTR.Diode=22.1  TMP.DSTR.Cros
sOver=23  TMP.DSTR.PosBus=23.1  LTMP_Timestamp=3308338795.271  Fri Oct 31 16:00:00 2008
...


mh2sql task

Import history files into SQL database.

Usage: mh2sql odbc_dsn file1.hst file2.hst ...

mh2sql imports history files into an SQL database in the same way as if they were written into the database by mlogger.

Switches:
  -h --- print this help message

Examples:
  ...


mhist task

History data retriever.

   mhist -e 5 -v "I-WC1+_Anode" -t 3600 -s 240400 -p 250400
  Apr 24 00:00:09 2000    160
  Apr 24 01:00:12 2000    160
  Apr 24 02:00:13 2000    160
  Apr 24 03:00:14 2000    160
  Apr 24 04:00:21 2000    180
  Apr 24 05:00:26 2000    0
  Apr 24 06:00:31 2000    160
  Apr 24 07:00:37 2000    160
  Apr 24 08:00:40 2000    160
  Apr 24 09:00:49 2000    160
  Apr 24 10:00:52 2000    160
  Apr 24 11:01:01 2000    160
  Apr 24 12:01:03 2000    160
  Apr 24 13:01:03 2000    0
  Apr 24 14:01:04 2000    0
  Apr 24 15:01:05 2000    -20
  Apr 24 16:01:11 2000    0
  Apr 24 17:01:14 2000    0
  Apr 24 18:01:19 2000    -20
  Apr 24 19:01:19 2000    0
  Apr 24 20:01:21 2000    0
  Apr 24 21:01:23 2000    0
  Apr 24 22:01:32 2000    0
  Apr 24 23:01:39 2000    0


mchart task

mchart is a periodic data retriever of a specific path in the ODB which can be used in conjunction with a stripchart graphic program.

Two possible stripchart available are:

Once the configuration file has been created, it is possible to apply any valid operation (equation) to the parameters of the file following the gstripchart syntax.

In the case of the use of the stripchart from G.Hofman, only the "filename", "pattern", "maximum", "minimum" fields are used.

When using mchart with -D Argument, it is necessary to have the MCHART_DIR defined in order to allow the daemon to find the location of the configuration and data files (see Environment variables).

chaos:~/chart> more trigger.conf 
#Equipment:            >/equipment/kos_trigger/statistics
menu:                   on
slider:                 on
type:                   gtk
minor_ticks:            12
major_ticks:            6
chart-interval:         1.000
chart-filter:           0.500
slider-interval:        0.200
slider-filter:          0.200
begin:        Events_sent
  filename:     /home/chaos/chart/trigger
  fields:       2
  pattern:      Events_sent
  equation:     \$2
  color:        \$blue
  maximum:      1083540.00
  minimum:      270885.00
  id_char:      1
end:            Events_sent
begin:        Events_per_sec.
  filename:     /home/chaos/chart/trigger
  fields:       2
  pattern:      Events_per_sec.
  equation:     $2
  color:        \$red
  maximum:      1305.56
  minimum:      326.39
  id_char:      1
end:            Events_per_sec.
begin:        kBytes_per_sec.
  filename:     /home/chaos/chart/trigger
  fields:       2
  pattern:      kBytes_per_sec.
  equation:     $2
  color:        \$brown
  maximum:      898.46
  minimum:      224.61
  id_char:      1
end:            kBytes_per_sec.

A second file (data file) will be updated a fixed interval by the {mchart} utility.

  chaos:~/chart> more trigger
    Events_sent 6.620470e+05
    Events_per_sec. 6.463608e+02
    kBytes_per_sec. 4.424778e+02


mtape task

Tape manipulation utility.


dio task

Direct I/O task provider (LINUX).

If no particular Linux driver is installed for the CAMAC access, the dio- program will allow you to access the I/O ports to which the CAMAC interface card is connected to.


stripchart.tcl file

Graphical stripchart data display. Operates on mchart task data or on Midas history save-set files. (see also History system).

stripchart.tcl mhist mode: main window with pull-downs.
stripchart1.jpg

stripchart.tcl Online data, running in conjunction with mchart
stripchart2.jpg


rmidas task

Root/Midas remote GUI application for root histograms and possible run control under the ROOT. environment.

rmidas display sample. Using the example/experiment/ demo setup.
rmidas.jpg


hvedit task

High Voltage editor, graphical interface to the Slow Control System. Originally for Windows machines, but recently ported on Linux under Qt by Andreas Suter.


mserver task

mserver provides remote access to any midas client. To use it, start the mserver on the machine hosting midas shared memory buffers (manually via "mserver -D" or automatically via xinetd). On all other machines, set the environement variable MIDAS_SERVER_HOST to the hostname of the machine running the mserver or add the command line switch "-h hostname:port" to midas programs that support it (i.e. "odbedit -h hostname"). If multiple experiments share the same computer, one can still use the mserver: either run separate mservers for each experiment using non-default TCP ports or define the experiments in the global /etc/exptab file and run the mserver from xinetd. When running from xinetd, the mserver will select the correct experiment and setuid() into the correct user account. The mserver task usually runs in the background and does not need to be modified. In the case where debugging is required, the mserver can be started with the -d flag which will write an entry for each transaction appearing onto the mserver. This log entry contains the time stamp and RPC call request.


Midas DOC Version 3.0.0 ---- PSI Stefan Ritt ----
Contributions: Pierre-Andre Amaudruz - Sergio Ballestrero - Suzannah Daviel - Doxygen - Peter Green - Qing Gu - Greg Hackman - Gertjan Hofman - Paul Knowles - Exaos Lee - Rudi Meier - Glenn Moloney - Dave Morris - John M O'Donnell - Konstantin Olchanski - Renee Poutissou - Tamsen Schurman - Andreas Suter - Jan M.Wouters - Piotr Adam Zolnierczuk