ems_control setup commands

setup is done by filling special variables whose content is used at the appropriate time. In most cases this is a list of several EMS procedure names (either VED, IS, or trigger procedures) with their argument list.

The following actions are performed when activating one of the main buttons in the ems_control window:

Init
initializes the VED: definition of datains and dataouts, execution of
  1. init_proclist
  2. init_command
  3. init_proclist_t
Start
starts the readout, execution of
  1. start_proclist
  2. start_command
  3. start_proclist_t
Stop
stops the readout, execution of
  1. reset_proclist
  2. reset_command
  3. reset_proclist_t
NOTE: "*_proclist" and "*_command" are arrays, for each instrumentation system one array element can be specified, the array elements are executed in arbitrary order; "*_proclist_t" can be defined only once per VED, so it's a simple variable.

general variables

set description <description>
used for information purposes only, has no real relevance
set vedname <vedname>
opens the VED <vedname>
corresponds to the EMS command "ems_open <vedname>"
set eventbuilder 0/1
specifies if the server acts as an eventbuilder
set datain(<datain index>) <buffertype addresstype address>|<buffer address>
creates a datain specified by the integer number <datain index>,
corresponds to the EMS command "<VED_procedure> datain create <datain index> ..."
set dataout(<dataout index>) <buffertype buffersize priority addresstype address>|<buffer address>
creates a dataout specified by the integer number <dataout index>,
corresponds to the EMS command "<VED_procedure> dataout create <dataout index> ..."
set dataout_for_config_records <list of dataout indices>
specifies to which dataouts config records shall be written, otherwise the event manager dataouts are used
NOTE: one may add own files to be written to dataout by extending the "setup_sources" array, but care has to be taken not to overwrite filenames already defined
set modullist {<module address 1> <module type 1> <module address 2> <module type 2> ...}
creates a module list where each module is specified by a {address type} pair,
corresponds to the EMS command "<VED_procedure> modullist create {<module address> <module type> ...}"
set vars(<index>) [<size>]
creates an EMS variable specified by <index> with size <size> (default: '1'),
corresponds to the EMS command "<VED_procedure> var create <index> [<size>]"
set var_init(<index>) {<list of values>}
fills the EMS variable specified by <index> with <list of values>,
corresponds to the EMS command "<VED_procedure> var write <index> <data> ..."
NOTE: the number of values must be equal to the "size" argument given when creating the variable with "set vars"

trigger variables

set trigger {<trigger procedure> <arguments>}
specifies the trigger procedure to be used, here, <arguments> needs not to be a list (because only one trigger procedure can be used)
set init_proclist_t {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
procedures to be executed when initializing the data acquisition system
set start_proclist_t {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
procedures to be executed when just before starting the data acquisition
set reset_proclist_t {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
procedures to be executed just after stopping the data acquisition
set triggermaster 0/1
defines if - in case of the usage of a synchronization module - this VED acts as trigger master

instrumentation system variables

set isid(<IS index>) <IS identification>
sets the ID of instrumentation system <IS index>,
corresponds to the EMS command "<VED_procedure> is create <IS index> <IS identification>"
NOTE: the <IS index> is used to address the instrumentation system, the <IS identification> will appear in the raw data only.
set memberlist(<IS index>) <list of addresses>
sets the memberlist of instrumentation system <IS index>,
corresponds to the EMS command "<IS_procedure> memberlist create <list of addresses>"
set init_proclist(<IS index>) {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
defines the procedures the instrumentation system <IS index> will execute at initialization time
set start_proclist(<IS index>) {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
defines the procedures the instrumentation system <IS index> will execute just before starting the data acquisition
set reset_proclist(<IS index>) {<procedure 1> {<argument list>} <procedure 2> {<argument list>} ...}
defines the procedures the instrumentation system <IS index> will execute just after stopping the data acquisition
set init_command(<IS index>) <name of a user written procedure>
defines the name of a user written procedure the instrumentation system <IS index> will call at initialization time
set start_command(<IS index>) <name of a user written procedure>
defines the name of a user written procedure the instrumentation system <IS index> will call just before starting the data acquisition
set reset_command(<IS index>) <name of a user written procedure>
defines the name of a user written procedure the instrumentation system <IS index> will call just after stopping the data acquisition
set init_args(<IS index>) <list of arguments>
sets the arguments which will be passed to the user written procedure specified with "set init_command"
NOTE: the passed arguments will be: <VED procedure> <IS procedure> <argument 1> <argument 2> ...
set start_args(<IS index>) <list of arguments>
sets the arguments which will be passed to the user written procedure specified with "set start_command"
NOTE: the passed arguments will be: <VED procedure> <IS procedure> <argument 1> <argument 2> ...
set reset_args(<IS index>) <list of arguments>
sets the arguments which will be passed to the user written procedure specified with "set reset_command"
NOTE: the passed arguments will be: <VED procedure> <IS procedure> <argument 1> <argument 2> ...
set readoutprio(<IS index>.<readout index>) <priority>
sets the readout priority of this specific readout,
corresponds to the "<priority>" argument in the EMS command "<IS_procedure> readoutlist create <priority> <trigger list> <list of procedure and argument_list pairs>"
set readouttrigg(<IS index>.<readout index>) <list of triggers>
sets the list of triggers which start this specific readout,
corresponds to the "<trigger list>" argument in the EMS command "<IS_procedure> readoutlist create <priority> <trigger list> <list of procedure and argument_list pairs>"
set readoutproc(<IS index>.<readout index>) <list of procedure and argument_list pairs>
creates a list of procedures to be executed by this specific readout,
corresponds to the "<list of procedure and argument_list pairs>" argument in the EMS command "<IS_procedure> readoutlist create <priority> <trigger list> <list of procedure and argument_list pairs>"
NOTE: "IS index" = 0 isn't a real instrumentation system, so only VED commands are possible, no IS commands; it's useful for executing commands affecting the whole VED.

miscellaneous commands

output <text> [tags]
print text to the log window.
possible tags: time, anfang, any, tag_red, tag_green, tag_blue, tag_orange, tag_yellow, tag_under, tag_strike

setup files

in a master setup file the array "setupfile" is to be filled with the names of the individual setup files, one for each VED, e.g.

set setupfile(abcd) {experiment.abcd.wad}
set setupfile(efgh) {experiment.efgh.wad}
the individual setup files normally have the following content:

example

set vedname abcd
set description {sample setup}

set triggermaster 1
set eventbuilder 1

set isid(1) 1
set isid(2) 2
set isid(3) 5

set modullist {1 xaa 2 xab 3 xac 4 xad 5 xae}
set memberlist(1) {1 2}
set memberlist(2) {3 4 5}
# 3 has no members

set vars(1) 2
set var_init(1) "1111 2222"
set vars(10) 1
# 10 is left un-initialized

# setup for IS 1, readout 1 --> 1.1
set readouttrigg(1.1) {1}
set readoutprio(1.1) 1
set readoutproc(1.1) {FERAreadoutZEL {}}
# setup for IS 2, readout 1 --> 2.1
set readouttrigg(2.1) {1 2 3}
set readoutprio(2.1) 1
set readoutproc(2.1) {FERAreadoutZEL {} Echo {17 18}}
# setup for IS 2, readout 2 --> 2.2
set readouttrigg(2.2) {4}
set readoutprio(2.2) 2
set readoutproc(2.2) {FERAreadoutZEL {}}
# is 3 has no readout

set dataout(0) {cluster 1 0 null}

set trigger {zel '/tmp/sync0' 1 10 2 1}

# executed once
set init_proclist(0) {CCCI {0}}
# executed before each Start
set start_proclist(1) {Ferareset {17}}
# executed after each Stop
set reset_proclist(1) {Ferareset {17}}

# executed once
set init_proclist_t {InitPCITrigger {'/tmp/sync0' 0} CCCZ {1}}
# executed before each Start
set start_proclist_t {InitPCITrigger {'/tmp/sync0' 0} CCCZ {1}}
# executed after each Stop
set reset_proclist_t {InitPCITrigger {'/tmp/sync0' 0} CCCZ {1}}

# executed as "eval $procedurename ved is $argumentlist"
set init_command(0) procedurename
set init_args(0) argumentlist
set start_command(0) procedurename
set start_args(0) argumentlist
set reset_command(0) procedurename
set reset_args(0) argumentlist